Commit 5f2973f
authored
fix: xarray-zarr filters (#457)
## Description
The PR solves an issue where filters didn't work with xarray-zarr
sources
## What problem does this change solve?
This is a bugfix for two issues:
- In `XArrayField.to_numpy()` with `flatten=True`, the output is
`values.values.flatten()` but for `flatten=False` the output is only
`values` where it should be `values.values` to actually get the numpy
array.
- XArrayMetadata contains both 'variable' and 'param' so grouping by the
metadata doesn't work because GroupByParam._get_groups only takes param
into account by popping it and looking at the remaining metadata. If the
remaining metadata matches then the params are grouped together. This
doesn't work when variable is also there, because now the remaining
metadata doesn't match
## What issue or task does this change relate to?
#456
## Additional notes ##
***As a contributor to the Anemoi framework, please ensure that your
changes include unit tests, updates to any affected dependencies and
documentation, and have been tested in a parallel setting (i.e., with
multiple GPUs). As a reviewer, you are also responsible for verifying
these aspects and requesting changes if they are not adequately
addressed. For guidelines about those please refer to
https://anemoi.readthedocs.io/en/latest/***
By opening this pull request, I affirm that all authors agree to the
[Contributor License
Agreement.](https://github.com/ecmwf/codex/blob/main/Legal/contributor_license_agreement.md)1 parent 2d810e3 commit 5f2973f
1 file changed
+4
-4
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
0 commit comments