-
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
Python io rules #182
Comments
@marqh what is the view from the ontology translation project? |
@bblay : I think it would help to share your motivation for this. Is it purely for performance? |
(and performance) |
Duplicate of #118. |
An important difference between rules files and python rules can be seen in #229, where individual python rules are being tested. This cannot be done satisfactorily with the rules files, which must be run as a whole. |
Another benefit not mentioned here yet: |
Duplicate of #71 |
I don't think #71 is a duplicate, mentioning just one format and optimisation (not a change of implementation). This ticket asks for all format loaders and savers to be written in Python, Readability and maintainability are the drivers here, with optimisation a possible, secondary side effect. |
🐌 Bump. I'd love this to move forward a little. I'd be happy to rewrite the grib load rules in Python next time I have some free time. |
Well, there is the small matter of @marqh's metarelate project... |
That's just covering parameter translations for the foreseeable future, is it not? It will be fantastic when it's giving us parameter translations but for the actual format translations, for quite some time at the very least, we seem to be stuck with decreasingly manageable rules files. An attempt to move to Python would not only give us more manageable rules logic but also inform the metarelate project if it attempts to move into format translation. Win-win? |
Wow, just returned to the grib load rules to add polar stereographic projection. Looking at So, in part, moving to pure Python for the grib load rules would just be refactoring for maintainability. |
I am not sure about this. I am currently enmeshed in refactoring If effort is available, I think it would be better expended on scoping and refactoring grib.py than refactoring the grib rules. |
agreed, will wait for this. |
I should add a comment: refactoring the Python code but keeping the rules files would be inadequate. The rules files have already become unacceptable. Look at the pp time saving rules, for example. They are almost unintelligable. Regarding the grib loading, the code has evolved to support the rules files so refactoring the code alone would just be rearranging deck chairs. |
Some ammo in this discussion, where @rhattersley examines performance gains from Python rules. |
To be clear, I've just done a minimal syntax tweak to the existing rules. So there's just a single function in a new module which contains all the rules:
And something like:
just becomes a snippet within that function:
|
I has been agreed that translation rules will be written in Python. |
Rewrite the load and save rules as atomic python functions.
Consider creating guidelines on writing rule functions,
It would be much easier to maintain and debug rules in this form.
Considerations:
The text was updated successfully, but these errors were encountered: