You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While preparing a forcing from a datasource that has a noleap type, when using pandas>1.4 (1.5.2 in my case), I encounter the following error:
Traceback (most recent call last):
File "/root/work/.snakemake/scripts/tmp9je2e4p2.downscale_climate_forcing.py", line 97, in <module>
mod.update(opt=update_options)
File "/opt/conda/lib/python3.10/site-packages/hydromt/models/model_api.py", line 291, in update
self._run_log_method(method, **opt[method])
File "/opt/conda/lib/python3.10/site-packages/hydromt/models/model_api.py", line 153, in _run_log_method
return func(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/hydromt_wflow/wflow.py", line 1982, in write_forcing
ds = ds.sel({"time": slice(start, end)})
File "/opt/conda/lib/python3.10/site-packages/xarray/core/dataset.py", line 2565, in sel
query_results = map_index_queries(
File "/opt/conda/lib/python3.10/site-packages/xarray/core/indexing.py", line 183, in map_index_queries
results.append(index.sel(labels, **options))
File "/opt/conda/lib/python3.10/site-packages/xarray/core/indexes.py", line 442, in sel
indexer = _query_slice(self.index, label, coord_name, method, tolerance)
File "/opt/conda/lib/python3.10/site-packages/xarray/core/indexes.py", line 207, in _query_slice
indexer = index.slice_indexer(
File "/opt/conda/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6602, in slice_indexer
start_slice, end_slice = self.slice_locs(start, end, step=step)
File "/opt/conda/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6810, in slice_locs
start_slice = self.get_slice_bound(start, "left")
File "/opt/conda/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6726, in get_slice_bound
return self._searchsorted_monotonic(label, side)
File "/opt/conda/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6672, in _searchsorted_monotonic
return self.searchsorted(label, side=side)
File "/opt/conda/lib/python3.10/site-packages/pandas/core/base.py", line 1298, in searchsorted
return algorithms.searchsorted(
File "/opt/conda/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1665, in searchsorted
return arr.searchsorted(value, side=side, sorter=sorter) # type: ignore[arg-type]
File "src/cftime/_cftime.pyx", line 1432, in cftime._cftime.datetime.__richcmp__
TypeError: cannot compare cftime.DatetimeNoLeap(2039, 1, 2, 0, 1, 0, 0, has_year_zero=True) and Timestamp('2030-01-01 00:00:00') (different calendars)
This is likely due to pandas being more restrictive about datetime formats.
Thanks for all the effort!
Jaap
The text was updated successfully, but these errors were encountered:
Hi all!
While preparing a forcing from a datasource that has a noleap type, when using pandas>1.4 (1.5.2 in my case), I encounter the following error:
This is likely due to pandas being more restrictive about datetime formats.
Thanks for all the effort!
Jaap
The text was updated successfully, but these errors were encountered: