py-ewr 2.3.8__py3-none-any.whl → 2.3.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_ewr/data_inputs.py +37 -10
- py_ewr/parameter_metadata/ewr_calc_config.json +63 -2
- py_ewr/parameter_metadata/{objective_reference_NB_SA_WIM_NE_LACH_BIDG_MLD_ACT.csv → objective_reference.csv} +298 -328
- py_ewr/parameter_metadata/parameter_sheet.csv +3325 -3443
- py_ewr/scenario_handling.py +0 -1
- py_ewr/summarise_results.py +1 -1
- {py_ewr-2.3.8.dist-info → py_ewr-2.3.9.dist-info}/METADATA +4 -4
- py_ewr-2.3.9.dist-info/RECORD +19 -0
- py_ewr/parameter_metadata/parameter_sheet_NB_SA_WIM_NE_LACH_BIDG_MLD_ACT.csv +0 -3127
- py_ewr/parameter_metadata/parameter_sheet_NB_SA_WIM_NE_LACH_BIDG_MLD_ACT_added_act_env.csv +0 -3188
- py_ewr-2.3.8.dist-info/RECORD +0 -21
- {py_ewr-2.3.8.dist-info → py_ewr-2.3.9.dist-info}/WHEEL +0 -0
- {py_ewr-2.3.8.dist-info → py_ewr-2.3.9.dist-info}/licenses/LICENSE +0 -0
- {py_ewr-2.3.8.dist-info → py_ewr-2.3.9.dist-info}/top_level.txt +0 -0
py_ewr/data_inputs.py
CHANGED
|
@@ -542,16 +542,43 @@ def gauge_groups(parameter_sheet: pd.DataFrame) -> dict:
|
|
|
542
542
|
|
|
543
543
|
# def gauges_to_measurand()
|
|
544
544
|
|
|
545
|
-
def get_causal_ewr() -> dict:
|
|
546
545
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
546
|
+
def get_obj_mapping(
|
|
547
|
+
parameter_sheet_path=None,
|
|
548
|
+
objective_reference_path=None
|
|
549
|
+
) -> pd.DataFrame:
|
|
550
|
+
'''
|
|
551
|
+
Retrieves objective mapping and merges with parameter sheet on Gauge, Planning Unit, Code, and LTWPShortName
|
|
552
|
+
to create a longform table that lists the associations between each EWR and ecological objectives.
|
|
553
|
+
Returns a DataFrame with the merged result.
|
|
554
|
+
Args:
|
|
555
|
+
param_sheet_path (str) = file path to parameter sheet. If None, default parameter_sheet.csv inside the tool is selected
|
|
556
|
+
obj_ref_path (str) = file path to objective mapping csv. If Not, default objective_reference.csv inside EWR tool is selected
|
|
557
|
+
'''
|
|
558
|
+
param_sheet_cols = [
|
|
559
|
+
'PlanningUnitName', 'LTWPShortName', 'SWSDLName', 'State', 'Gauge', 'Code', 'EnvObj'
|
|
560
|
+
]
|
|
550
561
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
"obj2yrtarget":pd.read_csv(obj2yrtarget_path)
|
|
555
|
-
}
|
|
562
|
+
if not objective_reference_path:
|
|
563
|
+
objective_reference_path = os.path.join(BASE_PATH, "parameter_metadata/obj_reference.csv")
|
|
564
|
+
|
|
556
565
|
|
|
557
|
-
|
|
566
|
+
obj_ref = pd.read_csv(objective_reference_path)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
okay_EWRs, _ = get_EWR_table(file_path=parameter_sheet_path)
|
|
570
|
+
okay_EWRs_sub = okay_EWRs[param_sheet_cols]
|
|
571
|
+
|
|
572
|
+
# Split 'EnvObj' by '+' and explode to long format
|
|
573
|
+
longform_ewr = okay_EWRs_sub.assign(
|
|
574
|
+
EnvObj=okay_EWRs_sub['EnvObj'].str.split('+')
|
|
575
|
+
).explode('EnvObj').drop_duplicates()
|
|
576
|
+
|
|
577
|
+
merged_df = longform_ewr.merge(
|
|
578
|
+
obj_ref,
|
|
579
|
+
left_on= ['LTWPShortName', 'PlanningUnitName', 'Gauge', 'Code', 'EnvObj', 'SWSDLName', 'State'],
|
|
580
|
+
right_on=['LTWPShortName', 'PlanningUnitName', 'Gauge', 'Code', 'EnvObj', 'SWSDLName', 'State'],
|
|
581
|
+
how='left'
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
return merged_df
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"OB-WS2_P-single-F",
|
|
67
67
|
"OB-WS4_S-single-F",
|
|
68
68
|
"OB-WS4_P-single-F",
|
|
69
|
+
"BK1-single-F",
|
|
69
70
|
"BK1_S-single-F",
|
|
70
71
|
"BK1_P-single-F",
|
|
71
72
|
"OB-WL1_P-single-F",
|
|
@@ -151,6 +152,7 @@
|
|
|
151
152
|
"F2b_P-single-F",
|
|
152
153
|
"F2a_S-single-F",
|
|
153
154
|
"F2b_S-single-F",
|
|
155
|
+
"BK1-single-F",
|
|
154
156
|
"BK2a_P-single-F",
|
|
155
157
|
"BK2b_P-single-F",
|
|
156
158
|
"BK2a_S-single-F",
|
|
@@ -171,6 +173,7 @@
|
|
|
171
173
|
"F2d-single-F",
|
|
172
174
|
"F3a-single-F",
|
|
173
175
|
"F3b-single-F",
|
|
176
|
+
"OB1-single-F",
|
|
174
177
|
"OB1a-single-F",
|
|
175
178
|
"OB1b-single-F",
|
|
176
179
|
"OB2a-single-F",
|
|
@@ -178,12 +181,14 @@
|
|
|
178
181
|
"F1_a_P-single-F",
|
|
179
182
|
"F1_a_S-single-F",
|
|
180
183
|
"F1_b-single-F",
|
|
184
|
+
"F2-single-F",
|
|
181
185
|
"F2_a_P_pd-single-F",
|
|
182
186
|
"F2_a_P_sd-single-F",
|
|
183
187
|
"F2_a_S_pd-single-F",
|
|
184
188
|
"F2_a_S_sd-single-F",
|
|
185
189
|
"F2_b_pd-single-F",
|
|
186
190
|
"F2_b_sd-single-F",
|
|
191
|
+
"F3-single-F",
|
|
187
192
|
"F3_P_pd-single-F",
|
|
188
193
|
"F3_P_sd-single-F",
|
|
189
194
|
"F3_S_pd-single-F",
|
|
@@ -267,6 +272,7 @@
|
|
|
267
272
|
"SF2_S_sd-single-F",
|
|
268
273
|
"BK1_P_pd-single-F",
|
|
269
274
|
"BK1_S_sd-single-F",
|
|
275
|
+
"BF1-single-F",
|
|
270
276
|
"F1_c-single-F",
|
|
271
277
|
"F2_a-single-F",
|
|
272
278
|
"F2_c-single-F",
|
|
@@ -417,7 +423,58 @@
|
|
|
417
423
|
"F1_d_sd-single-F",
|
|
418
424
|
"F2_d-single-F",
|
|
419
425
|
"BK1_S_pd-single-F",
|
|
420
|
-
"BK1_P_sd-single-F"
|
|
426
|
+
"BK1_P_sd-single-F",
|
|
427
|
+
"Wetland1-single-F",
|
|
428
|
+
"Wetland2-single-F",
|
|
429
|
+
"Wetland3-single-F",
|
|
430
|
+
"F4-single-F",
|
|
431
|
+
"F5-single-F",
|
|
432
|
+
"F6-single-F",
|
|
433
|
+
"F7-single-F",
|
|
434
|
+
"F8-single-F",
|
|
435
|
+
"OB-WL2_P-single-F",
|
|
436
|
+
"OB-WL2_S-single-F",
|
|
437
|
+
"F1_d-single-F",
|
|
438
|
+
"F_EarlySpring1-single-F",
|
|
439
|
+
"F_LateSpring2-single-F",
|
|
440
|
+
"F_LateSpring1-single-F",
|
|
441
|
+
"F_Autumn1-single-F",
|
|
442
|
+
"F_Autumn2-single-F",
|
|
443
|
+
"F_Autumn3-single-F",
|
|
444
|
+
"BMF5a-single-F",
|
|
445
|
+
"BMF5b-single-F",
|
|
446
|
+
"BMF6a-single-F",
|
|
447
|
+
"BMF6b-single-F",
|
|
448
|
+
"BMF6c-single-F",
|
|
449
|
+
"BMF7ai-single-F",
|
|
450
|
+
"BMF7aii-single-F",
|
|
451
|
+
"BMF7b-single-F",
|
|
452
|
+
"BMF7c-single-F",
|
|
453
|
+
"BMF7d-single-F",
|
|
454
|
+
"BMF7e-single-F",
|
|
455
|
+
"BMF8a-single-F",
|
|
456
|
+
"BMF8b-single-F",
|
|
457
|
+
"BMF10a-single-F",
|
|
458
|
+
"BMF10b-single-F",
|
|
459
|
+
"BMF12a-single-F",
|
|
460
|
+
"BMF12b-single-F",
|
|
461
|
+
"BMF13a-single-F",
|
|
462
|
+
"BMF13b-single-F",
|
|
463
|
+
"BMF13c-single-F",
|
|
464
|
+
"F_Winter-single-F",
|
|
465
|
+
"OB1-WS-single-F",
|
|
466
|
+
"OB2-WS-single-F",
|
|
467
|
+
"OB1-WL-single-F",
|
|
468
|
+
"OB2-WL-single-F",
|
|
469
|
+
"OB3-WL-single-F",
|
|
470
|
+
"OB3-WL-single-F",
|
|
471
|
+
"LF1_platypus-single-F",
|
|
472
|
+
"Wetland_proxy-single-F",
|
|
473
|
+
"OB3-WS-single-F",
|
|
474
|
+
"F_EarlySpring2-single-F"
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
421
478
|
],
|
|
422
479
|
"flow_handle_sa": [
|
|
423
480
|
"IC1_P-single-F",
|
|
@@ -534,7 +591,11 @@
|
|
|
534
591
|
"BF1_9-single-F",
|
|
535
592
|
"BF1_10-single-F",
|
|
536
593
|
"BF1_11-single-F",
|
|
537
|
-
"BF1_12-single-F"
|
|
594
|
+
"BF1_12-single-F",
|
|
595
|
+
"BF_SumAut_1-single-F",
|
|
596
|
+
"BF_SumAut_2-single-F",
|
|
597
|
+
"BF_AllYear-single-F"
|
|
598
|
+
|
|
538
599
|
],
|
|
539
600
|
"ctf_handle_multi": [
|
|
540
601
|
"CF-multigauge-F"
|