-
Notifications
You must be signed in to change notification settings - Fork 20
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
set period if dimension cyclicity automatically set #237
Comments
Thanks for raising this Thibault. David would likely know right away when and why the underlying change leading to this behaviour change was made, but he is on leave this week, so I have done a little digging to investigate. Origin of changeThere is nothing obvious in the changelog to indicate why there is the behaviour change (you may have already checked that) but from a git blame on the ultimate line referenced in the traceback and it appears that the change was made as part of (or, at least, included in with) a widespread set of API changes towards better performance, made in the PR #210. Specifically, amongst other updates, the following lines were incorporated and it seems like there is a mistake here (that I must have missed in reviewing the PR), because any existing cf-python/cf/mixin/fielddomain.py Lines 1168 to 1173 in fa951fe
So I will look into that as a possible bug. Feature request
If there is a small bug as the above may suggest, then hopefully when fixed the period will be set automatically as you desire. If not, I can't see any reason we can't adapt the code to do it, especially if it would be convenient to you and likely others. So, I'll get onto it later today or tomorrow and report back when I have determined the exact cause and way to add your feature request. Thanks. Do you have a workaround for now? I guess you can set the period manually afterwards? |
Thank you Sadie. I registered this feature request (which may just be a bug actually) before forgetting about it, but there is no urgency for it to be solved today (or even this week), so please feel free to wait a little longer, e.g. until David returns.
I don't know if there is a workaround, as I think the |
Thanks for the extra info., Thibault. Since you don't consider it urgent then I think it is probably best to wait to hear from David because, since he made the changes in question that changed the behaviour, I suspect it will take him very little time to pinpoint what caused it, whether it is a bug, and how we can incorporate your request, whereas it will take me O(10) as much time, at least, to work it out. All for efficiency! @davidhassell (when you are back from leave, of course) please let us know your thoughts (the thread here probably covers everything you need to know)... |
Awesome. Thank you David and Sadie! 🚀 |
This version includes: - fix for memory leak due to ESMF objects NCAS-CMS/cf-python#225 - lift for size 1 restriction on grid NCAS-CMS/cf-python#249 - fix bug preventing cyclic domain (e.g. global runs) NCAS-CMS/cf-python#237
Hi Sadie, Hi David,
I've noticed that when I define a field with a cyclic spatial dimension (e.g. -180 degrees east to +180 degrees east), I get an error message in
cf-python==3.10.0
that I was not getting incf-python==3.8.0
because my cyclic dimension does not have a period. See example below:With this example, when setting the longitude construct, I get thrown the following:
I don't know if cyclicity was automatically checked for and set before, and I believe that this is a good thing that it is if the bounds show that it is a cyclic dimension, however, I am wondering whether the period could not also be set automatically at the same time? This would be very convenient.
Thank you.
Thibault
The text was updated successfully, but these errors were encountered: