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

ds.typed_variables no longer works when subsetting a dataset #189

Open
clessig opened this issue Feb 2, 2025 · 0 comments
Open

ds.typed_variables no longer works when subsetting a dataset #189

clessig opened this issue Feb 2, 2025 · 0 comments

Comments

@clessig
Copy link

clessig commented Feb 2, 2025

Describe the bug
A clear and concise description of what the bug is.

ds.typed_variables no longer works when subsetting a dataset

** Version number **
I am using the following versions/branch/sha1 of the anemoi packages
(alternatively the output of pip freeze)

anemoi-datasets==0.5.15
anemoi-transform==0.1.1
anemoi-utils==0.4.11

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Run this '....'
  3. See error

filename = 'aifs-ea-an-oper-0001-mars-o96-1979-2022-6h-v6.zarr'
ds = open_dataset( filename)
dss = open_dataset( ds, frequency='6h', start='1980', end='2020')
tv = ds.typed_variables()

Traceback (most recent call last):
File "", line 1, in
File ".venv/lib/python3.12/site-packages/anemoi/datasets/data/dataset.py", line 299, in typed_variables
constants = self.constant_fields
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Subset' object has no attribute 'constant_fields'

URL to sample input data
Provide a URL to a sample input data, or attach a file to that report if it is small enough.

Expected behavior
A clear and concise description of what you expected to happen.

subsetted ds should behave like those without it

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant