TempEst-NEXT 0.2.0__tar.gz → 0.2.1__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 (20) hide show
  1. {tempest_next-0.2.0/src/TempEst_NEXT.egg-info → tempest_next-0.2.1}/PKG-INFO +1 -1
  2. {tempest_next-0.2.0 → tempest_next-0.2.1}/setup.cfg +1 -1
  3. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/coef_est.py +38 -38
  4. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/interactive.py +5 -2
  5. {tempest_next-0.2.0 → tempest_next-0.2.1/src/TempEst_NEXT.egg-info}/PKG-INFO +1 -1
  6. {tempest_next-0.2.0 → tempest_next-0.2.1}/LICENSE +0 -0
  7. {tempest_next-0.2.0 → tempest_next-0.2.1}/README.md +0 -0
  8. {tempest_next-0.2.0 → tempest_next-0.2.1}/pyproject.toml +0 -0
  9. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/__init__.py +0 -0
  10. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/__main__.py +0 -0
  11. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/data.py +0 -0
  12. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/datatools.py +0 -0
  13. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/model_manager.py +0 -0
  14. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/reach_prep.py +0 -0
  15. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/NEXT/wforecast.py +0 -0
  16. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/TempEst_NEXT.egg-info/SOURCES.txt +0 -0
  17. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/TempEst_NEXT.egg-info/dependency_links.txt +0 -0
  18. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/TempEst_NEXT.egg-info/entry_points.txt +0 -0
  19. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/TempEst_NEXT.egg-info/requires.txt +0 -0
  20. {tempest_next-0.2.0 → tempest_next-0.2.1}/src/TempEst_NEXT.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TempEst-NEXT
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: TempEst-NEXT, Stream Temperature Estimation - Near-term Expected Temperatures: a statistical stream temperature model with coefficient estimation for ungaged watersheds
5
5
  Home-page: https://rivertempest.org/next/readme.html
6
6
  Author: Daniel Philippus
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = TempEst-NEXT
3
- version = 0.2.0
3
+ version = 0.2.1
4
4
  author = Daniel Philippus
5
5
  author_email = daniel@dphilippus.com
6
6
  description = TempEst-NEXT, Stream Temperature Estimation - Near-term Expected Temperatures: a statistical stream temperature model with coefficient estimation for ungaged watersheds
@@ -56,52 +56,52 @@ def preprocess(data, allow_no_id=True):
56
56
  return predictors
57
57
 
58
58
  var_sets = [
59
- {"name": "PCA0", "vars": ['tmax', 'prcp', 'vp', 'slope', 'wetland', 'developed', 'water', 'snowfrac', 'vp_sd', 'tmax_phi', 'elev', 'elev_min', 'frozen', 'tmax_index', 'canopy', 'ws_canopy'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + s(8) + s(9) + te(10, 11) + te(12, 13) + te(14, 15), "lam": 95, "noise": 0.763, "scale": 1.17},
60
- {"name": "PCA1", "vars": ['tmax', 'area', 'wetland', 'water', 'snowfrac', 'vp_sd', 'tmax_phi', 'elev', 'ws_canopy', 'frozen', 'tmax_index'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + s(8) + te(9, 10), "lam": 33, "noise": 0.789, "scale": 1.43},
61
- {"name": "PCA2", "vars": ['tmax', 'vp', 'ice_snow', 'snowfrac', 'elev', 'frozen', 'tmax_index', 'canopy', 'ws_canopy'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + te(5, 6) + te(7, 8), "lam": 120, "noise": 0.722, "scale": 1.94},
62
- {"name": "PCA3", "vars": ['tmax', 'prcp', 'vp', 'slope', 'wetland', 'ice_snow', 'water', 'snowfrac', 'vp_sd', 'prcp_index', 'tmax_phi', 'elev_min', 'tmax_index', 'canopy', 'ws_canopy'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + s(8) + s(9) + s(10) + s(11) + s(12) + te(13, 14), "lam": 300, "noise": 0.649, "scale": 1.81},
63
- {"name": "PCA4", "vars": ['tmax', 'water', 'vp_sd', 'prcp_phi', 'prcp_index', 'tmax_phi', 'elev', 'elev_min', 'frozen', 'tmax_index', 'canopy', 'ws_canopy'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + te(6, 7) + te(8, 9) + te(10, 11), "lam": 100, "noise": 0.374, "scale": 1.18},
64
- {"name": "PCA5", "vars": ['tmax', 'prcp', 'vp', 'area', 'slope', 'wetland', 'developed', 'ice_snow', 'water', 'snowfrac', 'vp_sd', 'prcp_phi', 'prcp_index', 'tmax_phi', 'frozen', 'elev', 'elev_min', 'canopy', 'ws_canopy'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + s(8) + s(9) + s(10) + s(11) + s(12) + s(13) + s(14) + te(15, 16) + te(17, 18), "lam": 900, "noise": 0.498, "scale": 1.89},
59
+ {"name": "PCA0", "vars": ['tmax', 'prcp', 'vp', 'ice_snow', 'water', 'snowfrac', 'vp_sd', 'prcp_index', 'tmax_phi', 'elev', 'frozen', 'tmax_index', 'canopy', 'ws_canopy'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + s(8) + s(9) + te(10, 11) + te(12, 13), "lam": 30, "noise": 0.818, "scale": 1.19},
60
+ {"name": "PCA1", "vars": ['tmax', 'prcp', 'vp', 'vp_sd', 'prcp_index', 'tmax_phi', 'elev_min', 'frozen', 'tmax_index'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + te(7, 8), "lam": 3, "noise": 0.501, "scale": 1.13},
61
+ {"name": "PCA2", "vars": ['tmax', 'prcp', 'wetland', 'water', 'snowfrac', 'vp_sd', 'prcp_index', 'tmax_phi', 'elev', 'ws_canopy', 'frozen', 'tmax_index'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + s(8) + s(9) + te(10, 11), "lam": 21, "noise": 0.622, "scale": 1.45},
62
+ {"name": "PCA3", "vars": ['tmax', 'ice_snow', 'snowfrac', 'tmax_index', 'elev_min', 'canopy', 'ws_canopy'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + te(5, 6), "lam": 4, "noise": 0.555, "scale": 1.52},
63
+ {"name": "PCA4", "vars": ['tmax', 'prcp', 'vp', 'area', 'wetland', 'snowfrac', 'vp_sd', 'tmax_index', 'elev', 'elev_min'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + te(8, 9), "lam": 30, "noise": 0.601, "scale": 1.86},
64
+ {"name": "PCA5", "vars": ['tmax', 'vp', 'area', 'vp_sd', 'prcp_phi', 'tmax_phi', 'elev_min', 'ws_canopy', 'frozen', 'tmax_index'], "eq": s(0) + s(1) + s(2) + s(3) + s(4) + s(5) + s(6) + s(7) + te(8, 9), "lam": 3, "noise": 0.248, "scale": 1.28},
65
65
  ]
66
66
 
67
67
  coef_names = ["PCA" + str(i) for i in range(9)]
68
68
  col_order = ['Intercept', 'Amplitude', 'FallDay', 'WinterDay', 'SpringDay',
69
69
  'SummerDay', 'SpringSummer', 'FallWinter', 'at_coef']
70
- offset = pd.Series([ 12.74728664, 8.88411531, 326.74835165, 70.17814877,
71
- 154.06593407, 217.67912088, 0.73641769, 1.39860397,
72
- 0.60761769],
70
+ offset = pd.Series([ 13.0056967 , 8.20795656, 326.31318681, 74.14044198,
71
+ 156.8 , 214.73186813, 0.58916219, 1.84876426,
72
+ 0.72359814],
73
73
  index=col_order)
74
- scale = pd.Series([ 3.99956942, 2.72834273, 1. , 24.9749798 , 1. ,
75
- 1. , 0.95228087, 0.92086495, 0.16206394],
74
+ scale = pd.Series([ 3.99160561, 3.43586619, 1. , 25.38558154, 1. ,
75
+ 1. , 1.20308955, 1.52486907, 0.50466527],
76
76
  index=col_order)
77
77
 
78
- pca_components = np.array([[ 4.75273148e-01, 3.53017223e-01, -0.00000000e+00,
79
- 3.89964302e-01, 4.33680869e-19, 6.87080990e-30,
80
- -4.33972379e-01, 2.62777555e-01, 4.89936781e-01],
81
- [-2.98526209e-01, 5.75733187e-01, 2.22044605e-16,
82
- -3.51360414e-01, 1.38777878e-17, 1.73472348e-18,
83
- 1.40231899e-01, 6.56430019e-01, -7.34432019e-02],
84
- [-1.99812934e-01, 1.10527951e-01, -0.00000000e+00,
85
- 4.05686198e-01, -0.00000000e+00, -1.11022302e-16,
86
- 7.37245878e-01, -7.40061442e-02, 4.84013097e-01],
87
- [-4.53376419e-01, -1.17950445e-03, 1.11022302e-16,
88
- 7.25830343e-01, 1.38777878e-17, 1.11022302e-16,
89
- -2.21043018e-01, 1.82393601e-01, -4.30687013e-01],
90
- [ 3.38474188e-01, -6.06349571e-01, 2.77555756e-17,
91
- 7.62238071e-02, 0.00000000e+00, 1.11022302e-16,
92
- 2.58643763e-01, 6.62516936e-01, -7.83585718e-02],
93
- [-5.70050328e-01, -4.05009279e-01, -3.33066907e-16,
94
- -1.65083785e-01, -2.77555756e-17, 2.08166817e-17,
95
- -3.64300551e-01, 1.49581284e-01, 5.73295735e-01],
96
- [-2.28222730e-17, 2.14447949e-17, 2.44517236e-01,
97
- -1.50217073e-17, 6.80988603e-01, 6.90265054e-01,
98
- 4.62816197e-18, -3.41355305e-17, 6.05612031e-17],
99
- [ 7.09295599e-18, -7.35218129e-19, -8.10461498e-02,
100
- -1.51829973e-17, 7.23736480e-01, -6.85300685e-01,
101
- -5.71988276e-17, 1.01952746e-17, -5.83613217e-17],
102
- [-9.10120242e-17, 3.59809750e-17, 9.66251956e-01,
103
- 2.12446194e-17, -1.11624504e-01, -2.32157548e-01,
104
- -3.43148925e-17, 7.42260318e-17, 1.10636100e-16]])
78
+ pca_components = np.array([[ 3.41756961e-01, -2.61355435e-01, -5.55111512e-17,
79
+ 4.20259492e-01, 1.73472348e-18, 3.12560562e-30,
80
+ -3.63303205e-01, 4.70312769e-01, 5.33942091e-01],
81
+ [ 4.71762540e-01, 6.30409106e-01, 1.11022302e-16,
82
+ 1.92012911e-01, -0.00000000e+00, 2.16840434e-19,
83
+ -4.64511826e-01, -1.61613840e-01, -3.18221994e-01],
84
+ [-3.87150503e-01, 3.94110963e-01, -1.11022302e-16,
85
+ -4.69134836e-01, 0.00000000e+00, -2.29213584e-29,
86
+ -3.07138668e-01, 6.13781957e-01, 6.03414407e-02],
87
+ [ 6.89037889e-01, 2.42842441e-02, -1.38777878e-16,
88
+ -6.16784244e-01, -5.55111512e-17, 6.93889390e-18,
89
+ 3.14530607e-01, 8.58458389e-02, 1.94718384e-01],
90
+ [-3.22430482e-02, 5.40764079e-01, 1.73472348e-17,
91
+ 4.14137910e-01, -0.00000000e+00, 1.11022302e-16,
92
+ 6.59558509e-01, 2.61545280e-01, 1.77766779e-01],
93
+ [-1.86933003e-01, 2.93153083e-01, 1.66533454e-16,
94
+ -1.20384780e-01, 0.00000000e+00, -1.73472348e-18,
95
+ -1.54785186e-01, -5.47889709e-01, 7.35175653e-01],
96
+ [ 2.34342554e-18, -1.11613983e-16, 5.53604827e-02,
97
+ -7.70407156e-17, 1.84730811e-02, 9.98295529e-01,
98
+ -1.31345009e-16, -5.62176760e-17, -3.77791731e-17],
99
+ [ 4.39134634e-17, -6.00026241e-17, 9.97848118e-01,
100
+ -1.55562006e-16, 3.41576381e-02, -5.59677458e-02,
101
+ 3.23505183e-17, 7.93158315e-17, 5.34770085e-17],
102
+ [-2.19955299e-18, -1.44874609e-17, -3.51333141e-02,
103
+ 3.71401416e-17, 9.99245716e-01, -1.65423459e-02,
104
+ 1.85164759e-17, -1.66091718e-17, -4.95729384e-18]])
105
105
 
106
106
 
107
107
  def build_model_from_data(tr_data):
@@ -15,6 +15,7 @@ import pickle
15
15
  from NEXT import data
16
16
  import pandas as pd
17
17
  import argparse
18
+ import sys
18
19
 
19
20
  next_url = "https://github.com/mines-ciroh/TempEst-NEXT/raw/refs/heads/master/coefs.pickle"
20
21
 
@@ -41,8 +42,9 @@ def get_model(cache=None, url=next_url, overwrite=False):
41
42
  if os.path.exists(cache):
42
43
  return NEXT.from_pickle(cache)
43
44
  # No stored model.
44
- with request.urlopen(url) as req:
45
- model = pickle.loads(req.read())
45
+ req = request.urlopen(url)
46
+ model = pickle.loads(req.read())
47
+ req.close()
46
48
  if cache is not None:
47
49
  if overwrite or os.path.exists(cache):
48
50
  model.to_pickle(cache)
@@ -145,6 +147,7 @@ def run(site_type=None, site=None, lat=None, lon=None, start=None, end=None,
145
147
  print(predictions)
146
148
  predictions.to_csv(output)
147
149
  print(f"Done; results are in {output}")
150
+ sys.exit()
148
151
 
149
152
 
150
153
  def parser():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TempEst-NEXT
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: TempEst-NEXT, Stream Temperature Estimation - Near-term Expected Temperatures: a statistical stream temperature model with coefficient estimation for ungaged watersheds
5
5
  Home-page: https://rivertempest.org/next/readme.html
6
6
  Author: Daniel Philippus
File without changes
File without changes