gloria.Gloria.from_toml#
- static Gloria.from_toml(toml_path, ignore={}, **kwargs)[source]#
Instantiate and configure a Gloria object from a TOML configuration file.
The TOML file is expected to have the following top-level tables / arrays-of-tables (all are optional except
[model]
):[model]
- keyword arguments passed directly to theGloria
constructor.[[external_regressors]]
- one table per regressor; each is forwarded toadd_external_regressor()
.[[seasonalities]]
- one table per seasonality; each is forwarded toadd_seasonality()
.[[events]]
- one table per event; each is forwarded toadd_event()
.[[protocols]]
- one table per protocol. Each table must contain atype
key that maps to a protocol class name; the remaining keys are passed to that class before callingadd_protocol()
.
Defaults as defined in
Gloria
constructor or respective methods are used for all keys not provided in the TOML file.kwargs
can be used to overwrite keys found in the[model]
table.- Parameters:
toml_path (Union[str, Path]) – Path to the TOML file containing the model specification.
ignore (Union[Collection[str],str], optional) – Which top-level sections of the file to skip. Valid values are
"external_regressors"
,"seasonalities"
,"events"
, and"protocols"
. The special value"all"
suppresses every optional section. May be given as a single string or any iterable of strings.**kwargs (dict[str, Any]) – Keyword arguments that override or extend the
[model]
table. Only keys that are valid fields of Gloria (i.e. that appear in Gloria.model_fields) are retained; others are silently dropped.
- Returns:
A fully initialized Gloria instance.
- Return type:
See also
model_from_toml()
An alias
Notes
Precedence order for
Gloria
constructor arguments from highest to lowest is:Values supplied via
kwargs
Values found in the TOML
[model]
tableGloria’s own defaults