-
Notifications
You must be signed in to change notification settings - Fork 284
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
Coding standards tweaks to daskified cube code #2416
Conversation
(cherry picked from commit 7f74405)
See the comments on #2415 for a discussion of why I've made these changes. |
See related query, here : https://github.com/SciTools/iris/pull/2415/files#r104770825 |
cube_data = self._dask_array | ||
else: | ||
raise ValueError('This cube has no data, slicing is not supported') | ||
cube_data = self._numpy_array |
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.
@dkillick At this point, we're confident that either self._dask_array
or self._numpy_array
is populated.
Prior to this change, there seems to be a hint of that might not be the case, hence the ValueError
exception being raised. I'd certainly hope that there is a data payload of some kind to process - we need to make sure that internally that is always the case.
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 if we end up at this point having a cube with no data we're deeper in the sticky than a ValueError
will help with! The rest of the code in the class makes it clear that we can never construct a cube with no data, so if an end user has done something that means their cube no longer has any data then IMO they can dig their own way out of the sticky stuff...
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'm really hoping that there never, ever is any sticky stuff
😉
It's just a note to ourselves really, that we need to ensure the integrity of the cube as best we can
There were a few inconsistencies in the
cube
+dask
code, and instead of noting them down for further discussion, I thought I'd make a vessel for discussion (that is, this PR).A retargetting of #2415 to the base
dask_timed
.