DAS-2477 MaskFill raises a MissingCoordinateDataset when lat/lon datasets cannot be found in cf_config.coordinate_overrides or the dataset's 'coordinates' attribute.#10
Conversation
…sets cannot be found
| except InvalidMetadata: | ||
| raise MissingCoordinateDataset(h5_file.filename, coordinate) | ||
|
|
||
| if latitude is None or longitude is None: |
There was a problem hiding this comment.
latitude or longitude could be None so raise the same exception as line 137
There was a problem hiding this comment.
This solution works. But should we be raising an exception when it is returning a None?
Shouldn't we just check for None in the function that is using it? We seem to be ignoring the exception raised and doing a 'pass' anyway?
There was a problem hiding this comment.
Thanks for noticing this, Sudha - I too was fumbling about this construction, but didn't dig deep enough. The exception works, and is ok - we've seen plenty of examples of this style.
Oh - now I recall - this function is called in two contexts. One, the original implementation, needs to raise the exception and let it get handled up the call-stack - as it is "exceptional" in that context. The second case, does not need the exception, but is perhaps not enough to restructure things. I guess I am open to either approach.
There was a problem hiding this comment.
I think raising an exception here was a clearer implementation.
- The calling code already handles MissingCoordinateDataset
- It catches the issue at the source
Question: "We seem to be ignoring the exception raised and doing a 'pass' anyway?"
DAS-2399 originally aimed to check whether the coordinate dataset (lat/lon) consists entirely of fill values dataset_all_fill_value. If so, the dataset cannot be masked, so we log this condition and return early. Otherwise, we proceed with processing the dataset pass
There was a problem hiding this comment.
I guess x and y dimension variables not being named a lat and lon seems normal ICESAT data to me and not an exception to be raised. Just a philosophical opinion.
But this works.
sudha-murthy
left a comment
There was a problem hiding this comment.
The build and test was fine.
The end to end test does not throw an exception.
Just need to add release tags in the change log. Looks like we missed it the last release as well
|
|
I did not run the regression tests as that will be a separate PR. |
Description
MaskFill will raises a
MissingCoordinateDatasetwhen lat/lon datasetscannot be found in
cf_config.coordinate_overridesor the dataset's'coordinates' attribute.
Jira Issue ID
https://bugs.earthdata.nasa.gov/browse/DAS-2477
Local Test Steps
Run the below command in SIT and verify fails
Build local branch
Run the below command localhost and verify PASS
Test TrajectorySubsetter_Regression.ipynb HOSS_Regression.ipynb in Harmony in a Box
Load VScode and open harmony-regression-tests folder
-- Select Kernel: papermill-trajectory-subsetter
-- In "Set the Harmony environment:" cell
-- harmony_host_url = 'http://localhost:3000'
-- Click "Run All" button
-- Verify test runs without issues
-
-- In HOSS_Regression.ipynb
-- Select Kernel: papermill-hoss
-- In "Set the Harmony environment:" cell
-- harmony_host_url = 'http://localhost:3000'
-- Click "Run All" button
-- Verify test runs without issues
Test using das-harmony-regression-test and verify
PR Acceptance Checklist
CHANGELOG.mdupdated to include high level summary of PR changes.docker/service_version.txtupdated if publishing a release.maskfill-X.Y.Z.