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

Installed scripts fail when no processing options is set (AttributeError: 'Namespace' object has no attribute 'func') #499

Open
alastair opened this issue Jan 21, 2022 · 0 comments

Comments

@alastair
Copy link

Expected behaviour

I installed madmom in virtualenv from the git repository.
I'm using some of the scripts that are included in the bin/ directory.

Actual behaviour

Many of these scripts fail when run, for example:

$ TempoDetector 
/Users/alastair/code/env/lib/python3.7/site-packages/madmom/features/tempo.py:725: UserWarning: Usage of `method` is deprecated as of version 0.17. Please pass a dedicated `TempoHistogramProcessor` instance as `histogram_processor`.Functionality will be removed in version 0.19.
  'Usage of `method` is deprecated as of version 0.17. '
Traceback (most recent call last):
  File "/Users/alastair/code/env/bin/TempoDetector", line 162, in <module>
    main()
  File "/Users/alastair/code/env/bin/TempoDetector", line 158, in main
    args.func(processor, **vars(args))
AttributeError: 'Namespace' object has no attribute 'func'

It looks like the func value is only set if you choose a processing option (pickle/single/batch/online). In fact, after reading the help text for the scripts, I see that I need to choose a processing method:

$ TempoDetector single
usage: TempoDetector single [-h] [-o OUTFILE] [-j NUM_THREADS] [--online]
                            infile
TempoDetector single: error: the following arguments are required: infile

It would be good if the argparser could properly raise an error if the processing method isn't specified, instead of trying to run anyway.

Steps needed to reproduce the behaviour

virtualenv -p python3.7 env
. env/bin/activate
pip install git+https://github.com/CPJKU/madmom.git
TempoDetector

Information about installed software

Please provide some information about installed software.

0.17.dev0
1.21.5
1.7.3
superbock pushed a commit that referenced this issue Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant