ParamsManagerSectionAbstract#

class ParamsManagerSectionAbstract(params=None, **kwargs)#

Bases: ParamsManagerAbstract[T_Section]

Parameters are stored in a Section object.

Set and reset methods rely on Section.update() to merge the new parameters values to params.

Parameters:

params (t.Any | None)

RAISE_ON_MISS: bool = True#

Passed to Section.update, If True (default), raise if unkown parameter is passed when using set_params.

_reset_params()#

Reset parameters to their initial state (empty dict).

Not Implemented:

Implement in a subclass of this module.

Return type:

None

reset_params(params=None, **kwargs)#

Reset parameters values.

Parameters:
  • params (Section | Mapping[str, Any] | None) – Section to use as parameters. If PARAMS_PATH is not None, it will be used to obtain a sub-section to use. If None, the default section class (SECTION) will be used (with PARAMS_DEFAULTS added). Traits that do not already exist in the params section will be added.

  • kwargs – Other parameters values in the form name=value. The value can be a TraitType instance in which case it will be added to the parameters section with its default value.

set_params(params=None, **kwargs)#

Update one or more parameters values.

Other parameters are kept.

Parameters:
  • params (Section | Mapping[str, Any] | None) – Section to add values to current parameters. Same as for set_params().

  • kwargs – Other parameters values in the form name=value. The value can be a TraitType instance in which case it will be added to the parameters section with its default value.