Closed OnnoEbbens closed 1 year ago
I won't fix #131 because it takes to much time for now
@martinvonk, Thanks for the wow implementation. I approved and merged your wow pull request and then merged these changes into this pull request. It seems like everything is working fine now.
Some (minor) changes I made to the wow implementation:
from_wow
and from_wow_nearest_xy
in the from_wow
function (same change I made for knmi)_start_end_to_datetime
and get_nearest_station_df
from util.py to the wow.py module. I probably said at first it was best to put them in util.py but when I was merging this stuff I realized it is easier to make changes if these functions are stored in the modules even though we have some duplicate code now.Finally I would like to ask:
get_wow_metadata
function? I think the function does the same thing without the try/except or am I missing something (see code below).function with try/except:
def get_wow_metadata(stn: str) -> dict:
try:
r = requests.get(f"{URL_WOW_KNMI}/{stn}")
r.raise_for_status()
metadata = r.json()
except requests.HTTPError as ex:
raise ex
return metadata
function without try/except:
def get_wow_metadata(stn: str) -> dict:
r = requests.get(f"{URL_WOW_KNMI}/{stn}")
r.raise_for_status()
metadata = r.json()
return metadata
I also fixed #131. Can you have a look at my changes @OnnoEbbens ? Then you can merge it :)
Nice work :)
Thanks Martin, there are still some tests failing. Can you fix these?
Thanks Martin, there are still some tests failing. Can you fix these?
Yes, looking into it. Problem is that there is some overlap between the meteostation id's and precipitation station id's.
Two things before merging:
Two things before merging:
- The error in the notebook occurs because some stations inside the json file cannot be accessed through the API nor without the API. I think these are the stations that are available in the json file but not available on this page -> https://daggegevens.knmi.nl/klimatologie/daggegevens . I would suggest to remove these from the json file.
- An empty file test.py was added to hydropandas/data, I think this file can be removed.
fixed 2
on 1: There could be three things that go wrong;
new pandas version 2.1.0 seems to be the issue :)
I tried to solve the issue with the new pandas version but it is hard to find what goes wrong. For now I will just merge this
Okay this is a bigger than I anticipated. I think this PR should also solve issues #90, #92 and #131. On top of that I would like to:
from_nearest_xy
andfrom_obs
methods from the MeteoObs class and add the options to thefrom_knmi
method.start
andend
everywhere and notstartdate
andenddate
.