py-ewr 2.3.1__py3-none-any.whl → 2.3.3__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/evaluate_EWRs.py CHANGED
@@ -1150,31 +1150,34 @@ def barrage_level_handle(PU: str, gauge: str, EWR: str, EWR_table: pd.DataFrame,
1150
1150
  """
1151
1151
  barrage_level_gauges = data_inputs.get_barrage_level_gauges()
1152
1152
  all_required_gauges = barrage_level_gauges.get(gauge)
1153
+ # if all_required_gauges:
1154
+ # all_required_gauges_in_df_L = all(gauge in df_L.columns for gauge in all_required_gauges)
1153
1155
  if all_required_gauges:
1154
- all_required_gauges_in_df_L = all(gauge in df_L.columns for gauge in all_required_gauges)
1155
- # check if current gauge is the main barrage gauge
1156
- if all_required_gauges_in_df_L:
1157
- pull = data_inputs.get_EWR_components('barrage-level')
1158
- EWR_info = get_EWRs(PU, gauge, EWR, EWR_table, pull)
1159
- masked_dates = mask_dates(EWR_info, df_L)
1160
- # Extract a daily timeseries for water years:
1161
- water_years = wateryear_daily(df_L, EWR_info)
1162
- # If there is no level data loaded in, let user know and skip the analysis
1163
- df = df_L.copy(deep=True)
1164
- # calculate 5 day moving average and average of all required gauges
1165
- df_5_day_averages = calculate_n_day_moving_average(df,5)
1166
- df_5_day_averages['mean'] = df[all_required_gauges].mean(axis=1)
1167
- cllmm_type = what_cllmm_type(EWR_info)
1168
- if cllmm_type == 'c':
1169
- E, D = lower_lakes_level_calc(EWR_info, df_5_day_averages['mean'], water_years, df_L.index, masked_dates)
1170
- if cllmm_type == 'd':
1171
- E, D = coorong_level_calc(EWR_info, df_5_day_averages['mean'], water_years, df_L.index, masked_dates)
1156
+ all_required_gauges_in_df_L = [gauge for gauge in all_required_gauges if gauge in df_L.columns]
1157
+ #NOTE as all_required_gauges_in_df_L is boolean, the indexing is stil including all gauges in all_required_gauges.
1158
+ # directly subset and use all_required_gauges_in_df_L as the new list.
1159
+ if all_required_gauges_in_df_L:
1160
+ pull = data_inputs.get_EWR_components('barrage-level')
1161
+ EWR_info = get_EWRs(PU, gauge, EWR, EWR_table, pull)
1162
+ masked_dates = mask_dates(EWR_info, df_L)
1163
+ # Extract a daily timeseries for water years:
1164
+ water_years = wateryear_daily(df_L, EWR_info)
1165
+ # If there is no level data loaded in, let user know and skip the analysis
1166
+ df = df_L.copy(deep=True)
1167
+ # calculate 5 day moving average and average of all required gauges
1168
+ df_5_day_averages = calculate_n_day_moving_average(df,5)
1169
+ df_5_day_averages['mean'] = df[all_required_gauges_in_df_L].mean(axis=1)
1170
+ cllmm_type = what_cllmm_type(EWR_info)
1171
+ if cllmm_type == 'c':
1172
+ E, D = lower_lakes_level_calc(EWR_info, df_5_day_averages['mean'], water_years, df_L.index, masked_dates)
1173
+ if cllmm_type == 'd':
1174
+ E, D = coorong_level_calc(EWR_info, df_5_day_averages['mean'], water_years, df_L.index, masked_dates)
1172
1175
 
1173
1176
  PU_df = event_stats(df_L, PU_df, gauge, EWR, EWR_info, E, D, water_years)
1174
1177
  return PU_df, tuple([E])
1175
1178
 
1176
1179
  else:
1177
- print(f'skipping calculation because gauge {" ".join(all_required_gauges)} is not the main barrage level gauge ')
1180
+ print(f'skipping calculation because gauge {" ".join(all_required_gauges)} is not the main barrage level gauge ') #TODO: improve error message
1178
1181
  return PU_df, None
1179
1182
 
1180
1183
  def rise_and_fall_handle(PU: str, gauge: str, EWR: str, EWR_table: pd.DataFrame, df_F: pd.DataFrame, df_L: pd.DataFrame, PU_df: pd.DataFrame) -> tuple:
@@ -1347,6 +1347,7 @@ LOCK7US,River Murray U/S Lock 7,,426508,5
1347
1347
  LOCK7US,River Murray U/S Lock 7,,A4260508,5
1348
1348
  LOCK8DS,River Murray D/S Lock 8,,4260507,5
1349
1349
  LOCK8US,River Murray U/S Lock 8,,426506,5
1350
+ LOCK8US,River Murray U/S Lock 8,,A426506,5
1350
1351
  LOCK9DS,River Murray D/S Lock 9,,4260505,5
1351
1352
  LOCK 9 ,River Murray U/S Lock 9,SAMPLE AT GAUGING STATION,A4260501,5
1352
1353
  LOCK9US,River Murray U/S Lock 9,SAMPLE AT GAUGING STATION,A4260501,5
@@ -2695,7 +2696,9 @@ Pattos Pipe,Pattos Pipe,North Redbank,Pattos Pipe,2
2695
2696
  Pump direct from river,Pump direct from river,"North Redbank, pumped direct from river",Pump direct from river,2
2696
2697
  Pumped from Yanga Lake,Pumped from Yanga Lake,Yanga (South Redbank),Pumped from Yanga Lake,2
2697
2698
  410738,Murrumbidgee River at Mt. MacDonald,"ACT - Environment, Planning and Sustainable Development Directorate",410738,3
2699
+ 11UBMAC,Murrumbidgee River at Mt. MacDonald,"ACT - Environment, Planning and Sustainable Development Directorate",410738,3
2698
2700
  410761,Murrumbidgee River below Lobbs Hole Creek,"ACT - Environment, Planning and Sustainable Development Directorate",410761,3
2701
+ 11UBLOB,Murrumbidgee River below Lobbs Hole Creek,"ACT - Environment, Planning and Sustainable Development Directorate",410761,3
2699
2702
  410700,Cotter River at Kiosk,ACT - Icon Water Limited,410700,3
2700
2703
  410747,Cotter River below Bendora Dam,ACT - Icon Water Limited,410747,3
2701
2704
  410752,Cotter River below Corin Dam,ACT - Icon Water Limited,410752,3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py_ewr
3
- Version: 2.3.1
3
+ Version: 2.3.3
4
4
  Summary: Environmental Water Requirement calculator
5
5
  Home-page: https://github.com/MDBAuth/EWR_tool
6
6
  Author: Martin Job
@@ -34,9 +34,10 @@ Requires-Dist: numpy<2
34
34
  [![PyPI](https://img.shields.io/pypi/v/py-ewr)](https://pypi.org/project/py-ewr/)
35
35
  [![DOI](https://zenodo.org/badge/342122359.svg)](https://zenodo.org/badge/latestdoi/342122359)
36
36
 
37
- ### **EWR tool version 2.3.1 README**
37
+ ### **EWR tool version 2.3.3 README**
38
38
 
39
39
  ### **Notes on recent version updates**
40
+ - CLLMM_c and CLLMM_d ewrs are now able to be calculated without all barrage level gauges being present in the model file.
40
41
  - Including draft objective mapping files in the package (see below sub heading **Objective mapping** for more information). Objective mapping has been therefore pulled out of the parameter sheet
41
42
  - Including an example parallel processing script for running the EWR tool
42
43
  - Adding handling for cases where there are single MDBA bigmod site IDs mapping to multiple different gauges
@@ -1,11 +1,11 @@
1
1
  py_ewr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  py_ewr/data_inputs.py,sha256=oUiEiLY_CmbvqF5GlV-3Yfz_JZ1qZNvta-VEYCzAcso,20124
3
- py_ewr/evaluate_EWRs.py,sha256=bAhFZTQZkoAE2eKgNIomm1LJdZ2HihoygUnXybtEdm4,231326
3
+ py_ewr/evaluate_EWRs.py,sha256=pCIqWysUuM-HbYn6U9bQnrHMhTl2CVhjWanpGJ6l0pc,231584
4
4
  py_ewr/io.py,sha256=Is0xPAzLx6-ylpTFyYJxMimkNVxxoTxUcknTk6bQbgs,840
5
5
  py_ewr/observed_handling.py,sha256=JTSK_2obhqNWJ2QknykywevNMN0fsvGXSejFwUSpMoA,18112
6
6
  py_ewr/scenario_handling.py,sha256=veaiQ6vfQX40laUk3eEUFWqO3wceP76Wh92HhJFsl8A,35762
7
7
  py_ewr/summarise_results.py,sha256=rFaAUVR4jIsjeRl4ocPFE2RUoJJBZgZ2wPEBh-dfEsc,31761
8
- py_ewr/model_metadata/SiteID_MDBA.csv,sha256=QDIW21IFX1MYxDvs6Aja-OOUBhgnNa8l-NnCpQMmBl4,168430
8
+ py_ewr/model_metadata/SiteID_MDBA.csv,sha256=1g1PtqDNXl-8B-BGBd6BhUZfD2ZobftEjq97E5PNwkQ,168728
9
9
  py_ewr/model_metadata/SiteID_NSW.csv,sha256=UVBxN43Z5KWCvWhQ5Rh6TNEn35q4_sjPxKyHg8wPFws,6805
10
10
  py_ewr/model_metadata/iqqm_stations.csv,sha256=vl4CPtPslG5VplSzf_yLZulTrmab-mEBHOfzFtS1kf4,110
11
11
  py_ewr/parameter_metadata/ewr2obj.csv,sha256=r2uXzhZ-Rd1u3RLhNXmJnPYcHwouHBehEPnvednfz-I,3948677
@@ -13,8 +13,8 @@ py_ewr/parameter_metadata/ewr_calc_config.json,sha256=l1AgIRlf7UUmk3BNQ4r3kutU48
13
13
  py_ewr/parameter_metadata/obj2target.csv,sha256=f6kLVyBhXUpGR4b0dzLbBvZbfpn3OxOhaB4aouO6Bvw,1593877
14
14
  py_ewr/parameter_metadata/obj2yrtarget.csv,sha256=G8XgdCrOpB0xhp6n7DIS4Vcq69Kpgb1Pum7Ay3a_YPU,54882
15
15
  py_ewr/parameter_metadata/parameter_sheet.csv,sha256=MxKE-649bIC6HGqh87MT_fR3Lmew8n10Oi6OsAF1N0Q,768524
16
- py_ewr-2.3.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
17
- py_ewr-2.3.1.dist-info/METADATA,sha256=QAW_W9RLEq6SXwpl68WRObU7cEUq_MCpygk8cDkAFtQ,12585
18
- py_ewr-2.3.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
19
- py_ewr-2.3.1.dist-info/top_level.txt,sha256=n3725d-64Cjyb-YMUMV64UAuIflzUh2_UZSxiIbrur4,7
20
- py_ewr-2.3.1.dist-info/RECORD,,
16
+ py_ewr-2.3.3.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
17
+ py_ewr-2.3.3.dist-info/METADATA,sha256=S6B3jls9O5zaR0E8__GRzvcTToKrpqeSh6QgKSCWop0,12709
18
+ py_ewr-2.3.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
19
+ py_ewr-2.3.3.dist-info/top_level.txt,sha256=n3725d-64Cjyb-YMUMV64UAuIflzUh2_UZSxiIbrur4,7
20
+ py_ewr-2.3.3.dist-info/RECORD,,
File without changes