Skip to content

Commit 26e5cf2

Browse files
committed
Move loaders to CSET.loaders
1 parent 3d77f42 commit 26e5cf2

File tree

10 files changed

+8
-9
lines changed

10 files changed

+8
-9
lines changed

src/CSET/recipes/loaders/__init__.py renamed to src/CSET/loaders/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
__all__ below.
2020
"""
2121

22-
from CSET.recipes.loaders import (
22+
from CSET.loaders import (
2323
aoa,
2424
histograms,
2525
profiles,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/CSET/recipes/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,11 @@ def asdict(self) -> dict:
272272
def load_recipes(variables: dict[str, Any]) -> Iterable[RawRecipe]:
273273
"""Load recipes enabled by configuration.
274274
275-
Recipes are loaded using all loaders (python modules) in
276-
CSET.recipes.loaders. Each of these loaders must define a function with the
277-
signature `load(v: dict) -> Iterable[RawRecipe]`, which will be called with
278-
`variables`.
275+
Recipes are loaded using all loaders (python modules) in CSET.loaders. Each
276+
of these loaders must define a function with the signature `load(conf: dict)
277+
-> Iterable[RawRecipe]`, which will be called with `variables`.
279278
280-
A minimal example can be found in `CSET.recipes.loaders.test`.
279+
A minimal example can be found in `CSET.loaders.test`.
281280
282281
Parameters
283282
----------
@@ -295,10 +294,10 @@ def load_recipes(variables: dict[str, Any]) -> Iterable[RawRecipe]:
295294
When a loader doesn't provide a `load` function.
296295
"""
297296
# Import here to avoid circular import.
298-
import CSET.recipes.loaders
297+
import CSET.loaders
299298

300299
config = Config(variables)
301-
for loader in CSET.recipes.loaders.__all__:
300+
for loader in CSET.loaders.__all__:
302301
logger.info("Loading recipes from %s", loader)
303-
module = getattr(CSET.recipes.loaders, loader)
302+
module = getattr(CSET.loaders, loader)
304303
yield from module.load(config)

0 commit comments

Comments
 (0)