Skip to content

Commit b45b878

Browse files
committed
Revert "fix cosmo"
This reverts commit 8f4d844.
1 parent 8f4d844 commit b45b878

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/anemoi/inference/lazy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ def __getattr__(self, name: str):
3434
# with type checking and autocompletion: `from anemoi.inference.lazy import torch`
3535
# note: when used in a type hint, use quotes, e.g. "torch.Tensor" instead of torch.Tensor to avoid triggering the import
3636
if TYPE_CHECKING:
37-
import earthkit.data as ekd
3837
import torch
3938
else:
40-
ekd = LazyModule("earthkit.data")
4139
torch = LazyModule("torch")

tests/unit/test_templates.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import yaml
44
from anemoi.utils.testing import GetTestData
5+
from earthkit.data.readers.grib.codes import GribField
56
from pytest_mock import MockerFixture
67

78
from anemoi.inference.checkpoint import Checkpoint
89
from anemoi.inference.grib.templates.manager import TemplateManager
9-
from anemoi.inference.lazy import ekd
1010
from anemoi.inference.testing import fake_checkpoints
1111

1212

@@ -19,7 +19,7 @@ def test_manager_builtin(mocker: MockerFixture):
1919
manager = TemplateManager(owner)
2020

2121
template = manager.template("2t", state={}, typed_variables=c.typed_variables)
22-
assert isinstance(template, ekd.Field)
22+
assert isinstance(template, GribField)
2323
assert template.metadata("param") == "lsm" # lsm is used as the builtin template for surface fields
2424

2525

@@ -36,7 +36,7 @@ def test_manager_file(mocker: MockerFixture, get_test_data: GetTestData):
3636
manager = TemplateManager(owner, templates=config)
3737

3838
template = manager.template("2t", state={}, typed_variables=c.typed_variables)
39-
assert isinstance(template, ekd.Field)
39+
assert isinstance(template, GribField)
4040
assert template.metadata("param") == "10u" # first field in the file
4141

4242

@@ -62,7 +62,7 @@ def test_manager_samples(mocker: MockerFixture, get_test_data: GetTestData, tmp_
6262
manager = TemplateManager(owner, templates=config)
6363

6464
template = manager.template("2t", state={}, typed_variables=c.typed_variables)
65-
assert isinstance(template, ekd.Field)
65+
assert isinstance(template, GribField)
6666
assert template.metadata("param") == "10u" # first field in the file
6767

6868

0 commit comments

Comments
 (0)