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

iris.pandas.as_series() started throwing error #3216

Closed
luke-wemc opened this issue Nov 7, 2018 · 4 comments
Closed

iris.pandas.as_series() started throwing error #3216

luke-wemc opened this issue Nov 7, 2018 · 4 comments

Comments

@luke-wemc
Copy link

As of yesterday, when I try and convert a 1d cube to pandas series using iris.pandas.as_series(), I suddenly started getting the following error:

'real_datetime' object has no attribute 'nanosecond'

This was working fine until yesterday, I'm guessing it broke when I updated some packages.

Does anyone have a quick workaround for this? Somehow changing the nanoseconds in the cube to 0 possibly? I'm getting desperate here!

@DPeterK
Copy link
Member

DPeterK commented Nov 7, 2018

As a very quick guess, I reckon this is due to the latest cftime version (specifically I think at v1.0.2), which introduced nanosecond time accuracy. This is causing problems with Iris master as well.

If you run conda install cftime=1.0.1 does the problem go away?

@DPeterK
Copy link
Member

DPeterK commented Nov 7, 2018

In fact, here's exactly that error being reported by the Iris tests on Travis. This went away once the Iris build was pinned to not use cftime v1.0.2.1, so hopefully doing the same will fix this problem for you too!

@luke-wemc
Copy link
Author

luke-wemc commented Nov 7, 2018

Thanks for the quick reply! This worked in the end:

conda install -c conda-forge cftime=1.0.1

Phew!

@DPeterK
Copy link
Member

DPeterK commented Nov 7, 2018

Excellent news! Glad things are working again now 👍 I'm going to close this issue now as I think we've got there with solving the problem you reported.

Thanks again though for raising this issue, and please do get in contact again if you encounter other difficulties or things that could be improved 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants