Deltares / ddlpy

API to Dutch Rijkswaterstaat archive (DDL, waterinfo.rws.nl) of monitoring water data
https://deltares.github.io/ddlpy/
GNU General Public License v3.0
20 stars 6 forks source link

Add support for time strings in ddlpy.measurements() #39

Closed veenstrajelmer closed 6 months ago

veenstrajelmer commented 6 months ago

This raises "AttributeError: 'str' object has no attribute 'tzinfo'":

import ddlpy

time_min = "2022-01-01"
time_max = "2022-02-01"

locations = ddlpy.locations()
bool_grootheid = locations["Grootheid.Code"]=="WATHTE"
bool_station = locations.index == "HOEKVHLD"
selected = locations.loc[bool_grootheid & bool_station]

measurements = ddlpy.measurements(selected.iloc[0], time_min, time_max)