-
Notifications
You must be signed in to change notification settings - Fork 0
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
CFtime bug in gridmap #68
Conversation
for name, obj in xr_objs.items(): | ||
if "time" in obj.dims: | ||
if isinstance(obj.get_index("time"), xr.CFTimeIndex): | ||
conv_obj = obj.convert_calendar("standard", use_cftime=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function might be a bit dangerous depending on what we are plotting... If we want to see the no leap or 360_day on the time axis, this might be problematic. At least, add a warning to say that you are converting the calendar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. But I see this as a separate issue - check_timeindex
is not used in gridmap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok I see. I had initially modified this function to accept DataArrays and Datasets, and not just dictionaries, to be able to use it in gridmap
. This didn't change the logic of how we convert calendars. My latest commit removed it from gridmap
.
I'll add a warning for now, and create a separate issue (#72), as I need to look into why I was converting the calendar in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chnage the warning and then it's good to go
Co-authored-by: juliettelavoie <[email protected]>
@juliettelavoie can you check if this fix works, or send me a path to a similar file?