Initial and parameter field files¶
The inifield file contains the initial conditions and spatial parameter input fields for a D-Flow FM model.
Generic parsing and serializing functionality comes from the generic hydrolib.core.dflowfm.ini modules.
The inifield file is represented by the classes below.
Model¶
AbstractSpatialField (INIBasedModel, ABC)
pydantic-model
¶
Abstract base class for [Initial]
and [Parameter]
block data in
inifield files.
Defines all common fields. Used via subclasses InitialField and ParameterField.
validate_that_value_is_present_for_polygons(values: Dict) -> Dict
classmethod
¶
Validates that the value is provided when dealing with polygons.
Source code in hydrolib/core/dflowfm/inifield/models.py
@root_validator(allow_reuse=True)
def validate_that_value_is_present_for_polygons(cls, values: Dict) -> Dict:
"""Validates that the value is provided when dealing with polygons."""
return validate_required_fields(
values,
"value",
conditional_field_name="datafiletype",
conditional_value=DataFileType.polygon,
)
AveragingType (str, Enum)
¶
Enum class containing the valid values for the averagingType attribute in several subclasses of AbstractIniField.
DataFileType (str, Enum)
¶
Enum class containing the valid values for the dataFileType attribute in several subclasses of AbstractIniField.
IniFieldGeneral (INIGeneral)
pydantic-model
¶
The initial field file's [General]
section with file meta data.
IniFieldModel (INIModel)
pydantic-model
¶
The overall inifield model that contains the contents of one initial field and parameter file.
This model is typically referenced under a FMModel.geometry.inifieldfile[..]
.
Attributes:
Name | Type | Description |
---|---|---|
general |
IniFieldGeneral |
|
initial |
List[InitialField] |
List of |
parameter |
List[ParameterField] |
List of |
InitialField (AbstractSpatialField)
pydantic-model
¶
Initial condition field definition, represents an [Initial]
block in
an inifield file.
Typically inside the definition list of a FMModel.geometry.inifieldfile.initial[..]
InterpolationMethod (str, Enum)
¶
Enum class containing the valid values for the interpolationMethod attribute in several subclasses of AbstractIniField.
ParameterField (AbstractSpatialField)
pydantic-model
¶
Parameter field definition, represents a [Parameter]
block in
an inifield file.
Typically inside the definition list of a FMModel.geometry.inifieldfile.parameter[..]