swansonk14 / typed-argument-parser

Typed argument parser for Python
MIT License
507 stars 40 forks source link

Expose individual argument parsing for overwriting #86

Open Effervex opened 2 years ago

Effervex commented 2 years ago

This issue is similar to #71, though I believe different enough for a separate issue.

The use-case is as follows: a previous configuration is loaded from json file, with arguments filled in appropriately. However, I would like to update some configuration parameters individually.

So, rather than copy the saved json and edit the values manually, I'd instead like to see a load() method invocation followed by a method to parse individual parameters to defined arguments.

This is currently not possible, as missing non-optional arguments that have not been specified (but have been defined in the loaded json) produce errors.

swansonk14 commented 1 year ago

Hi @Effervex,

Thank you for raising this issue! We think this is a good idea and propose to implement it by adding a flag to load and from_dict and modifying this line to allow the user to suppress the error when required arguments are missing.

Best, Jesse and Kyle