-
Notifications
You must be signed in to change notification settings - Fork 286
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
Implement dataless cubes #6253
base: main
Are you sure you want to change the base?
Implement dataless cubes #6253
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6253 +/- ##
==========================================
- Coverage 89.83% 89.74% -0.10%
==========================================
Files 88 88
Lines 23347 23467 +120
Branches 4344 4383 +39
==========================================
+ Hits 20974 21060 +86
- Misses 1646 1664 +18
- Partials 727 743 +16 ☔ View full report in Codecov by Sentry. |
This reverts commit 6ed270d.
Something is wrong with the _assert_axiom code now. I need to catch a bus, so will have to figure out why tomorrow. |
for more information, see https://pre-commit.ci
Although the tests are passing, next time I look at this, I need to investigate the data setter. Currently, line 256 causes issues, as self._shape should be changable if self._shape = (), and it won't be. That is to say, it works as expected, but I believe it hasn't been written in such a way as it SHOULD be. |
lib/iris/_data_manager.py
Outdated
|
||
@property | ||
def shape(self): | ||
"""The shape of the data being managed.""" | ||
return self.core_data().shape | ||
return self._shape if self._shape else self.core_data().shape |
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.
This is defensive; it wouldn't cause any issues that I can think of to just have return self._shape
, but this should protect us in case I've missed something.
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've actually removed this now.
() is falsy. I could have easily done ...if self._shape is not None
, but I decided there's no point in adding redundant code. Easy undo if my reviewer disagrees!
state = is_lazy ^ is_real | ||
assert state, emsg.format("" if is_lazy else "no ", "" if is_real else "no ") | ||
|
||
if not (is_lazy ^ is_real): |
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.
This might be clearer as if is_lazy == is_real
.
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 did see this, but forgot to comment.
Personally, I think I prefer it as it is, but if there's significant desire for your suggestion, I don't mind.
Closes #4447.
I plan to do this in four stages:
data is None
when handed a shape value, and can essentially round-trip removing and adding data. This shouldn't break existing tests. 71c7ae8DataManager
methods all make sense and work withNone
data.DataManager.copy()
is an example of a method that won't make sense withNone
data.