Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error message when the dataset and processing configs are swapped on the command line #56

Open
benkrikler opened this issue Jul 12, 2019 · 1 comment

Comments

@benkrikler
Copy link
Member

The error message, at the moment (v0.12.0), when a user provides the dataset and processing yaml files the wrong way round is not clear at all. This is the current error and backtrace:

$ fast_carpenter --outdir output_test/ configs/explore_example_unbinned_dataframe.yaml samples/control_regions_skim_2017_Nano14Dec2018/WJetsToLNu_HT-200To400.yml 
Traceback (most recent call last):
  File "/afs/cern.ch/user/d/davignon/miniconda2/envs/test_carpenter2/bin/fast_carpenter", line 10, in <module>
    sys.exit(main())
  File "/afs/cern.ch/user/d/davignon/miniconda2/envs/test_carpenter2/lib/python2.7/site-packages/fast_carpenter/__main__.py", line 66, in main
    sequence = fast_flow.read_sequence_yaml(args.sequence_cfg, output_dir=args.outdir)
  File "/afs/cern.ch/user/d/davignon/miniconda2/envs/test_carpenter2/lib/python2.7/site-packages/fast_flow/v1/__init__.py", line 13, in read_sequence_yaml
    return read_sequence_dict(**cfg)
TypeError: read_sequence_dict() takes at least 1 argument (1 given)
(test_carpenter2) [davignon@lxplus606 analysis]$ fast_carpenter --outdir output_test configs/explore_example_unbinned_dataframe.yaml samples/control_regions_skim_2017_Nano14Dec2018/WJetsToLNu_HT-200To400.yml 
Traceback (most recent call last):
  File "/afs/cern.ch/user/d/davignon/miniconda2/envs/test_carpenter2/bin/fast_carpenter", line 10, in <module>
    sys.exit(main())
  File "/afs/cern.ch/user/d/davignon/miniconda2/envs/test_carpenter2/lib/python2.7/site-packages/fast_carpenter/__main__.py", line 66, in main
    sequence = fast_flow.read_sequence_yaml(args.sequence_cfg, output_dir=args.outdir)
  File "/afs/cern.ch/user/d/davignon/miniconda2/envs/test_carpenter2/lib/python2.7/site-packages/fast_flow/v1/__init__.py", line 13, in read_sequence_yaml
    return read_sequence_dict(**cfg)
TypeError: read_sequence_dict() takes at least 1 argument (1 given)

This was hit by @davignon. We need a clearer message to help users, or switch to non-positional arguments for the main command.

@benkrikler
Copy link
Member Author

benkrikler commented Nov 8, 2019

I think the best way to handle this will be to switch from positional command-line arguments to ones indicated with an option but are required. So the command-line would change from:

fast_carpenter datasets.yml steps.yml

to something like:

fast_carpenter -d datasets.yml -s steps.yml

It's also easier to generalise to having other configs, if we do this. However, since this will be a breaking change for current users, I might leave this off for version 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant