Consolidate parsing into common_functions #211
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into some of these parsing issues again when dealing with the
plots so I went ahead and tried to address some of the issues raised
in #111 (e.g. we're still ignoring unknown arguments in the sub-scripts
called in run_end_to_end.py).
This PR re-factors the adding of parsed arguments into a set
of functions that add related arguments. Each script can then simply
use some of these function as parent parsers when setting up the
ArgumentParser for that script.
Note: there are still some issues with how arguments are passed through
from run_end_to_end to the other scripts. For instance, the scenario
name is required for run_scenario.py but in theory not for
run_end_to_end.py. However, run_end_to_end.py calls run_scenario.py, so
you will get an error message if you don't provide it in
run_end_to_end.py and the error message will be a somewhat confusing
combination of run_end_to_end.py and run_scenario.py
One solution could be to get rid of scenario_id and make scenario a
required argument. The value can be either the ID or the name, and we
can add some functionality to smartly determine what is provided and
get the equivalent name/id from the db (if needed).