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.
There's a small bug, not sure exactly where. I describe the issue and proposed solution below.
In my program I call extractor() to get features and then top_tag() to get tags in a loop (once per song file). On second iteration of the loop, top_tag() fails on line 75, which contains the statement: print(' - ' + tags[tag_index]). The error is that a string cannot be concatenated with a list(). The cause being that somehow the variable containing the list of tags in configuration.py (either MTT_LABELS or MSD_LABELS depending on parameters) gets appended a list of top tags computed by top_tag().
This issue does not happen if I run top_tag() in a loop alone or extractor() alone, but when I run extractor() followed by top_tag(), on each iteration of the loop the MTT_LABELS or MSD_LABELS gets appended a list of topN_tags.
The easy/shortcut solution is to take a copy of that list (in configuration.py) instead of a pointer to it.