Skip to content
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

Added Support for retrieving Sea Ice Thickness #62

Merged
merged 11 commits into from
May 10, 2022
Merged

Conversation

TonioF
Copy link
Contributor

@TonioF TonioF commented May 2, 2022

Solves #61. There is also a notebook. The one problem with this commit is that the lat and lon variables are removed from the dataset during normalization, which shouldn't happen. It is, however, not affecting the data variables and a problem that needs to be addressed in xcube, so it is out of this PR's scope.

@TonioF TonioF added the enhancement New feature or request label May 2, 2022
@TonioF TonioF requested a review from pont-us May 2, 2022 11:25
@TonioF TonioF self-assigned this May 2, 2022
Copy link
Member

@pont-us pont-us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine; the requested code changes are very minor.

The demo notebook ran without problem, but the descriptive text still related to the soil moisture notebook from which it had been adapted. It's hard to do change suggestions on notebooks so I updated the text in the notebook and pushed a new commit -- please roll back and/or adapt if you disagree with anything there.

@@ -9,3 +9,5 @@ dependencies:
- python-dateutil >=2.8.1
- xarray >=0.18.2
- xcube >=0.9.0
# for support of cftime with matplotlib (required to run sea ice thickness notebook)
- nc-time-axis >=1.4.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like having an additional dependency here purely for a demo notebook, but I don't really like any of the alternatives I can think of either (rely on the user to install it manually, or add a line to install it in the notebook). Maybe we can keep it here but leave it out of the conda-forge build recipe...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. We can handle it like a dependency that is only required for testing.

if end_date is None:
self.assertIsNone(descriptor.time_range[1])
else:
self.assertEquals(end_date, descriptor.time_range[1])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertEquals(end_date, descriptor.time_range[1])
self.assertEqual(end_date, descriptor.time_range[1])

assertEquals has been deprecated in favour of assertEqual.

self.assertIsNone(descriptor.time_range[1])
else:
self.assertEquals(end_date, descriptor.time_range[1])
self.assertEquals({'sea_ice_thickness', 'quality_flag', 'status_flag',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertEquals({'sea_ice_thickness', 'quality_flag', 'status_flag',
self.assertEqual({'sea_ice_thickness', 'quality_flag', 'status_flag',


def testGetSupportedDataIds(self):
ids = self.sea_ice_handler.get_supported_data_ids()
self.assertEquals({_ENVISAT_DATA_ID, _CRYOSAT_2_DATA_ID}, set(ids))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertEquals({_ENVISAT_DATA_ID, _CRYOSAT_2_DATA_ID}, set(ids))
self.assertEqual({_ENVISAT_DATA_ID, _CRYOSAT_2_DATA_ID}, set(ids))

@@ -0,0 +1,355 @@
# MIT License
#
# Copyright (c) 2020-2021 Brockmann Consult GmbH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Copyright (c) 2020-2021 Brockmann Consult GmbH
# Copyright (c) 2020-2022 Brockmann Consult GmbH

Comment on lines 105 to 106
'checked. The ICDR is based on '
'observations from CryoSat-2 only (from April 2015 onward).'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'checked. The ICDR is based on '
'observations from CryoSat-2 only (from April 2015 onward).'),
'checked. The ICDR is based on observations '
'from CryoSat-2 only (from April 2015 onward).'),

TonioF and others added 2 commits May 10, 2022 11:31
Co-authored-by: Pontus Lurcock <pontus.lurcock@brockmann-consult.de>
Co-authored-by: Pontus Lurcock <pontus.lurcock@brockmann-consult.de>
@TonioF TonioF merged commit 0452c65 into master May 10, 2022
@TonioF TonioF deleted the toniof-61-seaice branch May 10, 2022 09:48
@TonioF
Copy link
Contributor Author

TonioF commented May 10, 2022

Very good update of the notebook, Pont, thank you! I accepted all your changes and will merge now.

This was referenced May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants