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

Implement era5 land #21

Merged
merged 18 commits into from
Aug 15, 2023
Merged

Implement era5 land #21

merged 18 commits into from
Aug 15, 2023

Conversation

geek-yang
Copy link
Member

Support ERA5 land dataset in zampy.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@geek-yang geek-yang marked this pull request as ready for review August 9, 2023 08:14
Copy link
Contributor

@BSchilperoort BSchilperoort left a comment

Choose a reason for hiding this comment

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

Good job, everything works well 🚀

I just left some comments on reorganizing the code and inheriting more.

src/zampy/datasets/era5.py Outdated Show resolved Hide resolved
src/zampy/datasets/utils.py Outdated Show resolved Hide resolved
src/zampy/datasets/era5_land.py Outdated Show resolved Hide resolved
src/zampy/datasets/era5_land.py Outdated Show resolved Hide resolved
@geek-yang
Copy link
Member Author

Ok...Linter fails because of another abstract class thingy, due to protocol. Apparently the latest release of mypy is quite picky about abstract class.

@BSchilperoort
Copy link
Contributor

BSchilperoort commented Aug 14, 2023

It would be nice to keep the type hint here though:

DATASETS: dict[str, type[dataset_protocol.Dataset]] = {

Perhaps use Union[type[dataset_protocol.Dataset], type[ECMWFDataset]]? Then we get type checking in the recipe runner, otherwise the datasets there would resolve to Any.

Although I would have thought we can just provide the protocol as type and things should work: https://mypy.readthedocs.io/en/stable/protocols.html#simple-user-defined-protocols

Perhaps ECMWFDataset needs to subclass protocol as well... see: https://mypy.readthedocs.io/en/stable/protocols.html#defining-subprotocols-and-subclassing-protocols 🤔

src/zampy/datasets/__init__.py Outdated Show resolved Hide resolved
src/zampy/datasets/era5.py Outdated Show resolved Hide resolved
src/zampy/datasets/utils.py Outdated Show resolved Hide resolved
src/zampy/datasets/era5_land.py Outdated Show resolved Hide resolved
src/zampy/datasets/era5.py Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Aug 15, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

98.7% 98.7% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@BSchilperoort BSchilperoort left a comment

Choose a reason for hiding this comment

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

Thanks for making these last changes. Let's merge! 🚀

@geek-yang geek-yang merged commit 08a7ee4 into main Aug 15, 2023
14 checks passed
@geek-yang geek-yang deleted the implement-era5-land branch August 15, 2023 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants