signaux-faibles / predictsignauxfaibles

Dépôt du code python permettant la production de liste de prédiction Signaux Faibles.
MIT License
6 stars 1 forks source link

CLI help is not exhaustive #46

Closed vviers closed 3 years ago

vviers commented 3 years ago

Problem

python -m predictsignauxfaibles --help

only returns

usage: main.py [-h] [--model_name MODEL_NAME]

Run model prediction

optional arguments:
  -h, --help            show this help message and exit
  --model_name MODEL_NAME
                        The model to use for prediction. If not provided,
                        models/default will be used

All other optional arguments are not listed

Reason

parser.parse_args() is called twice because default values for optional arguments depend on the value provided for the first parameter 🤯

Solution

default values for params must not depend on other params

slebastard commented 3 years ago

That was an issue with the way that we chose to use argparse with custom train/test/predict set parameters, calling argparse.ArgumentParser.parse_args() twice so as to process the model_name from the first call to get the default values of the other parameters for the second call. After discussing possible ways forward, we will have the following configuration:

vviers commented 3 years ago

Fixed by #51