- class paguro.Config(contextlib.ContextDecorator)
Configuration.
Notes¶
Can also be used as a context manager OR a function decorator in order to temporarily scope the lifetime of specific options.
Constructors¶
-
Config(*, restore_defaults: bool =
False, ...) Initialise a Config object instance for context manager usage.
Display¶
- classmethod set_dataset_ashi_repr(active) type[Config]
Ashi representation of the dataset.
Representation¶
- classmethod set_width_chars(width_chars: int | None) type[Config]
Width.
- classmethod set_styled(styled) type[Config]
Styled.
Validation¶
- classmethod set_auto_validation_mode(mode) type[Config]
Validation mode.
- classmethod set_auto_validation_limit(limit) type[Config]
Limit the number of rows when collecting validation errors in auto mode.
Settings¶
- classmethod load(cfg: str) Config
Load (and set) previously saved Config options from a JSON string.
- classmethod load_from_file(file: Path | str) Config
Load (and set) previously saved Config options from file.
- classmethod restore_defaults() type[Config]
Reset all polars Config settings to their default state.
- classmethod save_to_file(file: Path | str) None
Save the current set of Config options as a JSON file.
-
classmethod state(if_set: bool =
False) dict[str, str | None] Show the current state of all Config variables in the environment as a dict.
Special methods¶
-
Config(*, restore_defaults: bool =