phlower.settings.PhlowerModelSetting¶
- class phlower.settings.PhlowerModelSetting(*, variable_dimensions=None, inputs, labels=None, fields=None, network)[source]¶
Bases:
BaseModel
Methods
check_duplicate_names
()get_name_to_dimensions
()resolve
()Resolve network relationship.
Attributes
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
model_extra
Get extra fields set during validation.
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.
dictionary which maps variable name to value
settings for input feature values
settings for output feature value
name of variables in simulation field which are treated as constant
define structure of neural network
- Parameters:
variable_dimensions (dict[str, Annotated[PhysicalDimensions, PlainValidator(func=~phlower._base._dimension._validate, json_schema_input_type=~typing.Any), PlainSerializer(func=~phlower._base._dimension._serialize, return_type=PydanticUndefined, when_used=always)]])
inputs (list[ModelIOSetting])
labels (list[ModelIOSetting])
fields (list[ModelIOSetting])
network (GroupModuleSetting)
- fields: list[ModelIOSetting]¶
- name of variables in simulation field which are treated as constant
in calculation.
For example, support matrix for input graph structure.
- inputs: list[ModelIOSetting]¶
settings for input feature values
- labels: list[ModelIOSetting]¶
settings for output feature value
- 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]] = {'fields': FieldInfo(annotation=list[ModelIOSetting], required=False, default_factory=list, frozen=True), 'inputs': FieldInfo(annotation=list[ModelIOSetting], required=True), 'labels': FieldInfo(annotation=list[ModelIOSetting], required=False, default_factory=list, frozen=True), 'network': FieldInfo(annotation=GroupModuleSetting, required=True), 'variable_dimensions': FieldInfo(annotation=dict[str, Annotated[PhysicalDimensions, PlainValidator, PlainSerializer]], required=False, default_factory=<lambda>, validate_default=True)}¶
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.
- network: GroupModuleSetting¶
define structure of neural network
- resolve()[source]¶
Resolve network relationship. Following items are checked.
network is a valid DAG, not cycled graph.
input keywards in a module is defined as output in the precedent module.
set positive integer value to the value which is defined as -1 in nodes.
- Return type:
None
- variable_dimensions: dict[str, PhysicalDimensionsClass]¶
dictionary which maps variable name to value