dbekaert / RAiDER

Raytracing Atmospheric Delay Estimation for RADAR
Apache License 2.0
70 stars 39 forks source link

refractor input parsing to be modular and assert correct inputs #78

Open dbekaert opened 4 years ago

dbekaert commented 4 years ago

@Askaholic discussed in other issue tickets to remove duplication on shared input arguments and their syntax between different programs.

In addition we discussed capturing driver errors early one. So, should we also implement a verification that input arguments are supplied correctly, directly after parsing?

Lets discuss below.

Askaholic commented 4 years ago

I think a lot of the input validation can be done in the parsing stage directly by supplying parsing functions through the type parameter.

dbekaert commented 4 years ago

Would you recommend a single location for this for the parser and checks? https://github.com/dbekaert/RAiDER/blob/a3548e9f23d6280629f14bd2a15b75bcb5263f35/tools/RAiDER/statsPlot.py#L23

Few examples for discussion stimulation:

Askaholic commented 4 years ago

Yea I'm thinking some directory structure like this:

RAiDER/
    cli/
        __init__.py
        validators.py
        parser.py

We would put the parameter parsing functions in validators.py. I think you're pretty much free to do as much input validation as you want in the parsing functions even checking that files exist etc: https://docs.python.org/3/library/argparse.html#type

jlmaurer commented 4 years ago

@dbekaert do you want to close this issue re #82 or leave it open for further work? @Askaholic notes that more could be done.

Askaholic commented 4 years ago

Don't close it, it's far from being done.