File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1616import sys
1717
1818from tests .test_helpers import _create_fresh_local_dir
19+ from wfcommons .wfchef .chef import get_recipe
1920from wfcommons .wfchef .chef import create_recipe
2021from wfcommons .wfchef .chef import install_recipe
2122from wfcommons .wfchef .chef import uninstall_recipe
@@ -123,6 +124,14 @@ def test_recipe_management_functions(self) -> None:
123124 sys .stderr .write (f"✗ Failed to use installed recipe: { e } \n " )
124125 raise
125126
127+ try :
128+ recipe = get_recipe ("somename_recipe" )
129+ generator = WorkflowGenerator (recipe .from_num_tasks (250 ))
130+ except Exception as e :
131+ sys .stderr .write (f"✗ Failed to use get installed recipe by name: { e } \n " )
132+ raise
133+
134+ sys .stderr .write ("✓ Successfully used recipe via direct import and by using get_recipe(name)\n " )
126135
127136 # Uninstall the recipe
128137 sys .stderr .write ("\n " + "=" * 60 + "\n " )
Original file line number Diff line number Diff line change 2323import traceback
2424import sys
2525
26- from typing import Dict , Optional , Union
26+ from typing import Dict , Optional , Union , Type
2727from stringcase import capitalcase
28+ from wfcommons .wfchef .wfchef_abstract_recipe import WfChefWorkflowRecipe
2829
2930from .duplicate import duplicate , NoMicrostructuresError
3031from .find_microstructures import save_microstructures
@@ -166,7 +167,7 @@ def analyzer_summary(path_to_instances: pathlib.Path) -> Dict:
166167 return stats_dict
167168
168169
169- def get_recipe (recipe : str ) -> Optional [ type ] :
170+ def get_recipe (recipe : str ) -> Type [ WfChefWorkflowRecipe ] | None :
170171 """
171172 Load a recipe by name from installed entry points.
172173
You can’t perform that action at this time.
0 commit comments