-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add support for n-dimensional coordinates on BlockReduce #198
Conversation
@leouieda I think this solves the issue, but please take a look at it because I'm not so familiar with Verde source code (it's highly probable that I missed something). |
Hi @santisoler this looks really nice! I made a few comments on the wording of the docs but the code looks good to me. I had to figure out how the original code worked again (of course I didn't remember). One thing I'm wondering is if we should make this optional and turned off by default. This changes the behavior of the class and might break existing code that's relying on This could be done with a flag |
Thanks @leouieda! I see the problem by returning I leave the decision to you. Let me know what you decide and I'll make any change you propose. |
Yeah, this would have been good as a default if I had the foresight. But for now, we shouldn't break the API. We can put a warning later on if we decide to change the default to True for a 2.0.0 release. |
@leouieda I gave this a second thought. The problematic line you mentioned is not quite right. coordinates, data = BlockReduce(...).filter(coordinates, data) So the number of output variables is not changed on this PR, therefore it's not breaking backward compatibility. Nevertheless it could create problems if the user use it like this: (lon, lat), data = BlockReduce(...).filter(coordinates, data) But I don't think this is the recommended way according to the documentation. I'm on a grey area here (mainly due to my lack of experience with supporting backward compatibility). |
Yep, I always forget that Actually, I probably would never use But it's good to have the option of not dropping coordinates since the average height, etc, might be useful for other things. |
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.
Looks good to me! Thanks, Santi!
Include additional coordinates when reducing data and observation points.
Fixes #195
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
andverde/__init__.py
.