Case¶
- class farn.core.case.Case(case: str = '', layer: str = '', level: int = 0, no_of_samples: int = 0, index: int = 0, path: Path | None = None, *, is_leaf: bool = False, condition: MutableMapping[str, str] | None = None, parameters: MutableSequence[Parameter] | None = None, command_sets: MutableMapping[str, list[str]] | None = None)¶
Bases:
object
Dataclass holding case attributes.
- Case holds all relevant attributes needed by farn to process cases, e.g.
condition
parameter names and associated values
commands
- __init__(case: str = '', layer: str = '', level: int = 0, no_of_samples: int = 0, index: int = 0, path: Path | None = None, *, is_leaf: bool = False, condition: MutableMapping[str, str] | None = None, parameters: MutableSequence[Parameter] | None = None, command_sets: MutableMapping[str, list[str]] | None = None) None ¶
Methods
__init__
([case, layer, level, ...])add_parameters
([parameters])Manually add extra parameters.
to_dict
()Return a dict with all case attributes.
Attributes
Evaluates whether the case matches the configured filter expression.
- add_parameters(parameters: MutableSequence[Parameter] | MutableMapping[str, str] | None = None) None ¶
Manually add extra parameters.
- to_dict() dict[str, Any] ¶
Return a dict with all case attributes.
- Returns:
dict with all case attributes
- Return type:
Dict[str, Any]
- property is_valid: bool¶
Evaluates whether the case matches the configured filter expression.
A case is considered valid if it fulfils the filter citeria configured in farnDict for the respective layer.
- Returns:
result of validity check. True indicates the case is valid, False not valid.
- Return type:
bool