-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISMN_Interface date format error (v1.4.0) #81
Comments
This is the full error message ValueError Traceback (most recent call last) File ...\ismn\interface.py:162, in ISMN_Interface.init(self, data_path, meta_path, network, parallel, keep_loaded_data, temp_root, custom_meta_reader, force_metadata_collection) File ...\ismn\interface.py:196, in ISMN_Interface.activate_network(self, network, meta_path, temp_root) File ...\ismn\filecollection.py:405, in IsmnFileCollection.from_metadata_csv(cls, data_root, meta_csv_file, network, temp_root) File ...\ismn\filecollection.py:136, in _load_metadata_df(meta_csv_file) File ...\pandas\core\tools\datetimes.py:1063, in to_datetime(arg, errors, dayfirst, yearfirst, utc, format, exact, unit, infer_datetime_format, origin, cache) File ...\pandas\core\tools\datetimes.py:247, in _maybe_cache(arg, format, cache, convert_listlike) File ...\pandas\core\tools\datetimes.py:433, in _convert_listlike_datetimes(arg, format, name, utc, unit, errors, dayfirst, yearfirst, exact) File ...\pandas\core\tools\datetimes.py:467, in _array_strptime_with_fallback(arg, name, utc, fmt, exact, errors) File strptime.pyx:501, in pandas._libs.tslibs.strptime.array_strptime() File strptime.pyx:451, in pandas._libs.tslibs.strptime.array_strptime() File strptime.pyx:583, in pandas._libs.tslibs.strptime._parse_with_format() ValueError: time data "2017-01-01" doesn't match format "%Y-%m-%d %H:%M:%S", at position 462. You might want to try: |
Hi, thanks for reporting this. Unfortunately I could not reproduce the error so far (I have downloaded all data for 2017 from the ismn platform yesterday, maybe there was a temporary hiccup in the database and you got a corrupt file?).
|
After some testing, I think there might be a bug with parallel extraction from the zip archive. I'm looking into this. I suggest to use parallel=False (Default) for now when reading data directly from zip. Or extract the archive first and pass the directory that contains the extracted networks instead of the zip file. |
I have just released a new version -> |
I downloaded Soild_moisture, soil_temperature, surface_temperature, snow_depth and air_temperature for all stations betwen 2017-01-01 and 2017-12-31.
When loading the zip file and generating metadata for the first time the code outputed this error.
ValueError: time data "2017-01-01" doesn't match format "%Y-%m-%d %H:%M:%S", at position 462. You might want to try:
- passing
format
if your strings have a consistent format;- passing
format='ISO8601'
if your strings are all ISO8601 but not necessarily in exactly the same format;- passing
format='mixed'
, and the format will be inferred for each element individually. You might want to usedayfirst
alongside this.I tryed with ismn==1.2.0 and then got the "No objects to concatenate error" (see: #52)
Then I downgraded to ismn==1.3.0 and tryed to load a sinpler dataset contatining only Soild_moisture, soil_temperature, surface_temperature. It worked fine.
The text was updated successfully, but these errors were encountered: