pastastore 1.10.2__py3-none-any.whl → 1.11.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.
@@ -63,6 +63,18 @@ def test_map_models(request, pstore):
63
63
  plt.close(ax.figure)
64
64
 
65
65
 
66
+ @pytest.mark.dependency
67
+ def test_map_signatures(request, pstore):
68
+ ax = pstore.maps.signature("mean_annual_maximum")
69
+ plt.close(ax.figure)
70
+
71
+
72
+ @pytest.mark.dependency
73
+ def test_map_modelparam(request, pstore):
74
+ ax = pstore.maps.modelparam("recharge_A")
75
+ plt.close(ax.figure)
76
+
77
+
66
78
  @pytest.mark.dependency
67
79
  def test_map_model(request, pstore):
68
80
  depends(request, [f"test_map_models[{pstore.type}]"])
@@ -128,7 +128,7 @@ def test_benchmark_write_model_arcticdb(benchmark):
128
128
 
129
129
 
130
130
  def write_model_nocheckts(conn, ml):
131
- conn.set_check_model_series_values(False)
131
+ conn.validator.set_check_model_series_values(False)
132
132
  conn.add_model(ml, overwrite=True)
133
133
 
134
134
 
@@ -1,10 +1,31 @@
1
1
  # ruff: noqa: D100 D103
2
2
  import pytest
3
3
  from pandas import Timestamp
4
+ from pandas.testing import assert_series_equal
5
+ from pastas.timeseries_utils import timestep_weighted_resample
4
6
 
5
7
  import pastastore as pst
6
8
 
7
9
 
10
+ def create_test_zip():
11
+ from pastastore.extensions import activate_hydropandas_extension
12
+
13
+ activate_hydropandas_extension()
14
+ pstore = pst.PastaStore()
15
+ pstore.hpd.download_bro_gmw(
16
+ extent=(117_850, 118_180, 439_550, 439_900),
17
+ tmin="2022-01-01",
18
+ tmax="2022-01-02",
19
+ )
20
+ pstore.hpd.download_knmi_precipitation(
21
+ stns=[260], meteo_var="RH", tmin="2022-01-01", tmax="2022-01-31"
22
+ )
23
+ pstore.hpd.download_knmi_evaporation(
24
+ stns=[260], tmin="2022-01-01", tmax="2022-01-31"
25
+ )
26
+ pstore.to_zip("tests/data/test_hpd_update.zip", overwrite=True)
27
+
28
+
8
29
  @pytest.mark.pastas150
9
30
  def test_hpd_download_from_bro():
10
31
  from pastastore.extensions import activate_hydropandas_extension
@@ -12,12 +33,14 @@ def test_hpd_download_from_bro():
12
33
  activate_hydropandas_extension()
13
34
  pstore = pst.PastaStore()
14
35
  pstore.hpd.download_bro_gmw(
15
- extent=(117850, 118180, 439550, 439900), tmin="2022-01-01", tmax="2022-01-02"
36
+ extent=(117_850, 118_180, 439_550, 439_900),
37
+ tmin="2022-01-01",
38
+ tmax="2022-01-02",
16
39
  )
17
40
  assert pstore.n_oseries == 3
18
41
 
19
42
 
20
- @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
43
+ # @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
21
44
  @pytest.mark.pastas150
22
45
  def test_hpd_download_precipitation_from_knmi():
23
46
  from pastastore.extensions import activate_hydropandas_extension
@@ -30,7 +53,7 @@ def test_hpd_download_precipitation_from_knmi():
30
53
  assert pstore.n_stresses == 1
31
54
 
32
55
 
33
- @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
56
+ # @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
34
57
  @pytest.mark.pastas150
35
58
  def test_hpd_download_evaporation_from_knmi():
36
59
  from pastastore.extensions import activate_hydropandas_extension
@@ -56,9 +79,11 @@ def test_update_oseries():
56
79
  assert tmintmax.loc["GMW000000036327_1", "tmax"] >= Timestamp("2022-02-27")
57
80
 
58
81
 
59
- @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
82
+ # @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
60
83
  @pytest.mark.pastas150
61
84
  def test_update_stresses():
85
+ import hydropandas as hpd
86
+
62
87
  from pastastore.extensions import activate_hydropandas_extension
63
88
 
64
89
  activate_hydropandas_extension()
@@ -66,10 +91,23 @@ def test_update_stresses():
66
91
  pstore = pst.PastaStore.from_zip("tests/data/test_hpd_update.zip")
67
92
  pstore.hpd.update_knmi_meteo(tmax="2022-02-28", normalize_datetime_index=True)
68
93
  tmintmax = pstore.get_tmin_tmax("stresses")
69
- assert (tmintmax["tmax"] >= Timestamp("2024-02-27")).all()
94
+ assert (tmintmax["tmax"] >= Timestamp("2022-02-27")).all()
95
+
96
+ # check if result is equal to hydropandas result after resampling
97
+ oc = hpd.read_knmi(
98
+ stns=[260], meteo_vars=["RH", "EV24"], starts="2022-01-01", ends="2022-02-28"
99
+ )
100
+ for i in range(2):
101
+ o = oc.obs.iloc[i].squeeze("columns") * 1e3
102
+ resampled_result = (timestep_weighted_resample(o, o.index.normalize())).dropna()
103
+ assert_series_equal(
104
+ pstore.get_stress(pstore.stresses_names[i]).squeeze(),
105
+ resampled_result,
106
+ check_names=False,
107
+ )
70
108
 
71
109
 
72
- @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
110
+ # @pytest.mark.xfail(reason="KNMI is being flaky, so allow this test to xfail/xpass.")
73
111
  @pytest.mark.pastas150
74
112
  def test_nearest_stresses():
75
113
  from pastastore.extensions import activate_hydropandas_extension
@@ -80,8 +118,8 @@ def test_nearest_stresses():
80
118
  pstore.hpd.download_nearest_knmi_precipitation(
81
119
  "GMW000000036319_1", tmin="2024-01-01", tmax="2024-01-31"
82
120
  )
83
- assert "RD_GROOT-AMMERS" in pstore.stresses_names
121
+ assert "RD_GROOT-AMMERS_434" in pstore.stresses_names
84
122
  pstore.hpd.download_nearest_knmi_evaporation(
85
123
  "GMW000000036319_1", tmin="2024-01-01", tmax="2024-01-31"
86
124
  )
87
- assert "EV24_CABAUW-MAST" in pstore.stresses_names
125
+ assert "EV24_CABAUW-MAST_348" in pstore.stresses_names
@@ -1,28 +0,0 @@
1
- docs/conf.py,sha256=XcZUTmn9fGDhhu8k3mpaLu435SpIRNpABADCCTJJuag,6291
2
- pastastore/__init__.py,sha256=cWwG9-YeiI4aOU0CDBGKbQgmKmmkcPd64YwPq2rRGt0,416
3
- pastastore/base.py,sha256=ng64KGuKo2iMLjL0H7qG3NVNvXPwMGJBf3oLtQbt6DQ,48264
4
- pastastore/connectors.py,sha256=hum8KkPi28B3XBsKL_RghRCsZndf-jeFlb4baTvyDG4,50197
5
- pastastore/datasets.py,sha256=FHVfmKqb8beEs9NONsWrCoJY37BmlvFLSEQ1VAFmE8A,6415
6
- pastastore/plotting.py,sha256=ygKXdi42sPLaehze4EjU8kRE2Dk46wVxSkB9RJ2Re84,54535
7
- pastastore/store.py,sha256=Fs_WCEGqafOKm3whLUR54tqXL1dL3FdzwxNI1DSZ2KI,69272
8
- pastastore/styling.py,sha256=0IEp_r-SpcaslShAZvZV6iuEhTG_YzNq-ad8krib3U0,2304
9
- pastastore/util.py,sha256=31dzHaK6xdFHGDkYh49qGBq1dGel2m9r7i797S3WUpQ,28505
10
- pastastore/version.py,sha256=2Y6_CKnmHYQTxRyvvUEW2519LmIeszWd-0NYpCRyV6M,1206
11
- pastastore/yaml_interface.py,sha256=n6zjQ7ENrUvxszb6zE-jPLa-XVsoEOTJHQmRV1_fFt0,30818
12
- pastastore/extensions/__init__.py,sha256=lCN9xfX1qefUzUbE2FQ12c6NjLbf5HoNo-D8cGb5CTw,461
13
- pastastore/extensions/accessor.py,sha256=kftQM6dqMDoySbyTKcvmkjC5gJRp465KA18G4NVXUO0,367
14
- pastastore/extensions/hpd.py,sha256=i9Ty9GyRyrtY0uqjMpWheH33oYDQM8WMmygaDEPx-w4,28581
15
- pastastore-1.10.2.dist-info/licenses/LICENSE,sha256=MB_6p4kXDCUsYNjslcMByBu6i7wMNRKPC36JnhzpN4o,1087
16
- tests/conftest.py,sha256=TB0ZUH1m45gvQd_EZO7iudvhFw4JA-8rTJ71GT6Nf1w,5061
17
- tests/test_001_import.py,sha256=g8AaJzWZ088A4B30_w-MrDfAVeeg8m78l--j7Onsklc,208
18
- tests/test_002_connectors.py,sha256=X7IbxZZXBYd2UT8B5gu0_Jw--3Twe7KHjSBbmMwNnRk,8193
19
- tests/test_003_pastastore.py,sha256=nhcUJHC2KiF9KREP_2uj_T2skKooUk13T1EVtkbwQnM,10051
20
- tests/test_004_yaml.py,sha256=3hMNjb9s0S2rbmpyEjW6FDRAxfUZS_U1qoPl4wB-cCo,4440
21
- tests/test_005_maps_plots.py,sha256=L0ppGf-cudsrdxteWy3qsV4We96DW4bCBE7c6jEm6aM,1866
22
- tests/test_006_benchmark.py,sha256=VZG0bY7uz8DkfIZTgRCzkEDG8rguBEt_-mdGSMQLN2w,4930
23
- tests/test_007_hpdextension.py,sha256=1QNUahq3hzqxjKbzsjofi9Yuyqe_oDGL0vWp6iouYe4,3004
24
- tests/test_008_stressmodels.py,sha256=733fyCvuzjKcaLjvSMt5dTTLp-T4alzNJAToSxTIUug,4003
25
- pastastore-1.10.2.dist-info/METADATA,sha256=8oLyVDQ95wA9wzSxBR29fMg2s81HjlvXGenukFxx2NA,7662
26
- pastastore-1.10.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- pastastore-1.10.2.dist-info/top_level.txt,sha256=1bgyMk1p23f04RK83Jju2_YAQBwyoQD_fInxoPB4YRw,22
28
- pastastore-1.10.2.dist-info/RECORD,,