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

cf.Field.cell_methods returns incorrect results when an invalid identifer is provided #299

Open
davidhassell opened this issue May 30, 2024 · 0 comments · May be fixed by #300
Open

cf.Field.cell_methods returns incorrect results when an invalid identifer is provided #299

davidhassell opened this issue May 30, 2024 · 0 comments · May be fixed by #300
Labels
bug Something isn't working
Milestone

Comments

@davidhassell
Copy link
Contributor

At cfdm v1.11.1.0, when an invalid selection is passed to cfdm.Field.cell_methods, all cell method constructs are returned, rather than none of them as expected:

>>> import cfdm
>>> f = cfdm.example_field(1)
>>> print(f.cell_methods())  # CORRECT output:
Constructs:
{'cellmethod0': <CellMethod: domainaxis1: domainaxis2: mean where land (interval: 0.1 degrees)>,
 'cellmethod1': <CellMethod: domainaxis3: maximum>}
>>> print(f.cell_methods('bad identifier'))  # WRONG output, expected: Constructs: {}
Constructs:
{'cellmethod0': <CellMethod: domainaxis1: domainaxis2: mean where land (interval: 0.1 degrees)>,
 'cellmethod1': <CellMethod: domainaxis3: maximum>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant