Skip to content

Commit

Permalink
Merge pull request #230 from caracal-pipeline/issue-199
Browse files Browse the repository at this point in the history
Issue 199
  • Loading branch information
o-smirnov authored Feb 13, 2024
2 parents fa75ba5 + 079c658 commit 1cdf38e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stimela/kitchen/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ def do_assign(assignments):
# it will be in subst.recipe if it was assigned, or is an input
if basevar in subst.recipe:
value = str(subst.recipe[basevar])
# else it may be a for-loop index that hasn't been assigned yet -- ignore
elif self.for_loop is not None and basevar == self.for_loop.var:
continue
# else it might be an input with a default, check for that
elif basevar in self.inputs_outputs and self.inputs_outputs[basevar].default is not UNSET:
value = str(self.inputs_outputs[basevar].default)
Expand Down
9 changes: 9 additions & 0 deletions tests/stimela_tests/test_loop_recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ cubical_image_loop:
log:
name: log-{recipe.loop-name}-{info.fqname}

assign_based_on:
loop:
'1':
z: 1
'2':
z: 2
DEFAULT:
z: 3

for_loop:
var: loop
over: [1,2,3]
Expand Down

0 comments on commit 1cdf38e

Please sign in to comment.