Skip to content
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

we always load as cftime objects, never as datetime64(ns). Avoids err… #152

Closed
wants to merge 1 commit into from

Conversation

JanStreffing
Copy link
Contributor

Closes #151 by enforcing cfdate objects for all loaded datasets.

@JanStreffing JanStreffing added the bug Something isn't working label Sep 27, 2021
@koldunovn
Copy link
Member

Tests are failing. Jan, can you have a look what might be wrong?

@JanStreffing
Copy link
Contributor Author

I looked at those. I don't know why the mf open fails in the tests.

pyfesom2\load_mesh_data.py:520: in get_data
    dataset = xr.open_mfdataset(paths, combine="by_coords", cftime=True, **kwargs)
C:\Miniconda\envs\pyfesom2\lib\site-packages\xarray\backends\api.py:913: in open_mfdataset
    datasets = [open_(p, **open_kwargs) for p in paths]
C:\Miniconda\envs\pyfesom2\lib\site-packages\xarray\backends\api.py:913: in <listcomp>
    datasets = [open_(p, **open_kwargs) for p in paths]

.
.
.
.


E       TypeError: open_dataset() got an unexpected keyword argument 'cftime'

/usr/share/miniconda/envs/pyfesom2/lib/python3.7/site-packages/xarray/backends/api.py:501: TypeError

It worked in my python 3.6.8 installation on juwels.

@koldunovn
Copy link
Member

@JanStreffing what is the version of your xarray installation? The one installed by CI is 0.19.0 (the latest one from my understanding).

@JanStreffing
Copy link
Contributor Author

@JanStreffing what is the version of your xarray installation? The one installed by CI is 0.19.0 (the latest one from my understanding).

Looks ok

# Name                    Version                   Build  Channel
xarray                    0.19.0             pyhd8ed1ab_1    conda-forge

@koldunovn koldunovn deleted the branch master December 10, 2022 19:00
@koldunovn koldunovn closed this Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relying on pandas time coordinate being in "datetime64[ns]" format
2 participants