datalad / datalad-gooey

A graphical user interface for DataLad (datalad.org)
https://docs.datalad.org/projects/gooey
Other
4 stars 6 forks source link

Discontinue use of argparse specifications #302

Closed mih closed 1 year ago

mih commented 1 year ago

Both Gooey and the Python API do not benefit from argparse-specific parameter settings like nargs=2 or action='append'.

If they would be converted into actual constraints, a meaningful parameter validation would be possible.

I currently believe that this is possible via further nesting. In case of nargs, any constraint is qrapped into EnsureListOf(thatconstraint) indicating the exact or minimum number of items required (and potentially ORed with the original constraint. In case of action='append' another layer around the constraint is created.