Feature selector: private API
PortfolioOptimisers.panel_field_keys — Function
panel_field_keys(f::NumericPanelField) -> Vector{String}
panel_field_keys(f::CategoricalPanelField) -> VecStr
panel_field_keys(f::TensorPanelField) -> VecStrReturn the namespace a Feature Selector entry pairs with a Panel Field's name.
A numeric Panel Field contributes one column and has no second namespace, so it answers with an empty vector. Every key paired with it is then absent, and strict decides what that means. A categorical Panel Field answers with its levels and a tensor Panel Field with its labels, and in both the position of a key is the position of the column it selects.
Algorithm
The method that Julia selects is the algorithm.
Arguments
f: The Panel Field.
Returns
keys::VecStr: The levels, the labels, or an empty vector.
Related
PortfolioOptimisers.panel_claim! — Function
panel_claim!(nz::AbstractVector{String}, labels::AbstractVector{String}) -> Vector{Int}Append a Panel Field's column names to a derived Feature Matrix's names, and return the columns they took.
The one place a derived column index is minted, so the names and the write cannot disagree about where a Panel Field's columns are.
Algorithm
- Read the current length of
nz, which is the last column already claimed. - Append
labelsto it. - Return the range of columns the append occupied, as a vector.
Arguments
nz: The derived column names under construction. It is appended to.labels: The column names to claim.
Returns
cols::Vector{Int}: The columnslabelstook, in order.
Related
PortfolioOptimisers.panel_column_transpose — Function
panel_column_transpose(v::Nothing) -> nothing
panel_column_transpose(v::AbstractVector) -> AbstractVector
panel_column_transpose(v::AbstractMatrix) -> AbstractMatrixConvert between the shape of the panel axes and the shape of one column of a derived Feature Matrix, in either direction.
A Feature Matrix holds its features on its second axis: assets × features when static, and assets × features × observations when time-varying. So one column of it is assets, or assets × observations. A numeric or a categorical Panel Field, its masks, and the universe masks hold the shape of the panel axes: assets when static, and observations × assets when time-varying, as the returns are. So a static array is the column already, and a time-varying one is the column transposed. The conversion is its own inverse.
Algorithm
The method that Julia selects is the algorithm.
nothing, a mask that marks no cell: returnnothing.- A vector: return it.
- A matrix: return its lazy transpose.
Arguments
v: An array in the shape of the panel axes, or in the shape of one column of a Feature Matrix, ornothing.
Returns
c::AbstractArray:vin the other shape.
Related
PortfolioOptimisers.panel_onehot — Function
panel_onehot(f::CategoricalPanelField; datatype::DataType = Float64) -> ArrayBuild the one-hot block a categorical Panel Field contributes to a derived Feature Matrix.
The block has one column per level. A cell holds one(datatype) in the column of its level and zero(datatype) in the others. The block is assets × levels for a static field, and assets × levels × observations for a time-varying one. The field stores the codes, and the library builds this block only where a matrix is needed.
An indicator is built rather than read, so it carries no type of its own and the caller names the one the block is stacked beside. Every caller inside the library derives that type from the data it stacks the block against, so the default is what a caller who stacks the block against nothing gets. panel_field_stack! writes the same block into a Feature Matrix under construction without building it, and takes its type from the matrix.
Algorithm
- Read the codes in the shape of one column with
panel_column_transpose, and allocate the zero array with the levels on its second axis. - Write
one(datatype)at each cell's own level.
Arguments
f: The categorical Panel Field.datatype: The element type of the block.
Returns
H::Array{datatype}: The one-hot block.
Related
PortfolioOptimisers.panel_field_stack_observed! — Function
panel_field_stack_observed!(Z::AbstractArray, f::AbstractPanelField, cols::VecInt) -> nothing
panel_field_stack_observed!(Z::AbstractArray, f::TensorPanelField, cols::VecInt) -> nothingWrite one Panel Field's observed mask into a derived Feature Matrix, as 0/1 columns.
The columns are the ones that panel_field_observed_labels names. A Panel Field with no label axis claims one column, and a TensorPanelField claims one column per label.
Algorithm
The method that Julia selects is the algorithm.
- Return when the Panel Field carries no mask.
- A Panel Field with no label axis writes its whole mask into its single column.
- A
TensorPanelFieldwrites one label slice of its mask into each column.
Arguments
Z: The derived Feature Matrix under construction.f: The Panel Field.cols: The observed-mask columns the Panel Field claims, in order.
Returns
nothing.
Related
PortfolioOptimisers.panel_value_columns! — Function
panel_value_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::NumericPanelField) -> nothing
panel_value_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::CategoricalPanelField) -> nothing
panel_value_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::TensorPanelField) -> nothingPush every value column of one Panel Field onto a resolved Feature Selector, in column order.
This is what a bare field name expands to, and what an absent selector expands to for every Panel Field of the panel. The mask is not among them, because a bare name selects the values alone.
Algorithm
The method that Julia selects is the algorithm. A numeric Panel Field pushes its one column, and the other two push one column per key of panel_field_keys.
Arguments
cols: The resolved columns so far, pushed onto in place.k: The Panel Field's position in the panel.f: The Panel Field.
Returns
nothing.colscarries the result.
Related
PortfolioOptimisers.panel_key_column! — Function
panel_key_column!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::AbstractPanelField, key::AbstractString, strict::Bool) -> nothingPush the one value column a Panel Field's level or label names onto a resolved Feature Selector.
Algorithm
- Find
keyamong the Panel Field's keys, frompanel_field_keys. - Push the column it names when it is there.
- Otherwise hand
panel_selector_msgtostrict_diagnostic, which throws understrictand warns and drops otherwise.
Arguments
cols: The resolved columns so far, pushed onto in place.k: The Panel Field's position in the panel.f: The Panel Field.key: One of its levels or labels.- Whether a
selentry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. Whenstrictisfalse, the entry warns, and the estimator drops it.
Returns
nothing.colscarries the result.
Related
PortfolioOptimisers.panel_group_columns! — Function
panel_group_columns!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, k::Integer, f::AbstractPanelField, lg::LabelGroup, strict::Bool) -> nothingPush the value columns of every label in one group of a tensor Panel Field onto a resolved Feature Selector.
Algorithm
- Read the groups of the Panel Field. A numeric or a categorical Panel Field has none, and a tensor Panel Field can carry none.
- When there are no groups, hand the message to
strict_diagnostic, which throws understrictand warns and drops otherwise. - Find the labels whose group is
lg.group. When there is none, hand the message tostrict_diagnostic, with the nearest group fromdid_you_mean. - Push the value column of each such label, in the order of the labels.
Arguments
cols: The resolved columns so far, pushed onto in place.k: The Panel Field's position in the panel.f: The Panel Field.lg: The group to select. SeeLabelGroup.- Whether a
selentry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. Whenstrictisfalse, the entry warns, and the estimator drops it.
Returns
nothing.colscarries the result.
Related
PortfolioOptimisers.panel_column_label — Function
panel_column_label(pnl::AssetPanel, col::Tuple{Int, Int, Symbol})Return the Feature Selector entry that selects exactly one resolved column.
A label is a selector entry and not a rendered string. The labels of a Feature Matrix are therefore a Feature Selector, and a stack of the panel against them rebuilds the same matrix column for column.
Algorithm
- Read the Panel Field the column belongs to.
- An observed-mask column takes the name paired with
:observed. - A value column of a Panel Field that contributes one takes the bare name.
- Any other value column takes the name paired with its level or its label.
Arguments
pnl: The Asset Panel.col: One resolved column, fromselect_fields.
Returns
label: The Feature Selector entry naming that column.
Related
PortfolioOptimisers.panel_field_value_column! — Function
panel_field_value_column!(zc::AbstractArray, f::NumericPanelField, l::Integer, rows) -> nothing
panel_field_value_column!(zc::AbstractArray, f::CategoricalPanelField, l::Integer, rows) -> nothing
panel_field_value_column!(zc::AbstractArray, f::TensorPanelField, l::Integer, rows) -> nothingWrite one Panel Field's value column into a Feature Matrix under construction.
The method cuts the Panel Field to rows along its observation axis before it writes the column. A stack of one observation therefore reads one row of the Panel Field, and it reads a lifted static Panel Field, whose values are a RepeatedObservations, once and not once per observation. Colon() is the whole field. A static panel has no observation axis, so its only cut is Colon(). stacked_axes refuses every other value before this method runs.
Algorithm
The method that Julia selects is the algorithm. A numeric Panel Field writes its values, a categorical Panel Field writes the 0/1 indicator of one level, and a tensor Panel Field writes one label slice of its values, each cut to rows. A numeric or a categorical Panel Field is observations × assets, and the column is assets × observations, so these two write through panel_column_transpose.
Arguments
zc: The column of the Feature Matrix,assets, orassets × stacked rows.f: The Panel Field.l: The position of the level or the label, and0for a numeric Panel Field.rows: The observation rows a time-varying Asset Panel stacks, as positions or as aBoolmask, andColon()for every row. A static panel has no observation axis and refuses any other value.
Returns
nothing.zccarries the result.
Related
PortfolioOptimisers.panel_field_observed_column! — Function
panel_field_observed_column!(zc::AbstractArray, f::NumericPanelField, rows) -> nothing
panel_field_observed_column!(zc::AbstractArray, f::CategoricalPanelField, rows) -> nothing
panel_field_observed_column!(zc::AbstractArray, f::TensorPanelField, rows) -> nothingWrite one Panel Field's observed mask into a Feature Matrix under construction, as a 0/1 column.
A Panel Field contributes one mask column, whatever its kind and however many value columns it contributes. The column shows whether the cell of that Panel Field was observed for that asset. The mask of a tensor Panel Field carries a label axis of its own, so its column holds where every label of that asset was observed.
A Panel Field that carries no mask gives a column of ones, because omsk === nothing means that the Panel Field cannot blank. The method cuts a mask to rows along its observation axis before it writes it, as panel_field_value_column! cuts a value column. A column of ones is the same whatever rows holds.
Algorithm
The method that Julia selects is the algorithm.
- Write ones when the Panel Field carries no mask.
- A numeric or a categorical Panel Field writes its mask, cut to
rows, throughpanel_column_transpose. - A tensor Panel Field cuts its mask to
rows, reduces it over the label axis, its second axis, withall, and writes that.
Arguments
zc: The column of the Feature Matrix,assets, orassets × stacked rows.f: The Panel Field.rows: The observation rows a time-varying Asset Panel stacks, as positions or as aBoolmask, andColon()for every row. A static panel has no observation axis and refuses any other value.
Returns
nothing.zccarries the result.
Related
PortfolioOptimisers.panel_data_mask — Function
panel_data_mask(f::AbstractPanelField) -> Option{AbstractArray{Bool}}Return the mask of the cells of a Panel Field that hold data, or nothing when every cell holds data.
A cell holds data where the raw input carried a value, or where a fill policy wrote one. It holds no data where it holds the placeholder of a blank that no fill reached. So the mask is the negation of the placeholder mask pmsk. A reader that must not take a placeholder as data, such as FeatureDistance and the panel collapse of a meta-optimiser, reads a cell only where this mask is true.
Arguments
f: The Panel Field.
Returns
d::Option{AbstractArray{Bool}}:.!f.pmsk, the same size as the values, ornothingwhenf.pmskisnothing.
Related
PortfolioOptimisers.panel_field_column_mask — Function
panel_field_column_mask(f::NumericPanelField, l::Integer, rows = Colon()) -> Option{AbstractArray{Bool}}
panel_field_column_mask(f::CategoricalPanelField, l::Integer, rows = Colon()) -> Option{AbstractArray{Bool}}
panel_field_column_mask(f::TensorPanelField, l::Integer, rows = Colon()) -> Option{AbstractArray{Bool}}Return the mask of the cells of one value column of a Panel Field that hold data, or nothing when every cell holds data.
A cell holds data where the raw input carried a value or a fill policy wrote one. Elsewhere it holds the placeholder of a blank that no fill reached, and a reader must not take that placeholder as data. The mask is panel_data_mask, the negation of the placeholder mask. A numeric Panel Field has one value column, and a categorical Panel Field holds a placeholder or not for the whole cell, never for one level, so both give their whole mask. A tensor Panel Field gives the mask of the label that the column reads. The method cuts the mask to rows along its observation axis, as panel_field_value_column! cuts a value column. The mask takes the shape of the panel axes, as the active mask does, so a reader tests the two cell by cell.
Algorithm
The method that Julia selects is the algorithm.
- A Panel Field that holds no placeholder gives
nothing. - A numeric or a categorical Panel Field gives its mask, cut to
rows. - A tensor Panel Field gives the slice of its mask at label
l, cut torows, in the shape of the panel axes throughpanel_column_transpose.
Arguments
f: The Panel Field.l: The position of the level or the label, and0for a numeric Panel Field.rows: The observation rows a time-varying Asset Panel stacks, as positions or as aBoolmask, andColon()for every row. A static panel has no observation axis and refuses any other value.
Returns
m::Option{AbstractArray{Bool}}: The mask,assetsorobservations × assets, ornothing.
Related
PortfolioOptimisers.feature_data_cells — Function
feature_data_cells(pnl::AssetPanel, cols::AbstractVector{Tuple{Int, Int, Symbol}}) -> Option{AbstractArray{Bool}}Mark the cells of an Asset Panel at which every resolved value column holds data.
A cell is one asset of a static panel, or one observation and one asset of a time-varying one. It is true where each value column of cols holds data, observed or filled, and false where one of them holds the placeholder of a blank that no fill reached. An observed-mask column holds data in every cell, so it adds nothing. The answer is nothing when no value column of cols holds a placeholder. A FeatureDistance reads an asset at a cell only where this mask and the active mask are both true.
Algorithm
Take the conjunction of the masks that panel_field_column_mask gives for the value columns of cols, and skip each nothing.
Arguments
pnl: The Asset Panel.cols: The resolved columns, fromselect_fields.
Returns
d::Option{AbstractArray{Bool}}: The mask, with the shape of the panel's axes, ornothing.
Related
PortfolioOptimisers.feature_stack — Function
feature_stack(pnl::AssetPanel, cols::AbstractVector{Tuple{Int, Int, Symbol}}; rows = Colon(),
placeholder::Option{<:Real} = NaN) -> ArrayStack the resolved columns cols of an Asset Panel into a Feature Matrix. It is steps 2 to 5 of feature_matrix, which states them, for a caller that resolved the Feature Selector already. FeatureDistance resolves it once and reads the same columns for its mask of the cells that hold data.
Arguments
pnl: The Asset Panel.cols: The resolved columns, fromselect_fields.rows: The observation rows a time-varying Asset Panel stacks, as positions or as aBoolmask, andColon()for every row. A static panel has no observation axis and refuses any other value.placeholder: The value that the Feature Matrix holds at a value column's cell that holds the placeholder of a blank that no fill reached, ornothingto keep the stored placeholder. A cell that a fill policy wrote holds data, and the Feature Matrix keeps its value. The defaultNaNshows where no data exists, so no reader takes the placeholder as data.
Returns
Z::Array: The Feature Matrix.
Related
PortfolioOptimisers.feature_stack_eltype — Function
feature_stack_eltype(pnl::AssetPanel, cols::AbstractVector{Tuple{Int, Int, Symbol}}, placeholder::Option{<:Real}) -> TypeDerive the element type of the Feature Matrix that feature_stack stacks from the resolved columns cols. It is steps 2 and 3 of feature_matrix, which states the rule.
Algorithm
- Promote over the Panel Fields whose value columns
colsholds. An observed-mask column and an indicator contribute nothing, seepanel_value_eltype. - With nothing to promote, take the promotion over every Panel Field of the panel.
- When a value column reads a Panel Field that holds a placeholder, widen the type to hold
placeholderthroughpanel_read_eltype.
Arguments
pnl: The Asset Panel.cols: The resolved columns, fromselect_fields.placeholder: The value that the Feature Matrix holds at a value column's cell that holds the placeholder of a blank that no fill reached, ornothingto keep the stored placeholder. A cell that a fill policy wrote holds data, and the Feature Matrix keeps its value. The defaultNaNshows where no data exists, so no reader takes the placeholder as data.
Returns
T::Type: The element type of the Feature Matrix.
Related
PortfolioOptimisers.stacked_axes — Function
stacked_axes(ax::Tuple, rows) -> TupleCut the observation axis of an Asset Panel's axes to the rows a Feature Matrix stacks.
A time-varying panel has the axes (observations, assets). Its Feature Matrix stacks the observation rows that rows names, so the matrix has one row for each of them. rows names a row by its position or by a true in a Bool mask, because both are the indices that the column writers cut with. Colon() is every row, and gives the axes unchanged, on a static panel too. A static panel has the axes (assets,) alone. It has no observation axis to cut, so it refuses any other rows. Without that check, rows would cut the asset axis.
Algorithm
The method that Julia selects is the algorithm.
Colon(): giveaxunchanged.- A vector: check that
axcarries an observation axis and thatrowsindexes it. Count the rows it names, which is its length for positions and its count oftruefor a mask, and give(count, ax[2]).
Arguments
ax: The panel's axes, aspanel_axesreads them.rows: The observation rows a time-varying Asset Panel stacks, as positions or as aBoolmask, andColon()for every row. A static panel has no observation axis and refuses any other value.
Validation
length(ax) == 2whenrowsis notColon(). Raises anArgumentError.- Every position in
rowslies in1:ax[1], and aBoolmask has lengthax[1]. Raises anArgumentError.
Returns
ax::Tuple:(assets,)for a static panel, and(rows named, assets)for a time-varying one.
Related
PortfolioOptimisers.select_fields — Function
select_fields(pnl::AssetPanel, sel, strict::Bool) -> Vector{Tuple{Int, Int, Symbol}}Resolve a Feature Selector against an AssetPanel, and return the columns it names.
feature_matrix and feature_labels both call this one resolution, so the matrix and its labels always name the same columns. It is unexported, because a caller reads the labels and not the positions.
A resolved column is the triple (k, l, part). k is the Panel Field's position in the panel. part is :vals or :observed. l is the position of the level or the label within the Panel Field, and 0 where the Panel Field contributes one column of that part: a numeric Panel Field's value column, and every Panel Field's observed-mask column.
The order of sel is the column order, so a caller decides it. A nothing selector takes the panel's own order, and stacks each Panel Field's values without its mask.
Algorithm
- Check that the panel holds a Panel Field. A panel with none carries no feature data. The check refuses it here, where the cause is still known, and not later, where only the empty matrix shows.
- Check
selwithassert_feature_selector. selisnothing: push every Panel Field's value columns in panel order, and return.- Otherwise resolve each entry with
select_fields_push!, in the orderselwrites them. - Check that no two entries resolved to one column.
- Check that the selection is not empty, which happens when every entry resolved against nothing and was dropped.
Arguments
pnl: The Asset Panel.- Feature Selector that names the Panel Fields that the Feature Matrix stacks, or
nothingto stack the values of every field. An entry is a field name, a field paired with the levels or labels that it keeps, a field paired with one level or label, a tensor field paired with aLabelGroup, or a field paired with:observed. The order of the vector is the order of the columns. - Whether a
selentry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. Whenstrictisfalse, the entry warns, and the estimator drops it.
Validation
!isnothing(pnl.pf). Raises anIsNothingErrornaming the panel, the Feature Matrix andasset_panel.selis well formed. Seeassert_feature_selector.- No two entries resolve to one column. Raises an
ArgumentError. - The selection is not empty. Raises an
IsEmptyError.
Returns
cols::Vector{Tuple{Int, Int, Symbol}}: One triple per column, in column order.
Related
PortfolioOptimisers.select_fields_push! — Function
select_fields_push!(cols::AbstractVector{Tuple{Int, Int, Symbol}}, pnl::AssetPanel, entry, pool, strict::Bool) -> nothingResolve one Feature Selector entry against an AssetPanel's Panel Fields.
Algorithm
- Read the Panel Field name off the entry: a paired entry names it first, and a bare entry is the name.
- Find the Panel Field. Hand
panel_selector_msgtostrict_diagnosticand return when the panel holds none. - A bare name expands to the Panel Field's value columns, through
panel_value_columns!. - A name paired with a
Symbolclaims the Panel Field's one observed-mask column. - A name paired with one key claims that key's column, through
panel_key_column!. - A name paired with a
LabelGroupclaims the column of every label in that group, throughpanel_group_columns!. - A name paired with a vector of keys claims one column per key, in the order the vector writes them.
Arguments
cols: The resolved columns so far, pushed onto in place.pnl: The Asset Panel.entry: One entry of the Feature Selector.pool: The panel's Panel Field names, the suggestion pool of the first namespace.- Whether a
selentry throws when it names a field, a level, a label or a group that the Asset Panel does not hold. Whenstrictisfalse, the entry warns, and the estimator drops it.
Returns
nothing.colscarries the result.
Related
PortfolioOptimisers.panel_selector_msg — Function
panel_selector_msg(name, pool::VecStr) -> String
panel_selector_msg(f::NumericPanelField, key, keys::VecStr) -> String
panel_selector_msg(f::AbstractPanelField, key, keys::VecStr) -> StringBuild the diagnostic for a Feature Selector entry that resolves against nothing.
The messages name the two namespaces an entry resolves in. The first is the Panel Field names of the panel, and the second is the levels or the labels of one Panel Field. Each method hands its own suggestion pool to did_you_mean, so the suggestion for a misspelling comes from the names the entry could have meant and not from every column of the panel. A numeric Panel Field has no second namespace. For a key paired with it, the message names the two entry forms that the field takes, and it offers no suggestion.
Algorithm
- Name the entry that resolved against nothing, and the namespace it was resolved in.
- Append the nearest match from the pool with
did_you_mean, where there is a pool.
Arguments
name: The Panel Field name that resolved against nothing.pool: The Panel Field names of the panel. SeeVecStr.f: The Panel Field whose key resolved against nothing.key: The level or label that resolved against nothing.keys: The Panel Field's levels or labels. SeeVecStr.
Returns
msg::String: The diagnostic.
Related
PortfolioOptimisers.assert_feature_selector — Function
assert_feature_selector(sel::Nothing) -> nothing
assert_feature_selector(sel::AbstractVector) -> nothingCheck that a Feature Selector is a non-empty vector of distinct entries, each in one of the five admitted forms.
The check refuses an empty sel and does not read it as every Panel Field. nothing already says that, and a selection that widens to the whole panel without a message is the failure this selector exists to prevent. The check refuses a repeated entry because it doubles the contribution of its column to every distance.
Algorithm
The method that Julia selects decides whether there is anything to check.
selisnothing: it stacks every Panel Field's values, so there is nothing to check.selis a vector: check that it is non-empty, that it repeats no entry, and that each entry takes an admitted form, withassert_selector_entry.
Arguments
- Feature Selector that names the Panel Fields that the Feature Matrix stacks, or
nothingto stack the values of every field. An entry is a field name, a field paired with the levels or labels that it keeps, a field paired with one level or label, a tensor field paired with aLabelGroup, or a field paired with:observed. The order of the vector is the order of the columns.
Validation
!isempty(sel). Raises anIsEmptyError.allunique(sel). Raises anArgumentError.- Each entry takes an admitted form. See
assert_selector_entry.
Returns
nothing.
Related
PortfolioOptimisers.assert_selector_entry — Function
assert_selector_entry(entry) -> nothingCheck that one Feature Selector entry takes one of the five forms the grammar admits.
The five forms are a Panel Field name, a name paired with the levels or labels it keeps, a name paired with one level or label, a name paired with a LabelGroup, and a name paired with :observed. No entry is a column position. Every field, level and label of an Asset Panel carries a name, so an integer has nothing to index.
The check refuses an empty name, and a paired vector that is empty, holds an empty key or repeats a key. Each of those resolves to no column or to a doubled column, and the selector exists to prevent both.
Algorithm
- A string: check that it is not empty.
- A pair whose first element is a non-empty string: check its second element with
selector_value_ok. - Refuse anything else.
Arguments
entry: One entry of a Feature Selector.
Validation
entrytakes one of the five forms. Raises anArgumentError.
Returns
nothing.
Related
PortfolioOptimisers.selector_value_ok — Function
selector_value_ok(v) -> BoolCheck the right side of a paired Feature Selector entry, whose left side names a Panel Field.
Algorithm
The method that Julia selects is the algorithm.
- A
Symbolis admitted when it is:observed. - A string, one level or label, is admitted when it is not empty.
- A
LabelGroupis admitted when its group is a non-empty string. The check reads the field, because a call of the generated positional constructor skips the check of the typed one. - A vector of strings is admitted when it is not empty, holds no empty key and repeats none.
- Anything else is refused.
Arguments
v: The right side of the pair.
Returns
ok::Bool: Whether the right side takes an admitted form.
Related