Skip to content

Commit

Permalink
Make example media path deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed May 2, 2024
1 parent 0943179 commit e1957e1
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions audbcards/core/datacard.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,14 @@ def load_media_to_cache(cache_example_media: str):
cache_example_media: full path to media file in cache
"""
# Path to corresponding media files in audb
media_src_dir = (
f"{audb.default_cache_root()}/"
f"{audb.flavor_path(self.dataset.name, self.dataset.version)}"
)
audb.load_media(
media = audb.load_media(
self.dataset.name,
self.dataset.example_media,
version=self.dataset.version,
verbose=False,
)
)[0]
audeer.mkdir(os.path.dirname(cache_example_media))
shutil.copy(
os.path.join(media_src_dir, self.dataset.example_media),
cache_example_media,
)
shutil.copy(media, cache_example_media)

# Add plot of waveform
if self.sphinx_src_dir is not None:
Expand Down

0 comments on commit e1957e1

Please sign in to comment.