Skip to content

Commit 97c8874

Browse files
authored
fix: Further improve typing on registry (#249)
## Description Further improve typing on registry ***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 f9316a1 commit 97c8874

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/anemoi/utils/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def is_registered(self, name: str) -> bool:
230230
LOG.info(f"Registered: {e} ({self._sources.get(e)})")
231231
return ok
232232

233-
def lookup(self, name: str, *, return_none: bool = False) -> Callable | None:
233+
def lookup(self, name: str, *, return_none: bool = False) -> type[T] | None:
234234
"""Lookup a factory by name.
235235
236236
Parameters
@@ -264,7 +264,7 @@ def lookup(self, name: str, *, return_none: bool = False) -> Callable | None:
264264
return factory
265265

266266
@cached_property
267-
def factories(self) -> dict[str, Callable]:
267+
def factories(self) -> dict[str, type[T]]:
268268

269269
directory = sys.modules[self.package].__path__[0]
270270

0 commit comments

Comments
 (0)