From 698b6ffceb85218f6844f91cfe0dbcb6877bb393 Mon Sep 17 00:00:00 2001 From: OnnoEbbens Date: Thu, 4 Feb 2021 09:52:58 +0100 Subject: [PATCH 1/7] update version --- hydropandas/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydropandas/version.py b/hydropandas/version.py index bfeb9e74..05dcdd5a 100644 --- a/hydropandas/version.py +++ b/hydropandas/version.py @@ -1 +1 @@ -__version__ = '0.3.4' +__version__ = '0.3.5b' From c91a2aa16b1ac82208db2e58f07b455cc9dc73e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ruben=20Calj=C3=A9?= Date: Fri, 5 Feb 2021 16:03:49 +0100 Subject: [PATCH 2/7] Change coordinates for meterological station Rotterdam Minutes in coordinates were previously interpreted as decimals --- hydropandas/data/knmi_meteostation.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hydropandas/data/knmi_meteostation.json b/hydropandas/data/knmi_meteostation.json index a63fc5c8..a9b0e2a8 100644 --- a/hydropandas/data/knmi_meteostation.json +++ b/hydropandas/data/knmi_meteostation.json @@ -19,7 +19,7 @@ "323": 51.5333333333, "330": 51.9833333333, "340": 51.45, - "344": 51.58, + "344": 51.97, "348": 51.9666666667, "350": 51.5666666667, "356": 51.85, @@ -56,7 +56,7 @@ "323": 3.9, "330": 4.1, "340": 4.35, - "344": 4.27, + "344": 4.45, "348": 4.9166666667, "350": 4.9333333333, "356": 5.15, @@ -130,7 +130,7 @@ "323": 51796.9894138229, "330": 66556.6593424747, "340": 82881.4038130033, - "344": 77564.0000000000, + "344": 90598.0000000000, "348": 122637.5500428702, "350": 123504.8944820797, "356": 138628.3530043226, @@ -167,7 +167,7 @@ "323": 394768.744780688, "330": 444557.6206735963, "340": 384958.5108108983, - "344": 399602.0000000000, + "344": 442813.0000000000, "348": 442024.5360290739, "350": 397521.3127536682, "356": 428968.0220408023, From ab65b14b5b08ab1a6d69d50aabce2d543e2187a8 Mon Sep 17 00:00:00 2001 From: OnnoEbbens Date: Mon, 15 Feb 2021 10:29:55 +0100 Subject: [PATCH 3/7] Update version.py --- hydropandas/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydropandas/version.py b/hydropandas/version.py index 05dcdd5a..5154fdbf 100644 --- a/hydropandas/version.py +++ b/hydropandas/version.py @@ -1 +1 @@ -__version__ = '0.3.5b' +__version__ = '0.3.6b' From c050f12541290e6423997c380288f2625ec9ec09 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Mon, 1 Mar 2021 14:08:24 +0100 Subject: [PATCH 4/7] add overwrite kwarg in to_pastastore() --- hydropandas/obs_collection.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hydropandas/obs_collection.py b/hydropandas/obs_collection.py index c42a6e4a..8a5f8aee 100644 --- a/hydropandas/obs_collection.py +++ b/hydropandas/obs_collection.py @@ -606,7 +606,7 @@ class of the observations, e.g. GroundwaterObs or WaterlvlObs if (file_or_dir is not None): # get files dirname, unzip_fnames = util.get_files(file_or_dir, ext=".xml", unpackdir=unpackdir, - force_unpack=force_unpack, preserve_datetime=preserve_datetime) + force_unpack=force_unpack, preserve_datetime=preserve_datetime) meta.update({'filename': dirname}) obs_list = read_xml_filelist(unzip_fnames, @@ -630,7 +630,8 @@ class of the observations, e.g. GroundwaterObs or WaterlvlObs return cls(obs_df, name=name, meta=meta) else: - raise ValueError('either specify variables file_or_dir or xmlstring') + raise ValueError( + 'either specify variables file_or_dir or xmlstring') @classmethod def from_fieldlogger(cls, fname, name='', ObsClass=obs.GroundwaterObs): @@ -1177,7 +1178,7 @@ def to_report_table(self, columns=['locatie', 'filternr', def to_pastastore(self, pstore=None, pstore_name='', obs_column='stand_m_tov_nap', kind='oseries', add_metadata=True, - verbose=False): + overwrite=False, verbose=False): """add observations to a new or existing pastastore. Parameters @@ -1193,7 +1194,9 @@ def to_pastastore(self, pstore=None, pstore_name='', kind : str, optional The kind of series that is added to the pastas project add_metadata : boolean, optional - If True metadata from the observations added to the project. + If True metadata from the observations added to the project + overwrite : boolean, optional + if True, overwrite existing series in pastastore, default is False verbose : boolean, optional Print additional information to the screen (default is False). @@ -1208,7 +1211,7 @@ def to_pastastore(self, pstore=None, pstore_name='', add_metadata=add_metadata, kind=kind, obs_column=obs_column, - verbose=verbose) + verbose=verbose, overwrite=overwrite) return pstore From 431c315259a22a7442342c219d596452b041b688 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Thu, 18 Mar 2021 13:48:07 +0100 Subject: [PATCH 5/7] fix after rename io_xml module to io_fews --- docs/source/hydropandas.io.rst | 6 +++--- hydropandas/obs_collection.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/hydropandas.io.rst b/docs/source/hydropandas.io.rst index 065ceeb3..f959e23b 100644 --- a/docs/source/hydropandas.io.rst +++ b/docs/source/hydropandas.io.rst @@ -81,10 +81,10 @@ hydropandas.io.io\_wiski module :undoc-members: :show-inheritance: -hydropandas.io.io\_xml module ------------------------------ +hydropandas.io.io\_fews module +------------------------------ -.. automodule:: hydropandas.io.io_xml +.. automodule:: hydropandas.io.io_fews :members: :undoc-members: :show-inheritance: diff --git a/hydropandas/obs_collection.py b/hydropandas/obs_collection.py index 8a5f8aee..e4d96d61 100644 --- a/hydropandas/obs_collection.py +++ b/hydropandas/obs_collection.py @@ -1066,8 +1066,8 @@ def to_fieldlogger(self, fname, additional_collection=None, otype=None, return f_df def to_pi_xml(self, fname, timezone="", version="1.24"): - from .io import io_xml - io_xml.write_pi_xml(self, fname, timezone=timezone, version=version) + from .io import io_fews + io_fews.write_pi_xml(self, fname, timezone=timezone, version=version) def to_pystore(self, store_name, pystore_path, groupby, item_name=None, overwrite=False): From 755d39ca680a3cfd9f2a1d95cdf65b1c4fbd90a6 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Thu, 18 Mar 2021 13:52:37 +0100 Subject: [PATCH 6/7] update version for minor release --- hydropandas/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydropandas/version.py b/hydropandas/version.py index 5154fdbf..4596d037 100644 --- a/hydropandas/version.py +++ b/hydropandas/version.py @@ -1 +1 @@ -__version__ = '0.3.6b' +__version__ = '0.3.6' From 335f51fccd47ecad24d367c1fc0060f0215f1152 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Thu, 18 Mar 2021 14:02:04 +0100 Subject: [PATCH 7/7] allow KNMI tests to fail (API is still down :( ) --- tests/test_001_to_from.py | 8 ++++++++ tests/test_006_io_knmi.py | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/test_001_to_from.py b/tests/test_001_to_from.py index 29a793f4..2d727812 100644 --- a/tests/test_001_to_from.py +++ b/tests/test_001_to_from.py @@ -266,10 +266,12 @@ def test_obs_from_pystore_item(): # %% KNMI +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_obs_from_stn(): return obs.KnmiObs.from_knmi(233, "RD", verbose=True) +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_obs_from_stn_without_any_data(): try: obs.KnmiObs.from_knmi(210, "RD", @@ -280,20 +282,24 @@ def test_knmi_obs_from_stn_without_any_data(): return 1 +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_obs_from_stn_with_missing_data_in_time_period(): return obs.KnmiObs.from_knmi(441, "RD", startdate='2010-1-2', verbose=True) +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_obs_from_xy(): return obs.KnmiObs.from_nearest_xy(100000, 350000, "RD") +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_obs_from_obs(): pb = test_observation_gw() return obs.KnmiObs.from_obs(pb, "EV24", fill_missing_obs=False) +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_collection_from_locations(): obsc = test_obscollection_dinozip_gw() oc_knmi = oc.ObsCollection.from_knmi(locations=obsc, @@ -304,6 +310,7 @@ def test_knmi_collection_from_locations(): return oc_knmi +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_collection_from_stns(): stns = [344, 260] # Rotterdam en de Bilt oc_knmi = oc.ObsCollection.from_knmi(stns=stns, @@ -314,6 +321,7 @@ def test_knmi_collection_from_stns(): return oc_knmi +@pytest.mark.skip(reason="KNMI API is down") def test_knmi_collection_from_grid(): # somewhere in Noord-Holland (near Castricum) xmid = np.array([104150., 104550.]) diff --git a/tests/test_006_io_knmi.py b/tests/test_006_io_knmi.py index 48325c26..509f2354 100644 --- a/tests/test_006_io_knmi.py +++ b/tests/test_006_io_knmi.py @@ -7,10 +7,12 @@ import numpy as np import pandas as pd +import pytest from hydropandas import observation as obs from hydropandas.io import io_knmi +@pytest.mark.skip(reason="KNMI API is down") def test_get_knmi_ts(): ts, meta = io_knmi.get_knmi_timeseries_stn( 441, @@ -22,6 +24,7 @@ def test_get_knmi_ts(): return ts, meta +@pytest.mark.skip(reason="KNMI API is down") def test_download_rd_210(): knmi_df, variables, stations = io_knmi.download_knmi_data( 210, @@ -34,6 +37,7 @@ def test_download_rd_210(): return knmi_df, variables, stations +@pytest.mark.skip(reason="KNMI API is down") def test_download_without_data(): try: knmi_df, variables, stations = io_knmi.download_knmi_data( @@ -50,6 +54,7 @@ def test_download_without_data(): return 1 +@pytest.mark.skip(reason="KNMI API is down") def test_download_without_data_no_error(): knmi_df, variables, stations = io_knmi.download_knmi_data( 210, @@ -67,6 +72,7 @@ def test_download_without_data_no_error(): return knmi_df, variables, stations +@pytest.mark.skip(reason="KNMI API is down") def test_download_ev24_240(): knmi_df, variables, stations = io_knmi.download_knmi_data( 210, @@ -79,6 +85,7 @@ def test_download_ev24_240(): return knmi_df, variables, stations +@pytest.mark.skip(reason="KNMI API is down") def test_fill_missing_measurements_ev24_278(): knmi_df, variables, stations = io_knmi.fill_missing_measurements( 278, @@ -90,6 +97,7 @@ def test_fill_missing_measurements_ev24_278(): return knmi_df, variables, stations +@pytest.mark.skip(reason="KNMI API is down") def test_fill_missing_measurements_rd_278(): knmi_df, variables, stations = io_knmi.fill_missing_measurements( 892, @@ -101,6 +109,7 @@ def test_fill_missing_measurements_rd_278(): return knmi_df, variables, stations +@pytest.mark.skip(reason="KNMI API is down") def test_obslist_from_grid(): xmid = np.array([104150., 104550.]) ymid = np.array([510150., 510550.]) @@ -113,6 +122,7 @@ def test_obslist_from_grid(): return obs_list +@pytest.mark.skip(reason="KNMI API is down") def test_obslist_from_locations(): locations = pd.DataFrame(data={'x': [100000], 'y': [350000]}) obs_list = io_knmi.get_knmi_obslist(locations, meteo_vars=['EV24'], @@ -123,6 +133,7 @@ def test_obslist_from_locations(): return obs_list +@pytest.mark.skip(reason="KNMI API is down") def test_obslist_from_stns(): stns = [344, 260] # Rotterdam en de Bilt obs_list = io_knmi.get_knmi_obslist(stns=stns, meteo_vars=['RH', 'EV24'],