Replies: 4 comments 2 replies
-
Open to more elegant suggestions... the need for a zip-like thingy had occurred to me before, but I'm not settled on whether a more explicit solution is needed or what it should look like. |
Beta Was this translation helpful? Give feedback.
-
Actually for your particular use case the above construct is perfect. I used it in the PARROT recipes: https://github.com/ratt-ru/parrot-stew-recipes/blob/parrot1/parrot-observation-sets.yml#L15 It's perfect because then you have a single-observation recipe you can run standalone (with @Athanaseus has used something similar in his MGPLS recipes, maybe he can link those in here. |
Beta Was this translation helpful? Give feedback.
-
I made a toy recipe to try out the above but I can't seem to get it working. I'm pretty sure there is a bug in the way assign_based_on is treated in a for loop (see below). Here is the recipe cabs:
print_inputs:
flavour: python-code
command: |
print(ms)
print(out)
inputs:
ms:
dtype: str
required: true
out:
dtype: str
required: true
init_loop:
info: xds initialisation loop
assign_based_on:
obs:
F001:
ms: test1
out: out1
F002:
ms: test2
out: out2
assign:
obs: F001
for_loop:
var: obs
over: [F001, F002]
inputs:
input1:
dtype: int
default: 1
input2:
dtype: int
default: 2
steps:
test:
cab: print_inputs
params:
ms: =recipe.obs.ms
out: =recipe.obs.out This is supposed to loop over
I think this is a bug, the
So
for each iteration. So it seems |
Beta Was this translation helpful? Give feedback.
-
This: ms: =recipe.obs.ms
out: =recipe.obs.out should just be ms: =recipe.ms
out: =recipe.out |
Beta Was this translation helpful? Give feedback.
-
From @landmanbester:
In lieu of a better solution, this will do the trick:
Beta Was this translation helpful? Give feedback.
All reactions