Clarify behaviour of "wrapper" objects derived from CFVariable.#3725
Closed
pp-mo wants to merge 1 commit intoSciTools:mainfrom
Closed
Clarify behaviour of "wrapper" objects derived from CFVariable.#3725pp-mo wants to merge 1 commit intoSciTools:mainfrom
pp-mo wants to merge 1 commit intoSciTools:mainfrom
Conversation
Member
Author
|
Note: lots of Mock-ist tests to be adjusted. That's pretty mechanical, but I'll wait to see whether anyone wants these changes first. |
pp-mo
commented
Jun 4, 2020
| self.cf_name = name | ||
|
|
||
| #: NetCDF4 Variable data instance. | ||
| self.cf_data = data |
Member
Author
There was a problem hiding this comment.
I think the term 'data' is desperately confusing.
This is actually always a netcdf file variable, netCDF4.Variable (and not the variable's data).
Hence the rename !
| return (ignore, target) | ||
|
|
||
| @abstractmethod | ||
| def identify(self, variables, ignore=None, target=None, warn=True): |
Member
Author
There was a problem hiding this comment.
Changed to match the signature in the concrete classes.
Member
Author
|
Peloton : code proposals now out-of-date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I spent ages trying to fully understand this, and especially what was introduced in #213
(all that time ago!)
I think there is an excess of subtlety here, and I would have liked to remove some, but that is quite complicated !
So instead, here is an attempt to make the mechanisms clearer : Mainly, just renaming a few things, and adding a few choice comments which I wish I'd had to go on.
Frankly, I'd like to go further and ditch the "wrapper" implementation, which allows us to use a "cf_var" (of a CFVariable-derived type) as a proxy for the underlying netcdf variable object.
( "cf_var.cf_data" -- or as I'm now calling it, "cf_var.nc_variable" ).
Unfortunately there is a lot of other code using that, in both Pyke rules (example) and netcdf.py (example), so I think that change is just too big to include with this.