snakebids icon indicating copy to clipboard operation
snakebids copied to clipboard

Mandatory vs Optional components in `pybids_inputs`

Open pvandyken opened this issue 2 years ago • 2 comments

Currently if an input is missing, we just print a warning saying no inputs are found and continue with the workflow. If that component is actually needed, you'll typically end up with a key error at some point downstream.

I'd like a way to control this behaviour. Two basic means come to mind:

  • Allow an optional or mandatory attribute which causes missing items to error out immediately or silently continue
  • Have a missing attribute that takes either error, warn, silent

pvandyken avatar May 16 '23 17:05 pvandyken

I'm in favour of the former approach I think, I can't imagine off the top of my head a lot of situations in which you'd want a warning in the case where there's a missing component but still want to continue.

tkkuehn avatar May 26 '23 16:05 tkkuehn

Yeah, the only thing I can think of is if you have an optional component of your workflow that's triggered by having files present. But that's a fairly rickety way to enable-disable features... if it's something worth alerting the user about, you probably want a CLI flag

pvandyken avatar May 26 '23 17:05 pvandyken