-
Notifications
You must be signed in to change notification settings - Fork 289
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
Add combined GRIB reader for both SEVIRI and FCI L2 products #2717
base: main
Are you sure you want to change the base?
Conversation
Feature/eum l2 grib reader
Thanks for working on this @dnaviap :) Before reviewing in more detail, I think we need some refactoring of the files:
|
…ing the user interface to the reader
Feature/eum l2 grib refactor
The refactoring is complete and tested. |
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.
Thanks for the refactoring! :) See a couple of comments inline.
Can you please also modify the doc-string of the _scale_earth_axis
method to read:
def _scale_earth_axis(data):
"""Scale Earth axis data to make sure the value matched the expected unit [m].
The earthMinorAxis value stored in the MPEF aerosol over sea product prior to December 12, 2022 has the wrong unit and this method provides a flexible work-around by making sure that all earth axis values are scaled such
that they are on the order of millions of meters as expected by the reader.
"""
That was a fix implemented by me a while ago when we noticed some issues in one of the products, and although it has been fixed in the product, the archived files will still have the issue meaning that the fix is still useful to have in the reader.
|
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.
Thanks for the fixes and the refactoring @dnaviap!
I left a couple of minor comments in-line. Could you please also merge the main branch into this branch and resolve the merge conflict such that all unit tests etc. run?
o HEAD # Conflicts: # AUTHORS.md # satpy/readers/eum_l2_grib.py
Fix open issues in combined EUM GRIB2 reader
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2717 +/- ##
==========================================
+ Coverage 95.94% 95.95% +0.01%
==========================================
Files 366 368 +2
Lines 53584 53671 +87
==========================================
+ Hits 51412 51501 +89
+ Misses 2172 2170 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 9743868855Details
💛 - Coveralls |
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.
Nice work, just a couple of comments and questions
from satpy.tests.utils import make_dataid | ||
|
||
|
||
class TestCalculateAreaExtent(unittest.TestCase): |
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.
We try to go over to pytest nowadays, rather that using unittest...
class TestCalculateAreaExtent(unittest.TestCase): | |
class TestCalculateAreaExtent: |
class TestEUML2GribFileHandler(unittest.TestCase): | ||
"""Test the EUML2GribFileHandler reader.""" | ||
|
||
@mock.patch("satpy.readers.eum_l2_grib.ec") | ||
def setUp(self, ec_): | ||
"""Set up the test by creating a mocked eccodes library.""" | ||
fake_gid_generator = (i for i in FAKE_GID) | ||
ec_.codes_grib_new_from_file.side_effect = lambda fh: next(fake_gid_generator) | ||
self.ec_ = ec_ |
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.
We try to go over to pytest nowadays, rather that using unittest. Could you convert this to pytest style instead?
@mock.patch("satpy.readers.eum_l2_grib.xr") | ||
@mock.patch("satpy.readers.eum_l2_grib.da") |
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 see a bit of mocking. In our experience this can lead to problems down the road, and nowadays, we prefer to write a synthetic testing file to tmp_path and work with that instead. Do you think this would be doable for this format?
Add combined GRIB reader that can be used for both SEVIRI and FCI L2 products.
AUTHORS.md