py-ewr 2.3.8__tar.gz → 2.3.9__tar.gz

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.
Files changed (33) hide show
  1. {py_ewr-2.3.8 → py_ewr-2.3.9}/PKG-INFO +4 -4
  2. {py_ewr-2.3.8 → py_ewr-2.3.9}/README.md +3 -3
  3. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/data_inputs.py +37 -10
  4. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/parameter_metadata/ewr_calc_config.json +63 -2
  5. py_ewr-2.3.8/py_ewr/parameter_metadata/objective_reference_NB_SA_WIM_NE_LACH_BIDG_MLD_ACT.csv → py_ewr-2.3.9/py_ewr/parameter_metadata/objective_reference.csv +298 -328
  6. py_ewr-2.3.8/py_ewr/parameter_metadata/parameter_sheet_NB_SA_WIM_NE_LACH_BIDG_MLD_ACT_added_act_env.csv → py_ewr-2.3.9/py_ewr/parameter_metadata/parameter_sheet.csv +1816 -1679
  7. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/scenario_handling.py +0 -1
  8. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/summarise_results.py +1 -1
  9. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr.egg-info/PKG-INFO +4 -4
  10. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr.egg-info/SOURCES.txt +1 -3
  11. {py_ewr-2.3.8 → py_ewr-2.3.9}/setup.py +1 -1
  12. py_ewr-2.3.8/py_ewr/parameter_metadata/parameter_sheet.csv +0 -3443
  13. py_ewr-2.3.8/py_ewr/parameter_metadata/parameter_sheet_NB_SA_WIM_NE_LACH_BIDG_MLD_ACT.csv +0 -3127
  14. {py_ewr-2.3.8 → py_ewr-2.3.9}/LICENSE +0 -0
  15. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/__init__.py +0 -0
  16. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/evaluate_EWRs.py +0 -0
  17. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/io.py +0 -0
  18. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/model_metadata/EWR_Sitelist_FIRM_20250718.csv +0 -0
  19. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/model_metadata/SiteID_MDBA.csv +0 -0
  20. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/model_metadata/SiteID_NSW.csv +0 -0
  21. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/model_metadata/iqqm_stations.csv +0 -0
  22. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr/observed_handling.py +0 -0
  23. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr.egg-info/dependency_links.txt +0 -0
  24. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr.egg-info/requires.txt +0 -0
  25. {py_ewr-2.3.8 → py_ewr-2.3.9}/py_ewr.egg-info/top_level.txt +0 -0
  26. {py_ewr-2.3.8 → py_ewr-2.3.9}/pyproject.toml +0 -0
  27. {py_ewr-2.3.8 → py_ewr-2.3.9}/setup.cfg +0 -0
  28. {py_ewr-2.3.8 → py_ewr-2.3.9}/tests/test_data_inputs.py +0 -0
  29. {py_ewr-2.3.8 → py_ewr-2.3.9}/tests/test_evaluate_ewr_rest.py +0 -0
  30. {py_ewr-2.3.8 → py_ewr-2.3.9}/tests/test_evaluate_ewrs.py +0 -0
  31. {py_ewr-2.3.8 → py_ewr-2.3.9}/tests/test_observed_handling.py +0 -0
  32. {py_ewr-2.3.8 → py_ewr-2.3.9}/tests/test_scenario_handling.py +0 -0
  33. {py_ewr-2.3.8 → py_ewr-2.3.9}/tests/test_summarise_results.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py_ewr
3
- Version: 2.3.8
3
+ Version: 2.3.9
4
4
  Summary: Environmental Water Requirement calculator
5
5
  Home-page: https://github.com/MDBAuth/EWR_tool
6
6
  Author: Martin Job
@@ -44,7 +44,7 @@ Dynamic: summary
44
44
  [![PyPI](https://img.shields.io/pypi/v/py-ewr)](https://pypi.org/project/py-ewr/)
45
45
  [![DOI](https://zenodo.org/badge/342122359.svg)](https://zenodo.org/badge/latestdoi/342122359)
46
46
 
47
- ### **ewr tool version 2.3.8 README**
47
+ ### **ewr tool version 2.3.9 README**
48
48
 
49
49
  ### **Notes on recent version updates**
50
50
 
@@ -59,13 +59,13 @@ Dynamic: summary
59
59
  - Added new FIRM ID file mapping FIRM ID to gauge number.
60
60
 
61
61
  #### parameter metadata
62
- - Updated parameter sheet
62
+ - Updated parameter sheet and objective mapping correcting some mismatched links between environmental objectives and EWRs
63
63
  - Fix SDL resource unit mapping in the parameter sheet
64
64
  - Adding lat and lon to the parameter sheet
65
65
  - Added in model handling for FIRM model outputs
66
66
  - Various minor variable renamings for consistency
67
67
  - Renamed MaxLevelRise to MaxLevelChange
68
- - Removed AnnualFlowSum column from parameter sheet
68
+ - Removed AnnualFlowSum and MinLevelRise column from parameter sheet
69
69
  - New format of objective mapping includes the adding of objective mapping back into the parameter sheet and one secondary dataframe (objective_reference.csv) in parameter metadata.
70
70
 
71
71
  ### **Installation**
@@ -3,7 +3,7 @@
3
3
  [![PyPI](https://img.shields.io/pypi/v/py-ewr)](https://pypi.org/project/py-ewr/)
4
4
  [![DOI](https://zenodo.org/badge/342122359.svg)](https://zenodo.org/badge/latestdoi/342122359)
5
5
 
6
- ### **ewr tool version 2.3.8 README**
6
+ ### **ewr tool version 2.3.9 README**
7
7
 
8
8
  ### **Notes on recent version updates**
9
9
 
@@ -18,13 +18,13 @@
18
18
  - Added new FIRM ID file mapping FIRM ID to gauge number.
19
19
 
20
20
  #### parameter metadata
21
- - Updated parameter sheet
21
+ - Updated parameter sheet and objective mapping correcting some mismatched links between environmental objectives and EWRs
22
22
  - Fix SDL resource unit mapping in the parameter sheet
23
23
  - Adding lat and lon to the parameter sheet
24
24
  - Added in model handling for FIRM model outputs
25
25
  - Various minor variable renamings for consistency
26
26
  - Renamed MaxLevelRise to MaxLevelChange
27
- - Removed AnnualFlowSum column from parameter sheet
27
+ - Removed AnnualFlowSum and MinLevelRise column from parameter sheet
28
28
  - New format of objective mapping includes the adding of objective mapping back into the parameter sheet and one secondary dataframe (objective_reference.csv) in parameter metadata.
29
29
 
30
30
  ### **Installation**
@@ -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
- ewr2obj_path = os.path.join(BASE_PATH, "parameter_metadata/ewr2obj.csv")
548
- obj2target_path = os.path.join(BASE_PATH, "parameter_metadata/obj2target.csv")
549
- obj2yrtarget_path = os.path.join(BASE_PATH, "parameter_metadata/obj2yrtarget.csv")
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
- causal_ewr = {
552
- "ewr2obj": pd.read_csv(ewr2obj_path),
553
- "obj2target": pd.read_csv(obj2target_path),
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
- return causal_ewr
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"