class documentation
class LuxonisConfig(BaseModelExtraForbid):
Class for storing configuration.
| Class Method | get |
Load config from a yaml file or a dictionary. |
| Method | __repr__ |
Undocumented |
| Method | __str__ |
Undocumented |
| Method | get |
Return a value from the config based on the given key. |
| Method | get |
Return the JSON schema of the config. |
| Method | save |
Save the config to a YAML file. |
| Static Method | _merge |
Merge the config dictionary with the CLI overrides. |
Inherited from BaseModelExtraForbid:
| Instance Variable | model |
Pydantic model configuration with extra set to "forbid". |
@classmethod
def get_config(cls, cfg: PathType | Params | None = None, overrides: Params | dict[ str, Any] | list[ str] | tuple[ str, ...] | None = None) -> Self:
¶
Load config from a yaml file or a dictionary.
| Parameters | |
cfg:PathType | Params | None | Path to a config file or a dictionary. |
overrides:Params | dict[ | CLI overrides. Can be a dictionary mapping "dotted" keys to unparsed string or Python values, or a list or a tuple of alternating key-value pairs. |
| Returns | |
Self | Instance of the config class. |
| Raises | |
ValueError | If neither cfg nor overrides is provided, or if overrides is a list or a tuple with an odd number of items. |
Return a value from the config based on the given key.
If the key doesn't exist, the default value is returned.
| Parameters | |
keystr | Key as a string with levels separated by dots. |
default:Any | Default value to return if the key doesn't exist. |
| Returns | |
Any | Value of the key, or the default value. |
| Raises | |
ValueError | If a list is accessed with a non-integer key. |
@deprecated( 'Use `model_json_schema(mode=\'validation\')` instead.')
def get_json_schema(self) -> Params:
¶
Return the JSON schema of the config.
Deprecated since version 0.9.0: Use model_json_schema(mode='validation') instead.
| Returns | |
Params | Dictionary with the JSON schema. |
Save the config to a YAML file.
| Parameters | |
path:PathType | Path to the file where the config should be saved. |