Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

substitutions inside a default don't quite work for sub-recipes #287

Open
o-smirnov opened this issue May 1, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@o-smirnov
Copy link
Member

See tron-breifast for an example.

The breifast subrecipe defines two particular inputs:

    cube:
      dtype: Directory
      required: true
      info: raw (highest) time cadence cube (as .zarr)
    cube-fits:
      dtype: File
      info: raw (highest) time cadence cube (as .fits)
      default: '{current.cube}.fits'

In principle only cube should be needed. However, if the recipe is a sub-recipe of another recipe like so:

  steps:
    breifast:
      recipe: breifast
      params:
          cube: =steps.stack-cube-htc.convolved-cube

then during the prevalidation of the step, current.cube itself is a substitution that's not yet valid at prevalidation time. The substitution error gets frozen into the prevalidated dict. The cube setting is updated by this line, but since cube-fits is not a parameter, it doesn't get updated and ends up throwing the substitution error upwards.

Workaround: specify cube-fits at the step definition.

Proper solutions:

  • anything that's unresolved at prevalidation time should be tossed out from the prevalidated dict when validating the step prior to execution.

  • or, any default setting in the cargo should be copied into the step's param dict (because then it is always revalidated).

@o-smirnov o-smirnov added the bug Something isn't working label May 1, 2024
@o-smirnov o-smirnov added this to the R2.0.1 milestone May 1, 2024
@o-smirnov o-smirnov self-assigned this May 1, 2024
@o-smirnov
Copy link
Member Author

Also related -- should a subrecipe default allow lookup in recipe (referring to itself?) This arises in make_masks in parrot-stew-recipes. Also happens if an alias picks up a default from a step definition referring to recipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant