Skip to content
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
142 changes: 103 additions & 39 deletions docs/source/how-tos/grib/grib_overview.ipynb

Large diffs are not rendered by default.

754 changes: 377 additions & 377 deletions docs/source/how-tos/grib/grib_to_netcdf.ipynb

Large diffs are not rendered by default.

1,880 changes: 972 additions & 908 deletions docs/source/how-tos/source/data.ipynb

Large diffs are not rendered by default.

114 changes: 89 additions & 25 deletions docs/source/how-tos/source/data_from_stream.ipynb

Large diffs are not rendered by default.

114 changes: 89 additions & 25 deletions docs/source/how-tos/source/file_stream.ipynb

Large diffs are not rendered by default.

238 changes: 183 additions & 55 deletions docs/source/how-tos/xr_engine/xarray_engine_ensemble.ipynb

Large diffs are not rendered by default.

386 changes: 289 additions & 97 deletions docs/source/how-tos/xr_engine/xarray_engine_mono_variable.ipynb

Large diffs are not rendered by default.

128 changes: 103 additions & 25 deletions docs/source/how-tos/xr_engine/xarray_engine_step_ranges.ipynb

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/source/release-notes/version_1.0.0rc_updates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ Version 1.0.0 Release Candidate Updates
///////////////////////////////////////


Version 1.0.0rc6
==================

- Changed the earthkit grid spec attribute in the Xarray generated by the :ref:`Xarray engine <xr_engine>` from "ek_grid_spec" to "earthkit_grid_spec" (:pr:`979`).


Version 1.0.0rc5
==================

- Ensured that the GRIB encoder sets single metadata keys with ``set()`` instead of ``set_multi()`` when there is only one metadata key to set (:pr:`977`).


Version 1.0.0rc4
==================

Expand Down
2 changes: 1 addition & 1 deletion src/earthkit/data/xr_engine/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def build(self, add_earthkit_attrs=True):
self._attrs["_earthkit"] = attrs

if grid_spec is not None:
self._attrs["ek_grid_spec"] = grid_spec
self._attrs["earthkit_grid_spec"] = grid_spec

self._attrs.update(self.fixed_local_attrs)
data = self.data_maker(self.tensor, self.var_dims, self.name)
Expand Down
4 changes: 2 additions & 2 deletions src/earthkit/data/xr_engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,8 @@ def to_device(self, device, *, array_backend=None, array_namespace=None, **kwarg
def grid_spec(self):
"""Return the grid specification of the DataArray."""
try:
if "ek_grid_spec" in self._obj.attrs:
v = self._obj.attrs["ek_grid_spec"]
if "earthkit_grid_spec" in self._obj.attrs:
v = self._obj.attrs["earthkit_grid_spec"]
if isinstance(v, str):
import json

Expand Down
6 changes: 3 additions & 3 deletions tests/xr_engine/test_xr_engine_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test_xr_engine_dims_as_attrs_2(allow_holes, lazy_load, idx, kwargs, coords,
for v in var_attrs:
v_attrs = dict(ds[v].attrs)
v_attrs.pop("_earthkit", None)
v_attrs.pop("ek_grid_spec", None)
v_attrs.pop("earthkit_grid_spec", None)
assert v_attrs == var_attrs[v]
assert ds.attrs == global_attrs

Expand Down Expand Up @@ -355,7 +355,7 @@ def test_xr_engine_dims_as_attrs_3(lazy_load, allow_holes, idx, kwargs, coords,
for v in var_attrs:
v_attrs = dict(ds[v].attrs)
v_attrs.pop("_earthkit", None)
v_attrs.pop("ek_grid_spec", None)
v_attrs.pop("earthkit_grid_spec", None)
assert v_attrs == var_attrs[v]
assert ds.attrs == global_attrs

Expand Down Expand Up @@ -424,7 +424,7 @@ def test_xr_engine_attrs_types(lazy_load, kwargs, coords, dims, attrs):
compare_dims(ds, dims, sizes=True)

for k, v in attrs.items():
if k not in ["_earthkit", "ek_grid_spec"]:
if k not in ["_earthkit", "earthkit_grid_spec"]:
assert ds["t"].attrs[k] == v, f"{k}"


Expand Down
10 changes: 5 additions & 5 deletions tests/xr_engine/test_xr_engine_dims.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def test_xr_ensure_dims(allow_holes, lazy_load, path, sel, kwargs, coords, dims,
for v in var_attrs:
v_attrs = dict(ds[v].attrs)
v_attrs.pop("_earthkit", None)
v_attrs.pop("ek_grid_spec", None)
v_attrs.pop("earthkit_grid_spec", None)
assert v_attrs == var_attrs[v]
assert ds.attrs == global_attrs

Expand Down Expand Up @@ -502,7 +502,7 @@ def test_xr_extra_dims(allow_holes, lazy_load, path, sel, kwargs, coords, dims,
for v in var_attrs:
v_attrs = dict(ds[v].attrs)
v_attrs.pop("_earthkit", None)
v_attrs.pop("ek_grid_spec", None)
v_attrs.pop("earthkit_grid_spec", None)
assert v_attrs == var_attrs[v]
assert ds.attrs == global_attrs

Expand Down Expand Up @@ -660,7 +660,7 @@ def test_xr_engine_level_per_type_dim(lazy_load, path, sel, kwargs, coords, dims
for v in var_attrs:
v_attrs = dict(ds[v].attrs)
v_attrs.pop("_earthkit", None)
v_attrs.pop("ek_grid_spec", None)
v_attrs.pop("earthkit_grid_spec", None)
assert v_attrs == var_attrs[v], f"Variable {v} attributes do not match expected values"
assert ds.attrs == global_attrs

Expand Down Expand Up @@ -766,7 +766,7 @@ def test_xr_engine_dims_as_attrs_1(
for v in var_attrs:
v_attrs = dict(ds[v].attrs)
v_attrs.pop("_earthkit", None)
v_attrs.pop("ek_grid_spec", None)
v_attrs.pop("earthkit_grid_spec", None)
assert v_attrs == var_attrs[v]
assert ds.attrs == global_attrs

Expand Down Expand Up @@ -959,6 +959,6 @@ def test_xr_engine_dims_as_attrs2(lazy_load, path, sel, idx, kwargs, coords, dim
for v in var_attrs:
v_attrs = dict(ds[v].attrs)
v_attrs.pop("_earthkit", None)
v_attrs.pop("ek_grid_spec", None)
v_attrs.pop("earthkit_grid_spec", None)
assert v_attrs == var_attrs[v]
assert ds.attrs == global_attrs
Loading