geolib.models.dgeoflow.internal

The internal data model structure.

Classes

BoundaryConditionCollection(**data)

boundaryconditions/boundaryconditions_x.json

CalculationType

alias of CalculationTypeEnum

CalculationTypeEnum(value[, names, module, ...])

CriticalHeadResult(**data)

param data:

DGeoFlowBaseModelStructure(**data)

param data:

DGeoFlowStructure(**data)

Highest level DGeoFlow class that should be parsed to and serialized from.

DGeoFlowSubStructure(**data)

param data:

ElementResult(**data)

param data:

ErosionDirectionEnum(value[, names, module, ...])

ForeignKeys(**data)

A dataclass that store the connections between the various unique Ids used in DGeoFlow.

Geometry(**data)

geometries/geometry_x.json

GroundwaterFlowResult(**data)

param data:

MeshProperty(**data)

meshproperties/meshproperties_x.json

NodeResult(**data)

param data:

PersistableBoundaryCondition(**data)

param data:

PersistableCalculation(**data)

param data:

PersistableCriticalHeadSearchSpace(**data)

param data:

PersistableFixedHeadBoundaryConditionProperties(**data)

param data:

PersistableLayer(**data)

param data:

PersistableMeshProperties(**data)

param data:

PersistablePoint(**data)

param data:

PersistableShadingType(value[, names, ...])

PersistableSoil(**data)

param data:

PersistableSoilLayer(**data)

param data:

PersistableSoilVisualization(**data)

param data:

PersistableStage(**data)

param data:

PersistableStochasticParameter(**data)

param data:

PipeElementResult(**data)

param data:

PipeLengthResult(**data)

param data:

PipeTrajectory(**data)

param data:

ProjectInfo(**data)

projectinfo.json.

Scenario(**data)

scenarios/scenario_x.json

SoilCollection(**data)

soils.json

SoilLayerCollection(**data)

soillayers/soillayers_x.json

SoilVisualisation(**data)

param data:

class geolib.models.dgeoflow.internal.BoundaryConditionCollection(**data)

boundaryconditions/boundaryconditions_x.json

Parameters:

data (Any) –

BoundaryConditions: List[PersistableBoundaryCondition]
ContentVersion: Optional[str]
Id: Optional[str]
add_boundary_condition(id, label, notes, points, head_level)
Parameters:
  • id (int) –

  • label (str) –

  • notes (str) –

  • points (List[Point]) –

  • head_level (float) –

Return type:

PersistableBoundaryCondition

contains_point(point)

Check if the given point is on one of the points of the layers

Parameters:

point (Point) – A point type

Returns:

True if this point is found on a layer, False otherwise

Return type:

bool

Todo

Take x, z accuracy into account

classmethod structure_name()
Return type:

str

geolib.models.dgeoflow.internal.CalculationType

alias of CalculationTypeEnum

class geolib.models.dgeoflow.internal.CalculationTypeEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
CRITICAL_HEAD = 'CriticalHead'
GROUNDWATER_FLOW = 'GroundwaterFlow'
PIPE_LENGTH = 'PipeLength'
class geolib.models.dgeoflow.internal.CriticalHeadResult(**data)
Parameters:

data (Any) –

ContentVersion: Optional[str]
CriticalHead: Optional[float]
Elements: Optional[List[ElementResult]]
Id: Optional[str]
PipeElements: Optional[List[PipeElementResult]]
PipeLength: Optional[float]
class geolib.models.dgeoflow.internal.DGeoFlowBaseModelStructure(**data)
Parameters:

data (Any) –

dict(*args, **kwargs)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

class geolib.models.dgeoflow.internal.DGeoFlowStructure(**data)

Highest level DGeoFlow class that should be parsed to and serialized from.

The List[] items (one for each scenario in the model) will be stored in a subfolder to multiple json files. Where the first (0) instance has no suffix, but the second one has (1 => _1) etc.

also parses the outputs which are part of the json files

Parameters:

data (Any) –

class Config
arbitrary_types_allowed = True
validate_assignment = True
add_default_calculation(scenario_index, label, notes)

Add a new default (empty) calculation to DStability.

Parameters:
  • scenario_index (int) –

  • label (str) –

  • notes (str) –

Return type:

int

add_default_scenario(label, notes, unique_start_id=None)

Add a new default (empty) scenario to DGeoFlow.

Parameters:
  • label (str) –

  • notes (str) –

  • unique_start_id (Optional[int]) –

Return type:

Tuple[int, int]

add_default_stage(scenario_index, label, notes, unique_start_id=None)

Add a new default (empty) stage to DStability.

Parameters:
  • scenario_index (int) –

  • label (str) –

  • notes (str) –

  • unique_start_id (Optional[int]) –

Return type:

int

boundary_conditions: List[BoundaryConditionCollection]
critical_head_results: List[CriticalHeadResult]
classmethod ensure_validity_foreign_keys(values)
geometries: List[Geometry]
get_result_substructure(calculation_type)
Parameters:

calculation_type (CalculationTypeEnum) –

Return type:

List[Union[GroundwaterFlowResult, PipeLengthResult, CriticalHeadResult]]

get_unique_id()

Return unique id that can be used in DGeoFlow. Finds all existing ids, takes the max and does +1.

Return type:

int

groundwater_flow_results: List[GroundwaterFlowResult]
has_result(scenario_index)
Parameters:

scenario_index (int) –

Return type:

bool

has_scenario(scenario_id)
Parameters:

scenario_id (int) –

Return type:

bool

has_soil_layer(stage_id, soil_layer_id)
Parameters:
  • stage_id (int) –

  • soil_layer_id (int) –

Return type:

bool

has_soil_layers(scenario_id)
Parameters:

scenario_id (int) –

Return type:

bool

mesh_properties: List[MeshProperty]
pipe_length_results: List[PipeLengthResult]
projectinfo: ProjectInfo
scenarios: List[Scenario]
soillayers: List[SoilLayerCollection]
soils: SoilCollection
soilvisualizations: SoilVisualisation
validator()

Set the Validator class.

class geolib.models.dgeoflow.internal.DGeoFlowSubStructure(**data)
Parameters:

data (Any) –

classmethod structure_name()
class geolib.models.dgeoflow.internal.ElementResult(**data)
Parameters:

data (Any) –

NodeResults: Optional[List[NodeResult]]
class geolib.models.dgeoflow.internal.ErosionDirectionEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
LEFT_TO_RIGHT = ('LeftToRight',)
RIGHT_TO_LEFT = 'RightToLeft'
class geolib.models.dgeoflow.internal.ForeignKeys(**data)

A dataclass that store the connections between the various unique Ids used in DGeoFlow. These can be seen as (implicit) foreign keys.

Parameters:

data (Any) –

property class_fields: Dict[str, List[str]]

Return a mapping in the form: classname: [fields]

mapping: Dict[str, Tuple[str, ...]]
class geolib.models.dgeoflow.internal.Geometry(**data)

geometries/geometry_x.json

Parameters:

data (Any) –

ContentVersion: Optional[str]
Id: Optional[str]
Layers: List[PersistableLayer]
add_layer(id, label, notes, points)

Add a new layer to the model. Layers are expected; 1. to contain at least 3 point (non closed polygons) 2. the points need to be in clockwise order 3. the polygon needs to be convex (no intersections with itsself)

Parameters:
  • id (str) – id of the layer

  • label (str) – label of the layer

  • notes (str) – notes for the layers

  • points (List[Points]) – list of Point classes

Returns:

the layer as a persistable object

Return type:

PersistableLayer

contains_point(point)

Check if the given point is on one of the points of the layers

Parameters:

point (Point) – A point type

Returns:

True if this point is found on a layer, False otherwise

Return type:

bool

Todo

Take x, z accuracy into account

get_layer(id)
Parameters:

id (int) –

Return type:

PersistableLayer

classmethod structure_name()
Return type:

str

class geolib.models.dgeoflow.internal.GroundwaterFlowResult(**data)
Parameters:

data (Any) –

ContentVersion: Optional[str]
Elements: Optional[List[ElementResult]]
Id: Optional[str]
class geolib.models.dgeoflow.internal.MeshProperty(**data)

meshproperties/meshproperties_x.json

Parameters:

data (Any) –

ContentVersion: Optional[str]
Id: Optional[str]
MeshProperties: Optional[List[PersistableMeshProperties]]
add_meshproperty(layer_id, element_size, label)
Parameters:
  • layer_id (str) –

  • element_size (float) –

  • label (str) –

Return type:

PersistableMeshProperties

get_ids(exclude_soil_layer_id)
Parameters:

exclude_soil_layer_id (Optional[int]) –

Return type:

Set[str]

classmethod structure_name()
Return type:

str

class geolib.models.dgeoflow.internal.NodeResult(**data)
Parameters:

data (Any) –

HydraulicDischarge: float
HydraulicHead: float
Point: Optional[PersistablePoint]
TotalPorePressure: float
class geolib.models.dgeoflow.internal.PersistableBoundaryCondition(**data)
Parameters:

data (Any) –

FixedHeadBoundaryConditionProperties: PersistableFixedHeadBoundaryConditionProperties
Id: Optional[str]
Label: Optional[str]
Notes: Optional[str]
Points: ConstrainedListValue[PersistablePoint]
class geolib.models.dgeoflow.internal.PersistableCalculation(**data)
Parameters:

data (Any) –

CalculationType: Optional[CalculationTypeEnum]
CriticalHeadId: Optional[str]
CriticalHeadSearchSpace: Optional[PersistableCriticalHeadSearchSpace]
Label: Optional[str]
MeshPropertiesId: Optional[str]
Notes: Optional[str]
PipeTrajectory: Optional[PipeTrajectory]
ResultsId: Optional[str]
class geolib.models.dgeoflow.internal.PersistableCriticalHeadSearchSpace(**data)
Parameters:

data (Any) –

MaximumHeadLevel: Optional[float]
MinimumHeadLevel: Optional[float]
StepSize: Optional[float]
class geolib.models.dgeoflow.internal.PersistableFixedHeadBoundaryConditionProperties(**data)
Parameters:

data (Any) –

HeadLevel: float
class geolib.models.dgeoflow.internal.PersistableLayer(**data)
Parameters:

data (Any) –

Id: Optional[str]
Label: Optional[str]
Notes: Optional[str]
Points: ConstrainedListValue[PersistablePoint]
classmethod polygon_checks(points)

Todo

Find a way to check the validity of the given points

class geolib.models.dgeoflow.internal.PersistableMeshProperties(**data)
Parameters:

data (Any) –

ElementSize: Optional[float]
Label: Optional[str]
LayerId: str
class geolib.models.dgeoflow.internal.PersistablePoint(**data)
Parameters:

data (Any) –

X: Optional[float]
Z: Optional[float]
class geolib.models.dgeoflow.internal.PersistableShadingType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
DIAGONAL_A = 'DiagonalA'
DIAGONAL_B = 'DiagonalB'
DIAGONAL_C = 'DiagonalC'
DIAGONAL_D = 'DiagonalD'
DOT_A = 'DotA'
DOT_B = 'DotB'
DOT_C = 'DotC'
DOT_D = 'DotD'
HORIZONTAL_A = 'HorizontalA'
HORIZONTAL_B = 'HorizontalB'
NONE = 'None'
class geolib.models.dgeoflow.internal.PersistableSoil(**data)
Parameters:

data (Any) –

Code: str
HorizontalPermeability: float
Id: str
Name: str
Notes: str
VerticalPermeability: float
class geolib.models.dgeoflow.internal.PersistableSoilLayer(**data)
Parameters:

data (Any) –

LayerId: Optional[str]
SoilId: Optional[str]
class geolib.models.dgeoflow.internal.PersistableSoilVisualization(**data)
Parameters:

data (Any) –

Color: Optional[str]
PersistableShadingType: Optional[PersistableShadingType]
SoilId: Optional[str]
class geolib.models.dgeoflow.internal.PersistableStage(**data)
Parameters:

data (Any) –

BoundaryConditionCollectionId: Optional[str]
Label: Optional[str]
Notes: Optional[str]
class geolib.models.dgeoflow.internal.PersistableStochasticParameter(**data)
Parameters:

data (Any) –

IsProbabilistic: bool
Mean: float
StandardDeviation: float
class geolib.models.dgeoflow.internal.PipeElementResult(**data)
Parameters:

data (Any) –

Height: Optional[float]
IsActive: Optional[bool]
Nodes: Optional[List[PersistablePoint]]
class geolib.models.dgeoflow.internal.PipeLengthResult(**data)
Parameters:

data (Any) –

ContentVersion: Optional[str]
Elements: Optional[List[ElementResult]]
Id: Optional[str]
PipeElements: Optional[List[PipeElementResult]]
PipeLength: Optional[float]
class geolib.models.dgeoflow.internal.PipeTrajectory(**data)
Parameters:

data (Any) –

D70: Optional[float]
ElementSize: Optional[float]
ErosionDirection: Optional[ErosionDirectionEnum]
Label: Optional[str]
Notes: Optional[str]
Points: Optional[List[PersistablePoint]]
class geolib.models.dgeoflow.internal.ProjectInfo(**data)

projectinfo.json.

Parameters:

data (Any) –

Analyst: Optional[str]
ApplicationCreated: Optional[str]
ApplicationModified: Optional[str]
ContentVersion: Optional[str]
Created: Optional[date]
CrossSection: Optional[str]
Date: Optional[date]
IsDataValidated: Optional[bool]
LastModified: Optional[date]
LastModifier: Optional[str]
Path: Optional[str]
Project: Optional[str]
Remarks: Optional[str]
classmethod nltime(date)
Parameters:

date (Union[date, str]) –

Return type:

date

class geolib.models.dgeoflow.internal.Scenario(**data)

scenarios/scenario_x.json

Parameters:

data (Any) –

Calculations: List[PersistableCalculation]
ContentVersion: Optional[str]
GeometryId: Optional[str]
Id: Optional[str]
Label: Optional[str]
Notes: Optional[str]
SoilLayersId: Optional[str]
Stages: List[PersistableStage]
add_calculation(label, notes, mesh_properties_id)
Parameters:
  • label (str) –

  • notes (str) –

  • mesh_properties_id (str) –

Return type:

PersistableCalculation

add_stage(label, notes, boundaryconditions_collection_id)
Parameters:
  • label (str) –

  • notes (str) –

  • boundaryconditions_collection_id (str) –

Return type:

PersistableStage

classmethod structure_name()
Return type:

str

class geolib.models.dgeoflow.internal.SoilCollection(**data)

soils.json

Parameters:

data (Any) –

ContentVersion: Optional[str]
Soils: List[PersistableSoil]
add_soil(soil)

Add a new soil to the model.

Parameters:

soil (Soil) – a new soil

Return type:

PersistableSoil

Returns:

None

edit_persistable_soil(persistable_soil, kwargs)
Parameters:
edit_soil(code, **kwargs)

Update a soil.

Parameters:
  • code (str) – code of the soil.

  • kwargs (dict) – dictionary with argument names and values

Returns:

the edited soil

Return type:

PersistableSoil

edit_soil_by_name(name=None, **kwargs)

Update a soil, searching by name. This method will edit the first occurence of the name if it is used multiple times.

Parameters:
  • name (str) – name of the soil.

  • kwargs (dict) – dictionary with argument names and values

Returns:

the edited soil

Return type:

PersistableSoil

get_soil(code)

Get soil by the given code.

Parameters:

code (str) – code of the soil

Returns:

the soil object

Return type:

Soil

has_soilcode(code)

Checks if the soilcode is available in the current soil list.

Parameters:

code (str) – code of the soil

Returns:

True if found, False if not

Return type:

bool

classmethod structure_name()
Return type:

str

class geolib.models.dgeoflow.internal.SoilLayerCollection(**data)

soillayers/soillayers_x.json

Parameters:

data (Any) –

ContentVersion: Optional[str]
Id: Optional[str]
SoilLayers: List[PersistableSoilLayer]
add_soillayer(layer_id, soil_id)
Parameters:
  • layer_id (str) –

  • soil_id (str) –

Return type:

PersistableSoilLayer

get_ids(exclude_soil_layer_id)
Parameters:

exclude_soil_layer_id (Optional[int]) –

Return type:

Set[str]

classmethod structure_name()
Return type:

str

class geolib.models.dgeoflow.internal.SoilVisualisation(**data)
Parameters:

data (Any) –

ContentVersion: Optional[str]
SoilVisualizations: Optional[List[Optional[PersistableSoilVisualization]]]
classmethod structure_name()
Return type:

str