PP/GRIB load rules as a function#611
Conversation
There was a problem hiding this comment.
Yes - this uses a private function. My "justification" is that the version on master uses iris.fileformats.pp._load_rules so this is a like-for-like swap. But I'll be the first to admit it's a weak defence!
There was a problem hiding this comment.
I don't think you need justification, it should do whatever it must to test the unit.
There was a problem hiding this comment.
OK, maybe it's not a unit test, that restriction would make sense for system and acceptance tests but I still think it's fine.
However, the name is misleading, it should probably be make_bare_cube or make_data_cube or something indicating it's in the nooddy.
|
A lot of the |
Indeed. NB. @metarelate is also in this space. (See SciTools/iris-code-generators#1 for an early example). So close collaboration is essential (e.g. with @marqh) to ensure we don't waste effort or close any doors unwittingly. |
|
Again, probably out of scope, we don't seem to need |
I agree Loader doesn't need to exist. But I think it makes to sense to keep this PR as small and focussed as possible so I think we should leave it alone for now. |
There was a problem hiding this comment.
(trivial) If you're doing any more pushes I'd consider removing this comment.
|
There's nothing that tests |
Au contraire:
I don't think anyone's trying to convince you. 😉 |
Ahh, sorry. That top one is mine, too! |
PP/GRIB load rules as a function
Good thinking. I started a discussion about readability here. |
|
@bblay - given the somewhat controversial nature of this change (to other people, even if not to you 😉) it would have been better to hold off on merging until this PR had some other opinions. Plus, it would make more sense to merge SciTools/iris-code-generators#3 before this one. As things stand it's not possible for someone to make changes to the rules as they'd need to re-run the code generator ... which doesn't exist on master in its repo yet! |
That said - thank you for taking the time to review this PR and spot what I'd overlooked. |
Hmm. I'm probably wrong, but I don't see the point. |
The new rules modules are not intended to be hand-crafted text. That's something which I should have made clear in the new modules but it slipped through the net. They are intended to be automatically created using a utility in iris-code-generators - so I'll add that as feedback to SciTools/iris-code-generators#3. And yes, there is a reason to edit the rules files already - see #619. |
I meant there's no sudden reason we shouldn't be editing the Python you just made, in Iris, |
|
I'm concerned I've merged this without being aware of these extra restrictions being imposed alongside it. |
|
In future, might be worth writing a more suitable PR description or commit message perhaps. I'm having to look at the code changes themselves to understand whether this is applicable to be added to the 'whatsnew' (Id prefer not to have to read the google groups discussion either for context). |
|
The title kind of covers it all for this one, the load rules are now encoded as a function rather than text files. |
This PR was motivated by the discussion at: https://groups.google.com/d/msg/scitools-iris-dev/4GXbePUWtMY/oqVO_3gFFoAJ
That result still holds true in this branch.
Sadly, there's not yet much reduction in the total complexity of the rule system. That's because of the need to keep the custom user-rules capability around for a while. But at least the normal processing is definitely simpler and more easily debugged/profiled.
NB. Also see SciTools/iris-code-generators#3 for the code which produced the new rules modules.