mpcaHydro 2.0.2__py3-none-any.whl → 2.0.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.
mpcaHydro/data_manager.py
CHANGED
|
@@ -85,6 +85,26 @@ def construct_database(folderpath):
|
|
|
85
85
|
con.execute(query,[datafiles])
|
|
86
86
|
|
|
87
87
|
|
|
88
|
+
def constituent_summary(db_path):
|
|
89
|
+
with duckdb.connect(db_path) as con:
|
|
90
|
+
query = '''
|
|
91
|
+
SELECT
|
|
92
|
+
station_id,
|
|
93
|
+
source,
|
|
94
|
+
constituent,
|
|
95
|
+
COUNT(*) AS sample_count,
|
|
96
|
+
year(MIN(datetime)) AS start_date,
|
|
97
|
+
year(MAX(datetime)) AS end_date
|
|
98
|
+
FROM
|
|
99
|
+
observations
|
|
100
|
+
GROUP BY
|
|
101
|
+
constituent, station_id,source
|
|
102
|
+
ORDER BY
|
|
103
|
+
sample_count;'''
|
|
104
|
+
|
|
105
|
+
res = con.execute(query)
|
|
106
|
+
return res.fetch_df()
|
|
107
|
+
|
|
88
108
|
|
|
89
109
|
class dataManager():
|
|
90
110
|
|
|
@@ -94,7 +114,10 @@ class dataManager():
|
|
|
94
114
|
self.folderpath = Path(folderpath)
|
|
95
115
|
self.db_path = self.folderpath.joinpath('observations.duckdb')
|
|
96
116
|
|
|
97
|
-
|
|
117
|
+
def _reconstruct_database(self):
|
|
118
|
+
construct_database(self.folderpath)
|
|
119
|
+
|
|
120
|
+
|
|
98
121
|
def constituent_summary(self,constituents = None):
|
|
99
122
|
with duckdb.connect(self.db_path) as con:
|
|
100
123
|
if constituents is None:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
mpcaHydro/WISKI.py,sha256=yqsljbx8TlFA8HIrXFGs5meO0RcTis5Px3__UUzrtiI,13303
|
|
2
2
|
mpcaHydro/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
mpcaHydro/data_manager.py,sha256=
|
|
3
|
+
mpcaHydro/data_manager.py,sha256=UR4mE93eUUXXs74qnJCFstNt_z0yaX1IB8USD4-XkTc,15396
|
|
4
4
|
mpcaHydro/etlCSG.py,sha256=5QT6V2dHvNKC9r5-dspt-NpOmECP2LFw1Lyq1zdkqps,2630
|
|
5
5
|
mpcaHydro/etlSWD.py,sha256=FnpFv-LjK2zAvI2-wrN_4YaS70bI1AGi-aX5lEevkrc,7509
|
|
6
6
|
mpcaHydro/etlWISKI.py,sha256=6I1uTJfM-yL_hY0q-X0JKFqz9DVDaFR7wt4ssmjbcEU,19645
|
|
7
7
|
mpcaHydro/etlWPLMN.py,sha256=b44xvx4s7lwXhpRtfR6rj7RnBpbVKXaYqZCr26BexUI,4160
|
|
8
8
|
mpcaHydro/data/WISKI_EQUIS_XREF.csv,sha256=bPYq-f4-Qc6jsvUgl81lwXBeFamfDe5TjohqUV1XJlg,1244704
|
|
9
|
-
mpcahydro-2.0.
|
|
10
|
-
mpcahydro-2.0.
|
|
11
|
-
mpcahydro-2.0.
|
|
9
|
+
mpcahydro-2.0.3.dist-info/METADATA,sha256=FKpSp78k6axfes_kk4NL_-VdsyuSKeGRla3ZC5lxY8M,543
|
|
10
|
+
mpcahydro-2.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
mpcahydro-2.0.3.dist-info/RECORD,,
|
|
File without changes
|