-
Notifications
You must be signed in to change notification settings - Fork 1
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
Filtering for a list of media files results in an error if the requested media format is not the original one #318
Comments
Thanks for reporting. audb.load(
NAME,
version=VERSION,
tables=['a'],
media=['a.flac'],
format='wav',
verbose=False,
) as this allows to first filter the files, e.g. db = audb.load(NAME, version=VERSION, tables=['a'], only_metadata=True)
audb.load(
NAME,
version=VERSION,
tables=['a'],
media=db.files[0],
format='wav',
verbose=False,
)
>>> audb.load(NAME, version=VERSION, tables=['a'], media=['a.flac'], format='wav', verbose=False)
...
KeyError: 'a.flac'
|
Sorry, it works for audb.load(
NAME,
version=VERSION,
tables=['a'],
media=['a.flac'],
format='wav',
verbose=False,
cache_root='.',
) returns
|
So, the only remaining question here is if we should support the following as well: audb.load(
NAME,
version=VERSION,
tables=['a'],
media=['a.wav'],
format='wav',
verbose=False,
cache_root='.',
) or if we should extend the documentation of the |
Either way would be fine from my point of view. I was facing this bug when I was re-using code for several databases (loading one database, filtering media files, and then re-loading with a selected list of media files). |
The problem with allowing for using also So for now, I would be more in favor of extending the docstrings instead of changing the current behavior. |
Makes totally sense and won't break anything. |
Description
If a list of
media
files is requested when loading a database and the format (e.g., flac/wav) is not the "raw" format of the database, filtering for media files will result in an error.This behaviour is found for both
audb.load(media=...)
andaudb.load_media()
.Version
audb==1.5.1
(but found also in previous versions)Example
Reason
When filtering for media with
load()
,filter_deps()
is called with the original filenamesdb.files
In
core/load.py
, ll. 1132-:while file extensions are not corrected until ll.1165-:
Similarly,
load_media
considersdeps.media
as available files:ll.1479-
The text was updated successfully, but these errors were encountered: