phlower.settings.PhlowerSetting

class phlower.settings.PhlowerSetting(*, training=None, model=None, scaling=None, prediction=None)[source]

Bases: BaseModel

Methods

read_yaml(file_path[, decrypt_key])

Read yaml file and parse to PhlowerSetting object.

Attributes

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config

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

model_extra

Get extra fields set during validation.

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

training

training setting.

model

model setting.

scaling

scaling setting.

prediction

prediction setting.

Parameters:
model: PhlowerModelSetting | None

model setting. Defaults to None.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}

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

model_fields: ClassVar[Dict[str, FieldInfo]] = {'model': FieldInfo(annotation=Union[PhlowerModelSetting, NoneType], required=False, default=None), 'prediction': FieldInfo(annotation=Union[PhlowerPredictorSetting, NoneType], required=False, default=None), 'scaling': FieldInfo(annotation=Union[PhlowerScalingSetting, NoneType], required=False, default=None), 'training': FieldInfo(annotation=Union[PhlowerTrainerSetting, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

prediction: PhlowerPredictorSetting | None

prediction setting. Defaults to None.

classmethod read_yaml(file_path, decrypt_key=None)[source]

Read yaml file and parse to PhlowerSetting object.

Parameters:
  • file_path (pathlib.Path | str | PhlowerYamlFile) – path to yaml file

  • decrypt_key (bytes | None, optional) – key to decrypt file. Defaults to None.

Returns:

PhlowerSetting object

Return type:

Self

scaling: PhlowerScalingSetting | None

scaling setting. Defaults to None.

training: PhlowerTrainerSetting | None

training setting. Defaults to None.