-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/dei 122 add selection of tests to testbench (#51)
* feat[DEI-122]: add tests at testbench * feat[DEI-122]: add tests for testbench * feat[DEI-122]: add tests at testbench * feat[DEI-122]: add tests at testbench * DEI-122 removed new line * DEI-122 added missing new lines --------- Co-authored-by: David Rodriguez Aguilera <32545627+Davidrag@users.noreply.github.com>
- Loading branch information
Showing
74 changed files
with
1,017 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+8.21 MB
tests_acceptance/input_nc_files/test8b_stepwise_classification_salinity_limits.nc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# - response_curve_rule: | ||
name: test name | ||
description: Get flowing value waterlevel | ||
response_table: | ||
- ["input" , "output"] | ||
- [-999.0 , 0.0 ] | ||
- [ 0.5 , 0.0 ] | ||
- [ 1.0 , 1.0 ] | ||
- [ 999.0 , 1.0 ] | ||
input_variable: water_level | ||
output_variable: water_level_policy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# - response_curve_rule: | ||
name: test name | ||
description: Get flowing value waterlevel | ||
response_table: | ||
- ["input" , "output"] | ||
- [-999.0 , 0.0 ] | ||
- [ 0.5 , 0.0 ] | ||
- [ 1.0 , 1.0 ] | ||
- [ 999.0 , 1.0 ] | ||
input_variable: water_level | ||
output_variable: water_level_policy2 | ||
|
6 changes: 6 additions & 0 deletions
6
tests_acceptance/input_yaml_files/tables/input_response_curve.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- ["input" , "output"] | ||
- [-999.0 , 0.0 ] | ||
- [-999.0 , 0.0 ] | ||
- [ 0.5 , 0.0 ] | ||
- [ 1.0 , 1.0 ] | ||
- [ 999.0 , 1.0 ] |
13 changes: 13 additions & 0 deletions
13
tests_acceptance/input_yaml_files/tables/stepfunction.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: test name | ||
description: Get boundaries waterlevel | ||
limit_response_table: | ||
[ | ||
[ limit , response], | ||
[-999.0 , 0.00], | ||
[ -0.10 , 1.00], | ||
[ 0.15 , 0.00], | ||
[ 999.0 , 0.00], | ||
] | ||
input_variable: water_level | ||
output_variable: water_level_policy | ||
|
25 changes: 25 additions & 0 deletions
25
tests_acceptance/input_yaml_files/test10_formula_based_comparison.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
input-data: | ||
- dataset: | ||
filename: ./tests_acceptance/input_nc_files/small_subset_FM-VZM_0000_map.nc | ||
variable_mapping: | ||
salinity_PSU: "salinity" | ||
water_level_mNAP: "water_level" | ||
water_depth_mNAP: "water_depth" | ||
|
||
rules: | ||
- formula_rule: | ||
name: Classify salinity | ||
description: Reponse of Pond weed (Potamogeton nodosus) to water depth | ||
formula: salinity < 1 | ||
input_variables: [salinity] | ||
output_variable: salinity_class | ||
|
||
- formula_rule: | ||
name: Classify dryfall | ||
description: Classify when dry-fall occurs and if so label it with 1 (or zero if no dry-fall) | ||
formula: water_depth < 0.05 | ||
input_variables: [water_depth] | ||
output_variable: dry_fall | ||
|
||
output-data: | ||
filename: ./tests_acceptance/output_nc_files/test10_formula_based_comparison.nc |
25 changes: 25 additions & 0 deletions
25
tests_acceptance/input_yaml_files/test10b_formula_based_arithmatic.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
input-data: | ||
- dataset: | ||
filename: ./tests_acceptance/input_nc_files/small_subset_FM-VZM_0000_map.nc | ||
variable_mapping: | ||
salinity_PSU: "salinity" | ||
water_level_mNAP: "water_level" | ||
water_depth_mNAP: "water_depth" | ||
|
||
rules: | ||
- formula_rule: | ||
name: Amplify water_level | ||
description: Amplify waterlevel with 25% | ||
formula: water_level * 1.25 | ||
input_variables: [water_level] | ||
output_variable: water_level_scenario | ||
|
||
- formula_rule: | ||
name: calculate water_depth_scenario | ||
description: Amplify waterdepth scenario | ||
formula: (water_depth - water_level) + water_level_scenario | ||
input_variables: [water_level, water_depth, water_level_scenario] | ||
output_variable: water_depth_scenario | ||
|
||
output-data: | ||
filename: ./tests_acceptance/output_nc_files/test10b_formula_based_arithmatic.nc |
34 changes: 34 additions & 0 deletions
34
tests_acceptance/input_yaml_files/test10c_formula_based_ifelse.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
input-data: | ||
- dataset: | ||
filename: ./tests_acceptance/input_nc_files/small_subset_FM-VZM_0000_map.nc | ||
variable_mapping: | ||
salinity_PSU: "salinity" | ||
water_level_mNAP: "water_level" | ||
water_depth_mNAP: "water_depth" | ||
|
||
rules: | ||
- formula_rule: | ||
name: Subset water level | ||
description: Subset water level to where water is | ||
formula: -999 if(water_depth <= 0.10) else water_level | ||
input_variables: [water_level, water_depth] | ||
output_variable: water_level_subset | ||
|
||
- formula_rule: | ||
name: Classify water depths | ||
description: Classify water depths (0 = dry, 1 = <1m, 2 = >1m) | ||
formula: 0 if(water_depth <= 0.10) else (1 if(water_depth <= 1.00) else 2) | ||
input_variables: [water_depth] | ||
output_variable: water_depth_class | ||
|
||
- formula_rule: | ||
name: Calculate deviation allowed water level | ||
description: Only show deviation (in m) from allowed water levels (-0.10 - 0.15 m NAP) | ||
formula: > | ||
water_level + 0.10 if(water_level < -0.10) else | ||
(water_level - 0.15 if(water_level > 0.15) else 0) | ||
input_variables: [water_level] | ||
output_variable: water_level_deviation | ||
|
||
output-data: | ||
filename: ./tests_acceptance/output_nc_files/test10c_formula_based_ifelse.nc |
20 changes: 20 additions & 0 deletions
20
tests_acceptance/input_yaml_files/test11_yaml_include_file_response_curve_stepfunction.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
input-data: | ||
- dataset: | ||
filename: ./tests_acceptance/input_nc_files/small_subset_FM-VZM_0000_map.nc | ||
variable_mapping: | ||
salinity_PSU: "salinity" | ||
water_level_mNAP: "water_level" | ||
water_depth_mNAP: "water_depth" | ||
|
||
rules: | ||
- step_function_rule: !include tables/stepfunction.yaml | ||
|
||
- response_curve_rule: | ||
name: test name | ||
description: Get flowing value waterlevel | ||
response_table: !include tables/input_response_curve.yaml | ||
input_variable: water_level | ||
output_variable: water_level_policy | ||
|
||
output-data: | ||
filename: ./tests_acceptance/output_nc_files/test11_yaml_include_file_response_curve_stepfunction.nc |
15 changes: 15 additions & 0 deletions
15
.../input_yaml_files/test11b_yaml_include_file_response_curve_stepfunction_fullfunction.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
input-data: | ||
- dataset: | ||
filename: ./tests_acceptance/input_nc_files/small_subset_FM-VZM_0000_map.nc | ||
variable_mapping: | ||
salinity_PSU: "salinity" | ||
water_level_mNAP: "water_level" | ||
water_depth_mNAP: "water_depth" | ||
|
||
rules: | ||
- response_curve_rule: !include tables/input_IRM1.yaml | ||
|
||
- response_curve_rule: !include tables/input_IRM2.yaml | ||
|
||
output-data: | ||
filename: ./tests_acceptance/output_nc_files/test11b_yaml_include_file_response_curve_stepfunction_fullfunction.nc |
92 changes: 92 additions & 0 deletions
92
tests_acceptance/input_yaml_files/test12_multiple_reclassification.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
input-data: | ||
- dataset: | ||
filename: ./tests_acceptance/input_nc_files/small_subset_FM-VZM_0000_map.nc | ||
variable_mapping: | ||
salinity_PSU: "salinity_PHU" | ||
temperature_degreesC: "temperature_C" | ||
flow_velocity_ms: "flow_velocity_msec" | ||
water_level_mNAP: "water_level_meterNAP" | ||
water_depth_mNAP: "water_depth_meterNAP" | ||
|
||
rules: | ||
- multiply_rule: | ||
name: Get chloride concentration | ||
description: Converts salinity to chloride | ||
multipliers: [0.0018066, 1e5] | ||
input_variable: salinity_PHU | ||
output_variable: chloride_mgL | ||
|
||
- layer_filter_rule: | ||
name: Get chloride top layer | ||
description: get first layer of model | ||
layer_number: 22 | ||
input_variable: chloride_mgL | ||
output_variable: chloride_mgL_top_layer | ||
|
||
- layer_filter_rule: | ||
name: Get temperature top layer | ||
description: get first layer of model | ||
layer_number: 22 | ||
input_variable: temperature_C | ||
output_variable: temperature_C_top_layer | ||
|
||
- layer_filter_rule: | ||
name: Get flow velocity top layer | ||
description: get first layer of model | ||
layer_number: 22 | ||
input_variable: flow_velocity_msec | ||
output_variable: flow_velocity_ms_top_layer | ||
|
||
- time_aggregation_rule: | ||
name: Get maximum chloride level | ||
description: Get maximum chloride level | ||
operation: MAX | ||
input_variable: chloride_mgL_top_layer | ||
time_scale: year | ||
output_variable: MAX_chloride | ||
|
||
- time_aggregation_rule: | ||
name: Get minimum water temperature | ||
description: Get minimum water temperature | ||
operation: MIN | ||
input_variable: temperature_C_top_layer | ||
time_scale: year | ||
output_variable: MIN_water_temperature | ||
|
||
- time_aggregation_rule: | ||
name: Get maximum flow velocity | ||
description: Get maximum flow velocity | ||
operation: MIN | ||
input_variable: flow_velocity_ms_top_layer | ||
time_scale: year | ||
output_variable: MAX_flow_velocity | ||
|
||
- time_aggregation_rule: | ||
name: Get minimum water_depth | ||
description: Get minimum water depth | ||
operation: MIN | ||
input_variable: water_depth_meterNAP | ||
time_scale: year | ||
output_variable: MIN_water_depth_mNAP | ||
|
||
- classification_rule: | ||
name: test calssification for aquatic plants | ||
description: Get flowing value waterlevel | ||
criteria_table: | ||
- [ | ||
"output", | ||
"MIN_water_depth_mNAP", | ||
"MAX_flow_velocity", | ||
"MAX_chloride", | ||
] | ||
- [1, "<0.10", "-", "-"] # to dry | ||
- [2, ">4.0", "-", "-"] # to deep | ||
- [3, "-", "-", ">400"] # to salty | ||
- [4, "-", ">1.5", "-"] # to fast flowing | ||
- [5, "0.10:4.0", "0.0:1.5", "0:400"] # perfect for aquatic plants | ||
input_variables: | ||
["MIN_water_depth_mNAP", "MAX_flow_velocity", "MAX_chloride"] | ||
output_variable: aquatic_plant_classes | ||
|
||
output-data: | ||
filename: ./tests_acceptance/output_nc_files/test12_multiple_reclassification.nc |
56 changes: 56 additions & 0 deletions
56
tests_acceptance/input_yaml_files/test13_time_condition_rule_occurance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
input-data: | ||
- dataset: | ||
filename: ./tests_acceptance/input_nc_files/small_subset_FM-VZM_0000_map.nc | ||
variable_mapping: | ||
# salinity_PSU : "IN_salinity_PSU" | ||
# water_level_mNAP : "IN_water_level_mNAP" | ||
water_depth_mNAP: "IN_water_depth_mNAP" | ||
# flow_velocity_ms : "IN_flow_velocity_ms" | ||
|
||
rules: | ||
- step_function_rule: | ||
name: Calculate dryfall moments | ||
description: Calculate dryfall moments from water depth | ||
limit_response_table: | ||
- [limit, response] | ||
- [-999.0, 1.00] | ||
- [0.10, 0.00] | ||
- [999.0, 0.00] | ||
input_variable: IN_water_depth_mNAP | ||
output_variable: dry_fall | ||
|
||
- time_aggregation_rule: | ||
name: Calculate dryfall occurance | ||
description: Calculate dryfall occurance (nr of occurances/periods) | ||
operation: COUNT_PERIODS | ||
time_scale: YEAR | ||
input_variable: dry_fall | ||
output_variable: number_of_dry_periods | ||
|
||
- time_aggregation_rule: | ||
name: test for flooding | ||
description: Test for flooding in area | ||
operation: MIN | ||
time_scale: YEAR | ||
input_variable: dry_fall | ||
output_variable: no_flooding | ||
|
||
- step_function_rule: | ||
name: Set land to -1 | ||
description: Set land to -1 for visualisation | ||
limit_response_table: | ||
- [limit, response] | ||
- [0, 366] | ||
- [1, -1] | ||
input_variable: no_flooding | ||
output_variable: land_filter | ||
|
||
- combine_results_rule: | ||
name: Set land to -1 | ||
description: Set land to -1 for visualisation | ||
operation: min | ||
input_variables: ["number_of_dry_periods", "land_filter"] | ||
output_variable: Visualisation_number_of_dry_fall_periods | ||
|
||
output-data: | ||
filename: ./tests_acceptance/output_nc_files/test13_time_condition_rule_occurance.nc |
Oops, something went wrong.