Ingredient wrapper package¶
-
class
ingredient_wrapper.Ingredient(*args, ingredients=[], inherit=True, **kwargs)[source]¶ Bases:
sacred.ingredient.IngredientWrapper around Sacred Ingredient
This wrapper serves the purpose to make config entries, and commands directly available to inheriting ingredients, and avoids nesting of configs.
Examples
ingred1 = sacred.Ingredient("ingred1") @ingred1.config def config1(): param1 = ... ingred2 = sacred.Ingredient("ingred2", ingredients=[ingred1]) @ingred2.capture def func(ingred1): use(ingred1["param1"]) vs ingred1 = wrapper.Ingredient("ingred1") @ingred1.config def config1(): param1 = ... ingred2 = wrapper.Ingredient("ingred2", ingredients=[ingred1]) @ingred2.capture def func(param1): use(param1)
-
Same as sacred.Ingredient, except
-
inherit¶ bool – If true, ingredient does not nest config entries, else it behaves just like a sacred ingredient.
-