Configurations

apetype configs module defines the core class ConfigBase that is also used as the starting point for Tasks and ReportTasks, and wrapped in Pipelines.

Settings are defined as typed attributes on an inheriting ConfigBase class

Example:

>>> import apetype as at
... class DepSettings(at.ConfigBase):
...     b: int
...     b_b: float
...     b_c: int = 4
...     
... class Settings(at.ConfigBase):
...     depconfig: DepSettings
...     a: int
...     a_b: float
...     a_c: int = 4
... 
... settings = Settings(parse=[1,1,1,1])
... print(settings.depconfig_b, settings.a, settings.depconfig.b)
1 1 1
class apetype.configs.ConfigBase(parse=True, prefix=True)

Takes in a list of settings, which will be exposed as CLI arguments. Each settings tuple should have the following format: (‘–name’, keyword dict for the parser.add_argument function)

The recommended way to build a ConfigBase object, is to inherit from it and define the _setup method (see SettingsBase._setup docstring)

Args:
parse (bool|list|dict): if True, already parse arguments.
Can also be a list that will then be passed on as args, all list items are converted to strings.
prefix (bool): Whether or not to add the attribute name as prefix
to dependency settings. Prefix setting is propagated to downstream dependencies.