Open lebrice opened 2 years ago
Yeah, it needs some love. I find it especially limiting that DataclassWrapper/FieldWrapper do too much by themselves and so injecting new information into the process is hard (e.g. creating a feature that has an effect at the field level but is specified as an argument to add_arguments())
Would be a good idea to refactor the FieldWrapper class a bit. The
args_dict
(a dict of all the argparse arguments for a given field, that get passed toparser.add_arguments
in the FieldWrapper) is currently created using a mix of three things (with increasing priority):default
orprefix
arguments toparser.add_arguments
, etc.parser.add_argument
passed to thefield
function)These three are currently a bit mixed together in the
FieldWrapper
class. It would perhaps be preferable to have them be cleanly separated.