Skip to content

Commit

Permalink
Merge pull request #370 from caracal-pipeline/issue-304
Browse files Browse the repository at this point in the history
fixes #304
  • Loading branch information
o-smirnov authored Mar 3, 2025
2 parents 757f6fc + 66081bc commit 7676505
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions stimela/kitchen/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,8 @@ def prevalidate(self, params: Dict[str, Any], subst: Optional[SubstitutionNS]=No
subst = SubstitutionNS()
info = SubstitutionNS(fqname=self.fqname, taskname=self.fqname, label='', label_parts=[], suffix='')
# mutable=False means these sub-namespaces are not subject to {}-substitutions
subst._add_('info', info.copy(), nosubst=True)
subst._add_('info', info, nosubst=True)
subst._add_('self', info, nosubst=True)
subst._add_('config', self.config, nosubst=True)
subst._add_('steps', {}, nosubst=True)
subst._add_('previous', {}, nosubst=True)
Expand All @@ -777,7 +778,9 @@ def prevalidate(self, params: Dict[str, Any], subst: Optional[SubstitutionNS]=No
subst._add_('parent', subst_outer.recipe, nosubst=True)
else:
subst_outer = SubstitutionNS()
subst_outer._add_('info', info.copy(), nosubst=True)
info1 = info.copy()
subst_outer._add_('info', info1, nosubst=True)
subst_outer._add_('self', info1, nosubst=True)
subst_outer._add_('config', self.config, nosubst=True)
subst_outer.current = subst.recipe

Expand Down Expand Up @@ -954,6 +957,7 @@ def validate_inputs(self, params: Dict[str, Any], subst: Optional[SubstitutionNS
subst = SubstitutionNS()
info = SubstitutionNS(fqname=self.fqname)
subst._add_('info', info, nosubst=True)
subst._add_('self', info, nosubst=True)
subst._add_('config', self.config, nosubst=True)

subst.recipe = SubstitutionNS(**params)
Expand Down Expand Up @@ -1196,7 +1200,9 @@ def _run(self, params: Dict[str, Any], subst: Optional[Dict[str, Any]] = None, b

info = SubstitutionNS(fqname=self.fqname, label='', label_parts=[], suffix='', taskname=taskname)
# nosubst=True means these sub-namespaces are not subject to {}-substitutions
subst._add_('info', info.copy(), nosubst=True)
info1 = info.copy()
subst._add_('info', info1, nosubst=True)
subst._add_('self', info1, nosubst=True)
subst._add_('config', self.config, nosubst=True)
subst._add_('steps', {}, nosubst=True)
subst._add_('previous', {}, nosubst=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/stimela_tests/test_aliasing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ recipe:
params:
c: 2
params:
a: '{info.fqname}'
a: '{self.fqname}'

0 comments on commit 7676505

Please sign in to comment.