-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Dataset.example_media and cache Datacards #84
Conversation
490402b
to
788555e
Compare
ba84a31
to
0943179
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
The Merge Request is defintively useful.
I have added some comments on code organisation for potential readability improvements.
One topic that I can perceive is versioning:
Python Versions
currently only python version 3.9 and 3.10 are supported.
I have tested the new test in tests/test_dataset.py::test_dataset_example_media
against new venvs with these python versions: 3.9, 3.11 and 3.12 (3.10 is broken on my system currently). The test works under 3.9 and 3.11 but under 3.12 I get this error:
E AttributeError: module 'pathlib' has no attribute '_Flavour'
Probably something to do with audeer
?
I have also run all tests against 3.11. What would speak against adding it in pyproject.toml
audb and audbackend versions
I assume forthcoming upgrades to 2.x.x will be dealt with in a follow up issue - but I could not spot it in the backlog.
The error you see with Python 3.12 is |
For |
For me everything is addressed. I do not know how to later approve in github. I would if I did though. Anyway I am happy now and this can imo be merged. |
Thanks. I also don't know how to later approve. I guess it is implicitly assumed that it is approved when all discussions are resolved. Otherwise, I would have to re-request a review, and then you could approve. |
Add caching for results (e.g. PNG files) generated by
audbcards.Datacard
.To achieve this, I did the following:
audbcards.Datacard.example_media
toaudbcards.Dataset.example_media
as it requires access to the dependency table (audbcards.Dataset.deps
), and hence it is better suited to be cached as part ofaudbcards.Dataset
.cache_root
argument toaudbcards.Datacard
. It uses per default the same folder asaudbcards.Dataset
.audbcards.Datacard.file_duration_distribution()
in the cache folder.audbcards.Datacard.player()
in the cache folder.The structure of the stored cache files is (shown by the example for
emodb
):$ tree ~/.cache/audbcards/emodb .../.cache/audbcards/emodb └── 1.4.1 ├── emodb-1.4.1-file-duration-distribution.png ├── emodb-1.4.1-player-media │ └── wav │ └── 13b09La.wav ├── emodb-1.4.1-player-waveform.png └── emodb-1.4.1.pkl
I again tested building the pages for all our datasets and now get:
whereas now most of the time is spend on compiling the HTML pages, and not on gathering information about the datasets.
Updated docstrings: