pastastore 1.8.0__py3-none-any.whl → 1.10.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.
@@ -168,6 +168,7 @@ def test_create_models(pstore):
168
168
  ["oseries1", "oseries2"], store=True, progressbar=False
169
169
  )
170
170
  _ = pstore.conn.models
171
+ assert pstore.n_models == 2
171
172
 
172
173
 
173
174
  @pytest.mark.dependency
@@ -252,15 +253,12 @@ def test_update_ts_settings(request, pstore):
252
253
 
253
254
  ml2 = pstore.get_models(ml.name, update_ts_settings=True)
254
255
 
255
- try:
256
- assert ml2.oseries.settings["tmax"] == o.index[-1]
257
- assert ml2.stressmodels["recharge"].prec.settings["tmax"] == tmax
258
- assert ml2.stressmodels["recharge"].evap.settings["tmax"] == tmax
259
- assert ml2.stressmodels["prec"].stress[0].settings["tmax"] == p2.index[-1]
260
- except AssertionError:
261
- pstore.del_models("ml_oseries2")
262
- pstore.set_check_model_series_values(True)
263
- raise
256
+ assert ml2.oseries.settings["tmax"] == o.index[-1]
257
+ assert ml2.stressmodels["recharge"].prec.settings["tmax"] == tmax
258
+ assert ml2.stressmodels["recharge"].evap.settings["tmax"] == tmax
259
+ assert ml2.stressmodels["prec"].stress[0].settings["tmax"] == p2.index[-1]
260
+ pstore.del_models("ml_oseries2")
261
+ pstore.set_check_model_series_values(True)
264
262
 
265
263
 
266
264
  # @pytest.mark.dependency()
@@ -296,6 +294,16 @@ def test_to_from_zip(pstore):
296
294
  os.remove(zipname)
297
295
 
298
296
 
297
+ def test_load_pastastore_from_config_file(pstore):
298
+ if pstore.type == "pas" or pstore.type == "arcticdb":
299
+ path = (
300
+ pstore.conn.path if pstore.type == "pas" else pstore.conn.uri.split("//")[1]
301
+ )
302
+ fname = os.path.join(path, f"{pstore.conn.name}.pastastore")
303
+ pstore2 = pst.PastaStore.from_pastastore_config_file(fname)
304
+ assert not pstore2.empty
305
+
306
+
299
307
  def test_example_pastastore():
300
308
  from pastastore.datasets import example_pastastore
301
309
 
@@ -319,3 +327,12 @@ def test_meta_with_name(pstore):
319
327
  pstore.add_stress(s, "what_i_want", kind="special", metadata=smeta)
320
328
  assert "what_i_want" in pstore.stresses.index, "This is not right."
321
329
  pstore.del_stress("what_i_want")
330
+
331
+
332
+ @pytest.mark.dependency
333
+ def test_models_metadata(request, pstore):
334
+ # depends(request, [f"test_create_models[{pstore.type}]"])
335
+ pstore.create_models_bulk(["oseries1", "oseries2"], store=True, progressbar=False)
336
+ df = pstore.models.metadata
337
+ assert df.index.size == 2
338
+ assert (df["n_stressmodels"] == 1).all()
@@ -176,6 +176,3 @@ def test_benchmark_read_model_arcticdb(benchmark):
176
176
  conn = pst.ArcticDBConnector("test", uri)
177
177
  _ = benchmark(read_model, conn=conn)
178
178
  pst.util.delete_arcticdb_connector(conn=conn)
179
- import shutil
180
-
181
- shutil.rmtree("./arctic_db/")
@@ -1,28 +0,0 @@
1
- docs/conf.py,sha256=XcZUTmn9fGDhhu8k3mpaLu435SpIRNpABADCCTJJuag,6291
2
- pastastore/__init__.py,sha256=cWwG9-YeiI4aOU0CDBGKbQgmKmmkcPd64YwPq2rRGt0,416
3
- pastastore/base.py,sha256=hOvkgACew4fpLWumLfHA6PrxLDH1EvqdWjEvFbmxJR0,46436
4
- pastastore/connectors.py,sha256=QlaFcVEM_ZtOgLd3M2yZfgogcw0zNM08pVbnyRS3Mr8,48454
5
- pastastore/datasets.py,sha256=FHVfmKqb8beEs9NONsWrCoJY37BmlvFLSEQ1VAFmE8A,6415
6
- pastastore/plotting.py,sha256=t6gEeHVGzrwvM6q1l8V3OkklpU75O2Y4h6nKEHRWdjo,46416
7
- pastastore/store.py,sha256=HZtof9gIFSW2nQpc5FHMPb1RTjgo-QzIJxueywd4jDA,65840
8
- pastastore/styling.py,sha256=4xAY0FmhKrvmAGIuoMM7Uucww_X4KAxTpEoHlsxMldc,2280
9
- pastastore/util.py,sha256=KCUFV4GkocWaRpG57CdxzfkTXyTEpPjnxsKehYPVN7U,28249
10
- pastastore/version.py,sha256=vuqYDMX5ua14OQP04vqXH_0A_Ra2XErriiNPxgZEc5w,1205
11
- pastastore/yaml_interface.py,sha256=MddELxWe8_aqJRMUydOCbjoU1-ZodzxFKYnAaqJ5SqA,29947
12
- pastastore/extensions/__init__.py,sha256=lCN9xfX1qefUzUbE2FQ12c6NjLbf5HoNo-D8cGb5CTw,461
13
- pastastore/extensions/accessor.py,sha256=kftQM6dqMDoySbyTKcvmkjC5gJRp465KA18G4NVXUO0,367
14
- pastastore/extensions/hpd.py,sha256=fcXWb3BlWlogCbg7a2Gmha8P_eCh6zSGTyRlYp3mjXA,27466
15
- tests/conftest.py,sha256=u097z7LGAnviuzXPzvER9oPjsZWqdij1CJLnW_sPY8E,5258
16
- tests/test_001_import.py,sha256=g8AaJzWZ088A4B30_w-MrDfAVeeg8m78l--j7Onsklc,208
17
- tests/test_002_connectors.py,sha256=k9etSRuSFVOrSEtZyxqsCF9GwIg0T7VdDJ2SjSe6i_s,7742
18
- tests/test_003_pastastore.py,sha256=2nC0pU478iRbYKnVVSjh5F6PA_7SvFROwD6SABL2YSE,9370
19
- tests/test_004_yaml.py,sha256=3hMNjb9s0S2rbmpyEjW6FDRAxfUZS_U1qoPl4wB-cCo,4440
20
- tests/test_005_maps_plots.py,sha256=L0ppGf-cudsrdxteWy3qsV4We96DW4bCBE7c6jEm6aM,1866
21
- tests/test_006_benchmark.py,sha256=yuExF35qqxhw04uYMH3OIOlGr71c4AJSJDMjGD8GefY,4983
22
- tests/test_007_hpdextension.py,sha256=1QNUahq3hzqxjKbzsjofi9Yuyqe_oDGL0vWp6iouYe4,3004
23
- tests/test_008_stressmodels.py,sha256=733fyCvuzjKcaLjvSMt5dTTLp-T4alzNJAToSxTIUug,4003
24
- pastastore-1.8.0.dist-info/LICENSE,sha256=DtHftfUEm99KzgwLr3rQUTg8H3kAS0Z-p5WWJgLf_OY,1082
25
- pastastore-1.8.0.dist-info/METADATA,sha256=nWFELMkHg9yfp76Ib1xlnPdrp7RZh-9KyhW3CO3rOVY,8032
26
- pastastore-1.8.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
27
- pastastore-1.8.0.dist-info/top_level.txt,sha256=1bgyMk1p23f04RK83Jju2_YAQBwyoQD_fInxoPB4YRw,22
28
- pastastore-1.8.0.dist-info/RECORD,,