py-ewr 2.3.8__py3-none-any.whl → 2.4.0__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.
@@ -749,6 +749,7 @@ class ScenarioHandler:
749
749
 
750
750
  elif self.model_format == 'Standard time-series':
751
751
  df = pd.read_csv(scenarios[scenario], index_col = 'Date')
752
+ self.df_clean = df
752
753
  df_F, df_L, self.report = cleaner_standard_timeseries(df, self.parameter_sheet)
753
754
 
754
755
  elif self.model_format == 'Source - NSW (res.csv)':
@@ -769,7 +770,6 @@ class ScenarioHandler:
769
770
 
770
771
  all_data = []
771
772
  for scenario_file in scenario:
772
- print(scenario_file)
773
773
  try:
774
774
  data, header = unpack_model_file(scenario_file, 'Dy', 'Field')
775
775
  data = build_MDBA_columns(data, header)
@@ -783,7 +783,7 @@ class ScenarioHandler:
783
783
 
784
784
  df_clean = cleaner_MDBA(merged_data)
785
785
  self.df_clean = df_clean
786
- df_F, df_L, self.report = match_MDBA_nodes(df_clean, data_inputs.get_MDBA_codes(), self.parameter_sheet)
786
+ df_F, df_L, self.report = match_MDBA_nodes(df_clean, data_inputs.get_MDBA_codes('FIRM - MDBA'), self.parameter_sheet)
787
787
 
788
788
  gauge_results = {}
789
789
  gauge_events = {}
@@ -994,13 +994,13 @@ class ScenarioHandler:
994
994
  '''
995
995
 
996
996
  if self.model_format == 'Bigmod - MDBA':
997
- self.site_id_df = data_inputs.get_MDBA_codes()[["AWRC", "SITEID"]]
997
+ self.site_id_df = data_inputs.get_MDBA_codes('Bigmod - MDBA')[["AWRC", "SITEID"]]
998
998
  elif self.model_format == 'All Bigmod':
999
- self.site_id_df = data_inputs.get_MDBA_codes()[["AWRC", "SITEID"]]
999
+ self.site_id_df = data_inputs.get_MDBA_codes('FIRM - MDBA')[["AWRC", "SITEID"]]
1000
1000
  elif self.model_format == 'Source - NSW (res.csv)':
1001
1001
  pass
1002
1002
  elif self.model_format == 'Standard time-series':
1003
- self.site_id_df = data_inputs.get_MDBA_codes()[["AWRC", "SITEID"]]
1003
+ self.site_id_df = data_inputs.get_MDBA_codes('FIRM - MDBA')[["AWRC", "SITEID"]]
1004
1004
  elif self.model_format == 'IQQM - netcdf':
1005
1005
  pass
1006
1006
  elif self.model_format == 'ten thousand year':
@@ -1177,7 +1177,7 @@ class ScenarioHandler:
1177
1177
  """
1178
1178
  parameter_sheet = pd.read_csv(self.parameter_sheet)
1179
1179
 
1180
- self.logging_sheet = parameter_sheet.copy()[["PlanningUnitName", "Code", 'Gauge', "GaugeType", 'PlanningUnitID', 'FlowLevelVolume', "Multigauge", "WeirpoolGauge"]]
1180
+ self.logging_sheet = parameter_sheet.copy()[["PlanningUnitName", "Code", 'Gauge', "GaugeType", 'PlanningUnitID', 'FlowLevelVolume', "Multigauge", "WeirpoolGauge", "SWSDLName"]]
1181
1181
 
1182
1182
  self.logging_sheet = self.create_multi_index(self.logging_sheet)
1183
1183
 
@@ -1188,7 +1188,7 @@ class ScenarioHandler:
1188
1188
  self.log_calc_config_info()
1189
1189
  self.log_siteID_info()
1190
1190
 
1191
- self.logging_sheet = self.logging_sheet[["PlanningUnitName", "Code", "Primary Gauge", 'Gauge', "GaugeType", "is_in_calc_config?", "node_in_siteID?", "gauge_in_model_file?", "gaugeANDmeasurand_in_model_file? (Yes/No)", "matched_SITEID", "spare_SITEID", "Analysed?"]]
1191
+ self.logging_sheet = self.logging_sheet[["PlanningUnitName", "Code", "Primary Gauge", 'Gauge', "GaugeType", "is_in_calc_config?", "node_in_siteID?", "gauge_in_model_file?", "gaugeANDmeasurand_in_model_file? (Yes/No)", "matched_SITEID", "spare_SITEID", "Analysed?", "SWSDLName"]]
1192
1192
 
1193
1193
  return self.logging_sheet
1194
1194
 
@@ -193,7 +193,7 @@ def get_events_to_process(gauge_events: dict)-> List:
193
193
  item['gauge'] = gauge
194
194
  item["pu"] = pu
195
195
  item["ewr"] = ewr
196
- item["ewr_events"], = gauge_events[scenario][gauge][pu][ewr]
196
+ item["ewr_events"] = gauge_events[scenario][gauge][pu][ewr]
197
197
  items_to_process.append(item)
198
198
  except Exception as e:
199
199
  log.warning(f"no event for {scenario}-{pu}-{ewr}-{gauge} with error {e}")
@@ -593,7 +593,7 @@ def filter_successful_events(all_events: pd.DataFrame, ewr_table_path: str = Non
593
593
  df_subset = all_events[all_events['ID'] == i]
594
594
  gauge = i.split('TEMPORARY_ID_SPLIT')[1]
595
595
  pu = i.split('TEMPORARY_ID_SPLIT')[2]
596
- ewr = i.split('TEMPORARY_ID_SPLIT')[3]
596
+ ewr = i.split('TEMPORARY_ID_SPLIT')[3]
597
597
 
598
598
  # Pull ewr minSpell value from ewr dataset
599
599
  minSpell = int(data_inputs.ewr_parameter_grabber(EWR_table, gauge, pu, ewr, 'MinSpell'))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py_ewr
3
- Version: 2.3.8
3
+ Version: 2.4.0
4
4
  Summary: Environmental Water Requirement calculator
5
5
  Home-page: https://github.com/MDBAuth/EWR_tool
6
6
  Author: Martin Job
@@ -44,29 +44,34 @@ 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.4.0 README**
48
48
 
49
49
  ### **Notes on recent version updates**
50
50
 
51
+ #### Documentation
52
+ - Working version of the EWR User Guide has been added
53
+
51
54
  #### EWR handling and outputs
52
55
  - Adding handling for cases where there are single MDBA bigmod site IDs mapping to multiple different gauges
53
56
  - New EWRs: New Qld EWRs - SF_FD and BF_FD used to look into the FD EWRs in closer detail.
54
57
  - Adding state and Surface Water SDL (SWSDL) to py-ewr output tables
55
- - Including metadata report (this is still being ironed out and tested)
56
- - New handling capabilities for FIRM model formated files
58
+ - Including metadata report (this is still being ironed out and tested)
59
+ - New handling capabilities for FIRM model formated files
57
60
 
58
61
  #### Model metadata
59
62
  - Added new FIRM ID file mapping FIRM ID to gauge number.
60
63
 
61
64
  #### parameter metadata
62
- - Updated parameter sheet
65
+ - Updated parameter sheet and objective mapping correcting some mismatched links between environmental objectives and EWRs
63
66
  - Fix SDL resource unit mapping in the parameter sheet
64
67
  - Adding lat and lon to the parameter sheet
65
68
  - Added in model handling for FIRM model outputs
66
69
  - Various minor variable renamings for consistency
67
70
  - Renamed MaxLevelRise to MaxLevelChange
68
- - Removed AnnualFlowSum column from parameter sheet
71
+ - Removed AnnualFlowSum and MinLevelRise column from parameter sheet
69
72
  - 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.
73
+ - Removed ACT EWRs. These will be re-added once the ACT LTWP has been finalised
74
+ - "EnvObj" has been changed to "EcoObj" for consistency purposes
70
75
 
71
76
  ### **Installation**
72
77
 
@@ -266,27 +271,22 @@ This tool has two purposes:
266
271
  2. Planning: Comparing ewr success between scenarios (i.e. model runs) - option 2 above.
267
272
 
268
273
  **Support**
269
- For issues relating to the script, a tutorial, or feedback please contact Martin Job at martin.job@mdba.gov.au, Sirous Safari Pour at sirous.safaripour@mdba.gov.au, Elisha Freedman at elisha.freedman@mdba.gov.au, Joel Bailey at joel.bailey@mdba.gov.au, or Lara Palmer at lara.palmer@mdba.gov.au.
270
-
274
+ For issues relating to the script, a tutorial, or feedback please contact Martin Job at Martin.Job@mdba.gov.au, Sirous Safari Pour at Sirous.SafariPour@mdba.gov.au, Elisha Freedman at Elisha.Freedman@mdba.gov.au, Rory Hackett at Rory.Hackett@mdba.gov.au or Joel Bailey at Joel.Bailey@mdba.gov.au
271
275
 
272
276
  **Disclaimer**
273
- Every effort has been taken to ensure the ewr database represents the original EWRs from state Long Term Water Plans (LTWPs) and Environmental Water Management Plans (EWMPs) as best as possible, and that the code within this tool has been developed to interpret and analyse these EWRs in an accurate way. However, there may still be unresolved bugs in the ewr parameter sheet and/or ewr tool. Please report any bugs to the issues tab under the GitHub project so we can investigate further.
274
-
277
+ Every effort has been taken to ensure the ewr database represents the original EWRs from state Long Term Water Plans (LTWPs), Environmental Water Management Plans (EWMPs), Flows studies, and those derived through expert elicitation processes as best as possible. The code within this tool has been developed to interpret and analyse these EWRs in an accurate way. However, there may still be unresolved bugs in the ewr parameter sheet and/or ewr tool. Please report any bugs to the issues tab under the GitHub project so we can investigate further.
275
278
 
276
279
  **Notes on development of the dataset of EWRs**
277
- The MDBA has worked with Basin state representatives to ensure scientific integrity of EWRs has been maintained when translating from raw EWRs in the Basin state LTWPs and EWMPs to the machine readable format found in the parameter sheet within this tool.
280
+ The MDBA has worked with Basin state representatives to ensure scientific integrity of EWRs has been maintained when translating from raw EWRs in the Basin state LTWPs, EWMPs, Flows studies, and those derived through expert elicitation processes to the machine readable format found in the parameter sheet within this tool.
278
281
 
279
- Environmental Water Requirements (EWRs) in the tool are subject to change when the relevant documents including Long Term Water Plans (LTWPs) and Environmental Water Management Plans (EWMPs) are updated or move from draft to final versions. LTWPs that are currently in draft form include the ACT and the upper Murrumbidgee section of the NSW Murrumbidgee LTWP.
282
+ Environmental Water Requirements (EWRs) in the tool are subject to change when the relevant documents including Long Term Water Plans (LTWPs), Environmental Water Management Plans (EWMPs), Flows studies, and those derived through expert elicitation processes are updated or move from draft to final versions. LTWPs that are currently in draft form include the upper Murrumbidgee section of the NSW Murrumbidgee LTWP, and the SA LTWP.
280
283
 
281
284
  **Compatibility**
282
285
 
283
286
  - All Queensland catchments
284
287
  - All New South Wales catchments
285
288
  - All South Australian catchments
286
- - All EWRs from river based Environmental Water Management Plans (EWMPs) in Victoria*
287
- - All EWRs for ACT (draft version)
288
-
289
- *The wetland EWMPS and mixed wetland-river EWMPs in Victoria are in progress. The MDBA will work with our Victorian colleagues to ensure any updated EWRs in these plans are integrated into the tool where possible.
289
+ - Where possible all EWRs from Environmental Water Management Plans (EWMPs) and Flows studies in Victoria
290
290
 
291
291
  **Input data**
292
292
 
@@ -294,14 +294,14 @@ Environmental Water Requirements (EWRs) in the tool are subject to change when t
294
294
  - Scenario data input by the user
295
295
  - Model metadata for location association between gauge ID's and model nodes
296
296
  #### optional
297
- - ewr parameter sheet
298
- - calc_config.json
297
+ - parameter sheet
298
+ - ewr_calc_config.json
299
299
 
300
300
  **Objective mapping**
301
301
  The objective mapping is located in the EWR tool package. This is intended to be used to link EWRs to the detailed objectives, theme level targets and specific goals. The objective reference file is located in the py_ewr/parameter_metadata folder:
302
302
 
303
- parameter_sheet.csv (EnvObj column)
304
- obj_reference.csv
303
+ parameter_sheet.csv (EcoObj column)
304
+ objective_reference.csv
305
305
 
306
- Contains the individual environmnetal objectives listed in the 'EnvObj' column of the parameter sheet and their ecological targets (Target) and plain english description of objectives (Objectives) for each planning unit, long term water plan (LTWPShortName), and surface water sustainable diversion limit (SWSDLName).
307
- the function ```get_obj_mapping()``` is available to automatically merge the information from obj_reference.csv with the parameter sheet to link these objectives with their specific ewr_codes.
306
+ Contains the individual ecological objectives listed in the 'EcoObj' column of the parameter sheet and their ecological targets (Target) and plain english description of objectives (Objective) for each planning unit, long term water plan (LTWPShortName), surface water sustainable diversion limit region (SWSDLName), and Basin State (State)
307
+ the function ```get_obj_mapping()``` is available to automatically merge the information from objective_reference.csv with the parameter sheet to link these objectives with their specific ewr_codes.
@@ -0,0 +1,19 @@
1
+ py_ewr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ py_ewr/data_inputs.py,sha256=VxJD5JYPFteRMKDYzUU8GJes8SBlXKrtJgFiArWbieY,28742
3
+ py_ewr/evaluate_EWRs.py,sha256=C-OPyuf3TO643_oyV_LnplXK2WAWw7A73MGixlVszlo,199623
4
+ py_ewr/io.py,sha256=Is0xPAzLx6-ylpTFyYJxMimkNVxxoTxUcknTk6bQbgs,840
5
+ py_ewr/observed_handling.py,sha256=v6B9R7uzvOlMV-QMwpTyxf7stdlQ0KXqpVZnPfiTyZc,18861
6
+ py_ewr/scenario_handling.py,sha256=gZIptfSbPSEnxWAaByTatjamGjDx0hAFACmTXr7wjNY,54216
7
+ py_ewr/summarise_results.py,sha256=ckYm3qwmVZmmfV-vJcCjHj4_rVX1TamtoXwH4TsrafE,31594
8
+ py_ewr/model_metadata/EWR_Sitelist_FIRM_20250718.csv,sha256=9TVrlvIZvBw1QcyOpVWjhX4ABg-fUTqg4Wo7Eo3px9E,14562
9
+ py_ewr/model_metadata/SiteID_MDBA.csv,sha256=-nPEWzqW60HBh3y7u8Ofiq8aYTyZqhQ-8eakuDVdUg4,168770
10
+ py_ewr/model_metadata/SiteID_NSW.csv,sha256=UVBxN43Z5KWCvWhQ5Rh6TNEn35q4_sjPxKyHg8wPFws,6805
11
+ py_ewr/model_metadata/iqqm_stations.csv,sha256=vl4CPtPslG5VplSzf_yLZulTrmab-mEBHOfzFtS1kf4,110
12
+ py_ewr/parameter_metadata/ewr_calc_config.json,sha256=ODvwdld-fGi_3qMrVlWVyJKs5kFk5cRUwciByVp9A1c,20172
13
+ py_ewr/parameter_metadata/objective_reference.csv,sha256=2_ya0ONmn-wkQ4c_Y9lh5QBC4gXGFwhiPNB8oi02Sco,170600
14
+ py_ewr/parameter_metadata/parameter_sheet.csv,sha256=2PoCZ9CvO475MHO6CybM6TXSxC8orWjFu1xcmuKGOag,899891
15
+ py_ewr-2.4.0.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
16
+ py_ewr-2.4.0.dist-info/METADATA,sha256=dszweC7ba6lg-Q_WYB6Tg7RhsLT7H9svFLZXwymlSRU,14665
17
+ py_ewr-2.4.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
18
+ py_ewr-2.4.0.dist-info/top_level.txt,sha256=n3725d-64Cjyb-YMUMV64UAuIflzUh2_UZSxiIbrur4,7
19
+ py_ewr-2.4.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5