caracal-pipeline / stimela

Stimela 2.0
GNU General Public License v2.0
5 stars 4 forks source link

Feature request: add option to ignore unknown assignments #336

Open o-smirnov opened 2 months ago

o-smirnov commented 2 months ago

Use case (from TRON) -- we have tron-oservation-sets.yml specifying a whole bunch of options for observations, bands, etc. This is included into the tron recipe via

  assign_based_on:
    _include: tron-observation-sets.yml[optional,warn]

I would like to reuse some of these settings in a smaller recipe, but this doesn't define all the inputs of tron, so including the same file throws "unknown assignment" errors.

Suggest a sensible workaround would be:

  assign_based_on:
     _ignore_unknown_assignments: true  
    _include: tron-observation-sets.yml[optional,warn]

Which would require the assign logic to recognize the _ignore_unknown_assignments key and disable errors.

JSKenyon commented 2 months ago

This would be a very cool feature but in the interest of playing Devil's advocate, is this not becoming a little arcane? Assignments already circumvent type checking (if I am not mistaken), and this means that the final configuration will become a partial combination of all the defined assignments. I wonder if we need to give further thought to what actually defines a working recipe (and whether or not assigning to things which should be inputs is sensible).