-
Notifications
You must be signed in to change notification settings - Fork 44
Hybrid coords round trip #114
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
Hybrid coords round trip #114
Conversation
|
@dkillick @pp-mo Should I put in some bits at the end of each test to delete the saved files? |
| def setUp(self): | ||
| self.filepath = self.get_testdata_path( | ||
| 'faked_sample_hh_grib_data.grib2') | ||
| self.out_path = self.get_result_path( |
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 wouldn't store these results here (or even create this branch of the repo), as these are transient results.
Files living in tests/results should really be "independent" data that we want to store in the repo as a reference to compare results against.
Instead, I think it's appropriate to create temporary files which are then removed afterwards, using this pattern ...
|
|
||
| class TestHybridHeightRoundTrip(tests.IrisGribTest): | ||
| def setUp(self): | ||
| self.filepath = self.get_testdata_path( |
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.
Not sure this is actually worth a separate "setUp".
Depends if this will get shared with any other possible tests (later, presumably).
| """ | ||
| gribapi.grib_set(grib, "productDefinitionTemplateNumber", 1) | ||
| product_definition_template_common(cube, grib) | ||
| product_definition_template_common(cube, grib, full3d_cube) |
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.
Whoops ?!?
Another reason to have more integration tests, if this could get missed.
|
"Otherwise" LGTM 👍 -- short, but if it works that's already proving quite a lot. |
|
@pp-mo Thanks for that, useful pointers, especially the temp_filepath pattern that I didn't know about before. Cool. |
|
Wait a minute though, I still need to delete the save directories that I had before... |
|
@pp-mo @dkillick @kaedonkers Tests now passing. Any more tweaks? |
Maybe just a comment to say that/why it is loading+save a separate reference cube. I'm also interested in your |
|
@pp-mo Yeah I didn't know you could do that either, it was a bit of guesswork that got lucky because the docs are really really vague. |
|
@pp-mo Thanks! |
Round-trip integration tests for hybrid height and hybrid pressure.
Also a small fix for a bit that was forgotten and only revealed in these tests.