Clarify behaviour of "wrapper" objects derived from CFVariable. #3725
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.