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

Ensure era5-Land does not call ensemble product type #131

Merged
merged 3 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions era5cli/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ def _split_variable_yr(self):

def _product_type(self):
"""Construct the product type name from the options."""
assert not (self.land and self.ensemble), (
'ERA5-Land does not contain Ensemble statistics.'
)

if self.period == 'hourly' and self.ensemble and self.statistics:
# The only configuration to return a list
return [
Expand Down
4 changes: 4 additions & 0 deletions tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ def test_product_type():
producttype = era5._product_type()
assert producttype is None

era5.ensemble = True
with pytest.raises(AssertionError):
producttype = era5._product_type()


def test_check_levels():
"""Test _check_levels function of Fetch class"""
Expand Down