py-ewr 2.2.1__py3-none-any.whl → 2.2.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 +1 -4
- py_ewr/observed_handling.py +0 -1
- py_ewr/scenario_handling.py +16 -9
- {py_ewr-2.2.1.dist-info → py_ewr-2.2.3.dist-info}/METADATA +4 -3
- {py_ewr-2.2.1.dist-info → py_ewr-2.2.3.dist-info}/RECORD +8 -8
- {py_ewr-2.2.1.dist-info → py_ewr-2.2.3.dist-info}/LICENSE +0 -0
- {py_ewr-2.2.1.dist-info → py_ewr-2.2.3.dist-info}/WHEEL +0 -0
- {py_ewr-2.2.1.dist-info → py_ewr-2.2.3.dist-info}/top_level.txt +0 -0
py_ewr/evaluate_EWRs.py
CHANGED
|
@@ -10,7 +10,6 @@ import logging
|
|
|
10
10
|
|
|
11
11
|
import pandas as pd
|
|
12
12
|
import numpy as np
|
|
13
|
-
from tqdm import tqdm
|
|
14
13
|
|
|
15
14
|
from . import data_inputs
|
|
16
15
|
|
|
@@ -5086,9 +5085,7 @@ def calc_sorter(df_F:pd.DataFrame, df_L:pd.DataFrame, gauge:str, EWR_table:pd.Da
|
|
|
5086
5085
|
EWR_codes = PU_table['Code']
|
|
5087
5086
|
PU_df = pd.DataFrame()
|
|
5088
5087
|
PU_events = {}
|
|
5089
|
-
for i, EWR in enumerate(
|
|
5090
|
-
bar_format='{l_bar}{bar:10}{r_bar}{bar:-10b}',
|
|
5091
|
-
desc= str('Evaluating ewrs for '+ gauge))):
|
|
5088
|
+
for i, EWR in enumerate(EWR_codes):
|
|
5092
5089
|
events = {}
|
|
5093
5090
|
|
|
5094
5091
|
MULTIGAUGE = is_multigauge(EWR_table, gauge, EWR, PU)
|
py_ewr/observed_handling.py
CHANGED
py_ewr/scenario_handling.py
CHANGED
|
@@ -7,7 +7,6 @@ from datetime import datetime, date
|
|
|
7
7
|
import logging
|
|
8
8
|
|
|
9
9
|
import pandas as pd
|
|
10
|
-
from tqdm import tqdm
|
|
11
10
|
import xarray as xr
|
|
12
11
|
import netCDF4
|
|
13
12
|
|
|
@@ -437,6 +436,8 @@ def extract_gauge_from_string(input_string: str) -> str:
|
|
|
437
436
|
gauge = input_string.split('_')[0]
|
|
438
437
|
return gauge
|
|
439
438
|
|
|
439
|
+
|
|
440
|
+
|
|
440
441
|
def match_MDBA_nodes(input_df: pd.DataFrame, model_metadata: pd.DataFrame, ewr_table_path: str) -> tuple:
|
|
441
442
|
'''Checks if the source file columns have EWRs available, returns a flow and level dataframe with only
|
|
442
443
|
the columns with EWRs available. Renames columns to gauges
|
|
@@ -461,11 +462,19 @@ def match_MDBA_nodes(input_df: pd.DataFrame, model_metadata: pd.DataFrame, ewr_t
|
|
|
461
462
|
measure = col_clean.split('-')[1]
|
|
462
463
|
if ((measure in measurands) and (model_metadata['SITEID'] == site).any()):
|
|
463
464
|
subset = model_metadata.query("SITEID==@site")
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
for iset in range(len(subset)):
|
|
466
|
+
gauge = subset["AWRC"].iloc[iset]
|
|
467
|
+
if gauge in flow_gauges and measure == '1':
|
|
468
|
+
df_flow[gauge] = input_df[col]
|
|
469
|
+
if gauge in level_gauges and measure == '35':
|
|
470
|
+
aa=input_df[[col]]
|
|
471
|
+
if (len(aa.columns)>1):
|
|
472
|
+
print('More than one site has been identified, the first site is used')
|
|
473
|
+
print('Site info: ', col)
|
|
474
|
+
df_level[gauge] = aa.iloc[:,0]
|
|
475
|
+
else:
|
|
476
|
+
df_level[gauge] = input_df[col]
|
|
477
|
+
|
|
469
478
|
if df_flow.empty:
|
|
470
479
|
raise ValueError('No relevant gauges and or measurands found in dataset, the EWR tool cannot evaluate this model output file')
|
|
471
480
|
return df_flow, df_level
|
|
@@ -538,9 +547,7 @@ class ScenarioHandler:
|
|
|
538
547
|
# Analyse all scenarios for EWRs
|
|
539
548
|
detailed_results = {}
|
|
540
549
|
detailed_events = {}
|
|
541
|
-
for scenario in
|
|
542
|
-
bar_format='{l_bar}{bar:10}{r_bar}{bar:-10b}',
|
|
543
|
-
desc= 'Evaluating scenarios'):
|
|
550
|
+
for scenario in scenarios:
|
|
544
551
|
if self.model_format == 'Bigmod - MDBA':
|
|
545
552
|
|
|
546
553
|
data, header = unpack_model_file(scenarios[scenario], 'Dy', 'Field')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: py_ewr
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: Environmental Water Requirement calculator
|
|
5
5
|
Home-page: https://github.com/MDBAuth/EWR_tool
|
|
6
6
|
Author: Martin Job
|
|
@@ -23,7 +23,6 @@ Requires-Dist: ipython ==8.8.0
|
|
|
23
23
|
Requires-Dist: ipywidgets ==7.7.0
|
|
24
24
|
Requires-Dist: pandas ==2.0.3
|
|
25
25
|
Requires-Dist: requests ==2.25.1
|
|
26
|
-
Requires-Dist: tqdm >=4.66.1
|
|
27
26
|
Requires-Dist: mdba-gauge-getter ==0.5.1
|
|
28
27
|
Requires-Dist: cachetools ==5.2.0
|
|
29
28
|
Requires-Dist: xarray ==2023.01.0
|
|
@@ -35,9 +34,11 @@ Requires-Dist: numpy <2
|
|
|
35
34
|
[](https://pypi.org/project/py-ewr/)
|
|
36
35
|
[](https://zenodo.org/badge/latestdoi/342122359)
|
|
37
36
|
|
|
38
|
-
### **EWR tool version 2.2.
|
|
37
|
+
### **EWR tool version 2.2.3 README**
|
|
39
38
|
|
|
40
39
|
### **Notes on recent version update**
|
|
40
|
+
- Remove TQDM loading bars
|
|
41
|
+
- Handle duplicate sites in MDBA siteID file - where a duplicate exists, the first match is used and the rest are skipped over
|
|
41
42
|
- Adding new model format handling - 'IQQM - netcdf'
|
|
42
43
|
- Standard time-series handling added - each column needs a gauge, followed by and underscore, followed by either flow or level (e.g. 409025_flow). This handling also has missing date filling - so any missing dates will be filled with NaN values in all columns.
|
|
43
44
|
- ten thousand year handling - This has been briefly taken offline for this version.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
py_ewr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
py_ewr/data_inputs.py,sha256=SmY92Xq7oAzkHsJgxncVzC1C9YqnLpDAbVadBF0nS7k,18440
|
|
3
|
-
py_ewr/evaluate_EWRs.py,sha256=
|
|
3
|
+
py_ewr/evaluate_EWRs.py,sha256=Ss4sXRIiPpj9txrJ9IdJb6OpzzTJzKzXB1qcxzeR1UE,229059
|
|
4
4
|
py_ewr/io.py,sha256=Is0xPAzLx6-ylpTFyYJxMimkNVxxoTxUcknTk6bQbgs,840
|
|
5
|
-
py_ewr/observed_handling.py,sha256=
|
|
6
|
-
py_ewr/scenario_handling.py,sha256=
|
|
5
|
+
py_ewr/observed_handling.py,sha256=j4M3YUcncS1hhVR7OIB0C_XuRW09koKHrAL4n0l_yAY,17871
|
|
6
|
+
py_ewr/scenario_handling.py,sha256=1H9EY94PJGitOyhiaIHzgGt5FN1ztJxUV2-LYBGiSic,32636
|
|
7
7
|
py_ewr/summarise_results.py,sha256=7w2Tbriwob21UXG0N2rSKffneg3M49hWouJPTHVjDAU,29747
|
|
8
8
|
py_ewr/model_metadata/SiteID_MDBA.csv,sha256=DcwFmBBoLmv1lGik40IwTMSjSBPaDsTt8Nluh2s7wjM,183665
|
|
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/ewr_calc_config.json,sha256=l1AgIRlf7UUmk3BNQ4r3kutU48pYHHVKmLELjoB-8rQ,17664
|
|
12
12
|
py_ewr/parameter_metadata/parameter_sheet.csv,sha256=IiYAvf0hG9fchuwqtfDZhI8WSPB5jgaaaJ0MLwfPYAw,899556
|
|
13
|
-
py_ewr-2.2.
|
|
14
|
-
py_ewr-2.2.
|
|
15
|
-
py_ewr-2.2.
|
|
16
|
-
py_ewr-2.2.
|
|
17
|
-
py_ewr-2.2.
|
|
13
|
+
py_ewr-2.2.3.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
|
|
14
|
+
py_ewr-2.2.3.dist-info/METADATA,sha256=aErpD5tvpcNUARzcX6b0HvNczeN3dOeTDnphfmS12nA,10174
|
|
15
|
+
py_ewr-2.2.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
16
|
+
py_ewr-2.2.3.dist-info/top_level.txt,sha256=n3725d-64Cjyb-YMUMV64UAuIflzUh2_UZSxiIbrur4,7
|
|
17
|
+
py_ewr-2.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|