base_config

Base config class(es).

class graphnet.utilities.config.base_config.BaseConfig[source]

Bases: BaseModel

Base class for Configs.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod load(path)[source]

Load BaseConfig from path.

Return type:

BaseConfig

Parameters:

path (str)

dump(path)[source]

Save BaseConfig to path as YAML file, or return as string.

Return type:

Optional[str]

Parameters:

path (str | None)

as_dict()[source]

Represent BaseConfig as a dict.

This builds on BaseModel.dict() but can be overwritten.

Return type:

Dict[str, Dict[str, Any]]

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

graphnet.utilities.config.base_config.get_all_argument_values(fn, *args, **kwargs)[source]

Return dict of all argument values to fn, including defaults.

Return type:

Dict[str, Any]

Parameters:
  • fn (Callable)

  • args (Any)

  • kwargs (Any)