Skip to content

Storage node .ini files

The storage node module provides the specific logic for accessing storage node files for a D-Flow FM model.

Generic parsing and serializing functionality comes from the generic hydrolib.core.dflowfm.ini modules.

A storage node .ini file is described by the classes below.

Model

Interpolation (str, Enum)

Enum class containing the valid values for the interpolation type as used for a storage area table in StorageNode.

NodeType (str, Enum)

Enum class containing the valid values for the node type as used in StorageNode.

StorageNode (INIBasedModel) pydantic-model

A storage node that is included in the storage node file.

All lowercased attributes match with the storage node input as described in UM Sec.C.17.

check_list_length_levels(values) classmethod

Validates that the length of the levels field is as expected.

Source code in hydrolib/core/dflowfm/storagenode/models.py
@root_validator(allow_reuse=True)
def check_list_length_levels(cls, values):
    """Validates that the length of the levels field is as expected."""
    return validate_correct_length(
        values,
        "levels",
        "storagearea",
        length_name="numlevels",
        list_required_with_length=True,
    )

validate_that_required_fields_are_present_when_not_using_tables(values: Dict) -> Dict classmethod

Validates that the specified fields are present.

Source code in hydrolib/core/dflowfm/storagenode/models.py
@root_validator(allow_reuse=True)
def validate_that_required_fields_are_present_when_not_using_tables(
    cls, values: Dict
) -> Dict:
    """Validates that the specified fields are present."""
    return validate_required_fields(
        values,
        "bedlevel",
        "area",
        "streetlevel",
        conditional_field_name="usetable",
        conditional_value=False,
    )

validate_that_required_fields_are_present_when_using_tables(values: Dict) -> Dict classmethod

Validates that the specified fields are present when the usetable field is also present.

Source code in hydrolib/core/dflowfm/storagenode/models.py
@root_validator(allow_reuse=True)
def validate_that_required_fields_are_present_when_using_tables(
    cls, values: Dict
) -> Dict:
    """Validates that the specified fields are present when the usetable field is also present."""
    return validate_required_fields(
        values,
        "numlevels",
        "levels",
        "storagearea",
        conditional_field_name="usetable",
        conditional_value=True,
    )

StorageNodeGeneral (INIGeneral) pydantic-model

The storage node file's [General] section with file meta data.

StorageNodeModel (INIModel) pydantic-model

The overall storage node model that contains the contents of one storage node file.

This model is typically referenced under a FMModel.geometry.storagenodefile[..].

Attributes:

Name Type Description
general StorageNodeGeneral

[General] block with file metadata.

storagenode List[StorageNode]

List of [StorageNode] blocks for all storage nodes.

StorageType (str, Enum)

Enum class containing the valid values for the storage type as used in StorageNode.

Back to top