Skip to content

Commit

Permalink
Statistics: Re-introduce fixed water_on_street preset.
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanverkerk committed Oct 25, 2023
1 parent a05aaa7 commit 04d5ae5
Show file tree
Hide file tree
Showing 6 changed files with 529 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
3.1.13 (unreleased)
-------------------

- Nothing changed yet.
- Statistics: re-introduce fixed water_on_street preset


3.1.12 (2023-10-19)
Expand Down
21 changes: 21 additions & 0 deletions tool_statistics/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
STYLE_VECTOR,
STYLE_TIMESTEP_REDUCTION_ANALYSIS,
STYLE_BALANCE,
STYLE_WATER_ON_STREET_DURATION_NODE,
)


Expand Down Expand Up @@ -245,11 +246,31 @@ def aggregations(self):
raster_layer_name="Source or sink (raster)",
)

# Change in water level
water_on_street_aggregations = [
Aggregation(
variable=AGGREGATION_VARIABLES.get_by_short_name("s1"),
method=AGGREGATION_METHODS.get_by_short_name("time_above_threshold"),
),
]

WATER_ON_STREET_DURATION_PRESET = Preset(
name="Water on street duration",
description="Duration of water level above manhole drain level.",
aggregations=water_on_street_aggregations,
nodes_style=STYLE_WATER_ON_STREET_DURATION_NODE,
nodes_style_param_values={"column": "s1_time_above_threshold"},
nodes_layer_name="Water on street duration (nodes)",
raster_layer_name="Water on street duration (raster)",
only_manholes=True,
)

PRESETS = [
NO_PRESET,
MAX_WL_PRESETS,
CHANGE_WL_PRESETS,
SOURCE_SINK_MM_PRESETS,
FLOW_PATTERN_PRESETS,
TS_REDUCTION_ANALYSIS_PRESETS,
WATER_ON_STREET_DURATION_PRESET,
]
14 changes: 14 additions & 0 deletions tool_statistics/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,19 @@ def style_ts_reduction_analysis(
styling_method=style_on_single_column,
)

STYLE_WATER_ON_STREET_DURATION_NODE = Style(
name="Water on street duration",
output_type="node",
params={"column": "column"},
qml="water_on_street_duration.qml",
styling_method=lambda layer, qml, column, update_classes=False: style_on_single_column(
layer,
qml,
column,
update_classes
),
)

STYLE_CHANGE_WL = Style(
name="Change in water level",
output_type="cell",
Expand Down Expand Up @@ -335,6 +348,7 @@ def style_ts_reduction_analysis(
STYLE_SINGLE_COLUMN_GRADUATED_CELL,
STYLE_CHANGE_WL,
STYLE_BALANCE,
STYLE_WATER_ON_STREET_DURATION_NODE,
]

DEFAULT_STYLES = {
Expand Down
Loading

0 comments on commit 04d5ae5

Please sign in to comment.