Shortcuts

Settings

class catalyst.settings.Settings(cv_required: bool = False, albumentations_required: Optional[bool] = None, kornia_required: Optional[bool] = None, segmentation_models_required: Optional[bool] = None, use_libjpeg_turbo: bool = False, log_required: bool = False, alchemy_required: Optional[bool] = None, neptune_required: Optional[bool] = None, wandb_required: Optional[bool] = None, plotly_required: Optional[bool] = None, ml_required: bool = False, ipython_required: Optional[bool] = None, matplotlib_required: Optional[bool] = None, scipy_required: Optional[bool] = None, pandas_required: Optional[bool] = None, sklearn_required: Optional[bool] = None, git_required: Optional[bool] = None, nlp_required: bool = False, transformers_required: Optional[bool] = None, tune_required: bool = False, optuna_required: Optional[bool] = None, nmslib_required: Optional[bool] = False, use_lz4: bool = False, use_pyarrow: bool = False, telegram_logger_token: Optional[str] = None, telegram_logger_chat_id: Optional[str] = None, hydra_required: Optional[bool] = False)[source]

Bases: catalyst.tools.frozen_class.FrozenClass

Catalyst settings.

static parse() → catalyst.settings.Settings[source]

Parse and return the settings.

Returns

Dictionary of the parsed and merged Settings.

Return type

Settings

type_hint(key: str)[source]

Returns type hint for the specified key.

Parameters

key – key of interest

Returns

type hint for the specified key

class catalyst.settings.ConfigFileFinder(program_name: str)[source]

Bases: object

Encapsulate the logic for finding and reading config files.

Adapted from:

__init__(program_name: str) → None[source]

Initialize object to find config files.

Parameters

program_name – Name of the current program (e.g., catalyst).

generate_possible_local_files()[source]

Find and generate all local config files.

Yields

str – Path to config file.

local_config_files() → List[str][source]

Find all local config files which actually exist.

Returns

List of files that exist that are local project config files with extra config files appended to that list (which also exist).

Return type

List[str]

local_configs()[source]

Parse all local config files into one config object.

user_config()[source]

Parse the user config file into a config object.

class catalyst.settings.MergedConfigParser(config_finder: catalyst.settings.ConfigFileFinder)[source]

Bases: object

Encapsulate merging different types of configuration files.

This parses out the options registered that were specified in the configuration files, handles extra configuration files, and returns dictionaries with the parsed values.

Adapted from:

GETBOOL_ACTIONS = {'store_false', 'store_true'}

Set of actions that should use the getbool() method.

__init__(config_finder: catalyst.settings.ConfigFileFinder)[source]

Initialize the MergedConfigParser instance.

Parameters

config_finder – Initialized ConfigFileFinder.

parse() → dict[source]

Parse and return the local and user config files.

First this copies over the parsed local configuration and then iterates over the options in the user configuration and sets them if they were not set by the local configuration file.

Returns

Dictionary of the parsed and merged configuration options.

Return type

dict