paidiverpy.config#
__init__.py for config module.
Submodules#
Classes#
Configuration class. |
Package Contents#
- class paidiverpy.config.Configuration(config_file_path: str | None = None, add_general: dict[str, Any] | None = None, add_steps: list[dict[str, Any]] | None = None)[source]#
Configuration class.
- Parameters:
- static validate_config(config: dict[str, Any] | str | pathlib.Path, local: bool = True) None[source]#
Validate the configuration.
- add_general(config: dict[str, Any], validate: bool = False) None[source]#
Add a configuration.
- Parameters:
- Raises:
ValueError – Invalid configuration name.
- add_step(config_index: int | None = None, parameters: dict[str, Any] | None = None, insert: bool = False, validate: bool = False, step_class: type[paidiverpy.colour_layer.ColourLayer] | type[paidiverpy.convert_layer.ConvertLayer] | type[paidiverpy.position_layer.PositionLayer] | type[paidiverpy.sampling_layer.SamplingLayer] | type[paidiverpy.custom_layer.CustomLayer] | type[paidiverpy.investigation_layer.InvestigationLayer] | None = None) int[source]#
Add a step to the configuration.
- Parameters:
config_index (int, optional) – The configuration index. Defaults to None.
parameters (dict, optional) – The parameters for the step. Defaults to None.
insert (bool, optional) – Whether to insert the step at the given index. Defaults to False.
validate (bool, optional) – Whether to validate the configuration. Defaults to True.
step_class (BaseModel, optional) – The class of the step. Defaults to None.
- Raises:
ValueError – Invalid step index.
- Returns:
The step index.
- Return type:
- remove_step(config_index: int | None = None) int[source]#
Remove a step from the configuration.
- Parameters:
config_index (int, optional) – The configuration index. Defaults to None, which means the last step will be removed.
- Raises:
ValueError – Invalid step index.
- Returns:
The step index.
- Return type:
- export(output_path: pathlib.Path | str | None) None | str[source]#
Export the configuration to a file.
- get_output_path(output_path: str | pathlib.Path | None = None) tuple[pathlib.Path | str, bool][source]#
Get the output path.