codecov[bot]: # [Codecov](https://codecov.io/gh/mir-dataset-loaders/mirdata/pull/249?src=pr&el=h1) Report
> Merging [#249](https://codecov.io/gh/mir-dataset-loaders/mirdata/pull/249?src=pr&el=desc) into [master](https://codecov.io/gh/mir-dataset-loaders/mirdata/commit/ec3eb7820885cad4f1586a6bf493b85c431088e9&el=desc) will **increase** coverage by `0.00%`.
> The diff coverage is `100.00%`.


```diff
@@           Coverage Diff           @@
##           master     #249   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files          20       20           
  Lines        2136     2138    +2     
=======================================
+ Hits         2110     2112    +2     
  Misses         26       26           
```

diff --git a/mirdata/gtzan_genre.py b/mirdata/gtzan_genre.py
index f9806d5..6a55642 100644
--- a/mirdata/gtzan_genre.py
+++ b/mirdata/gtzan_genre.py
@@ -63,6 +63,9 @@ class Track(track.Track):
         self._track_paths = DATA.index[track_id]
 
         self.genre = track_id.split(".")[0]
+        if self.genre == 'hiphop':
+            self.genre = 'hip-hop'
+
         self.audio_path = os.path.join(self._data_home, self._track_paths["audio"][0])
 
     @property

gtzan-genre 'hiphop' vs 'hip-hop'
gtzan_genre uses the genre name 'hiphop', where the jams gtzan_genre schema expects 'hip-hop' so the jams files do not validate.

(Found as part of #241 )
diff --git a/tests/test_gtzan_genre.py b/tests/test_gtzan_genre.py
index 615654f..7378c65 100644
--- a/tests/test_gtzan_genre.py
+++ b/tests/test_gtzan_genre.py
@@ -32,6 +32,11 @@ def test_track():
     assert audio.shape == (663300,)
 
 
+def test_hiphop():
+    track = gtzan_genre.Track('hiphop.00000', data_home=TEST_DATA_HOME)
+    assert track.genre == 'hip-hop'
+
+
 def test_to_jams():
     default_trackid = "country.00000"
     track = gtzan_genre.Track(default_trackid, data_home=TEST_DATA_HOME)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio pytest
apt-get update apt-get install -y gcc libsndfile-dev libsox-fmt-mp3 ffmpeg
3.7
docs/requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==24.2.0
audioread==3.0.1
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
coverage==7.2.7
DALI-dataset==1.1
decorator==5.1.1
exceptiongroup==1.2.2
execnet==2.0.2
idna==3.10
importlib-metadata==6.7.0
importlib-resources==5.12.0
iniconfig==2.0.0
jams==0.3.4
joblib==1.3.2
jsonschema==4.17.3
lazy_loader==0.4
librosa==0.10.2.post1
llvmlite==0.39.1
mido==1.3.3
mir_eval==0.8.2
-e git+https://github.com/mir-dataset-loaders/mirdata.git@65a71956100481e5ac0a5e0d7d515c85987e766e#egg=mirdata
msgpack==1.0.5
numba==0.56.4
numpy==1.21.6
packaging==24.0
pandas==1.3.5
pkgutil_resolve_name==1.3.10
platformdirs==4.0.0
pluggy==1.2.0
pooch==1.8.2
pretty-midi==0.2.10
pycparser==2.21
pyrsistent==0.19.3
pytest==7.4.4
pytest-asyncio==0.21.2
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-xdist==3.5.0
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.31.0
scikit-learn==1.0.2
scipy==1.7.3
six==1.17.0
sortedcontainers==2.4.0
soundfile==0.13.1
soxr==0.3.7
threadpoolctl==3.1.0
tomli==2.0.1
tqdm==4.67.1
typing_extensions==4.7.1
urllib3==2.0.7
youtube-dl==2021.12.17
zipp==3.15.0

name: mirdata
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==24.2.0
      - audioread==3.0.1
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - coverage==7.2.7
      - dali-dataset==1.1
      - decorator==5.1.1
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - idna==3.10
      - importlib-metadata==6.7.0
      - importlib-resources==5.12.0
      - iniconfig==2.0.0
      - jams==0.3.4
      - joblib==1.3.2
      - jsonschema==4.17.3
      - lazy-loader==0.4
      - librosa==0.10.2.post1
      - llvmlite==0.39.1
      - mido==1.3.3
      - mir-eval==0.8.2
      - msgpack==1.0.5
      - numba==0.56.4
      - numpy==1.21.6
      - packaging==24.0
      - pandas==1.3.5
      - pkgutil-resolve-name==1.3.10
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pooch==1.8.2
      - pretty-midi==0.2.10
      - pycparser==2.21
      - pyrsistent==0.19.3
      - pytest==7.4.4
      - pytest-asyncio==0.21.2
      - pytest-cov==4.1.0
      - pytest-mock==3.11.1
      - pytest-xdist==3.5.0
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.31.0
      - scikit-learn==1.0.2
      - scipy==1.7.3
      - six==1.17.0
      - sortedcontainers==2.4.0
      - soundfile==0.13.1
      - soxr==0.3.7
      - threadpoolctl==3.1.0
      - tomli==2.0.1
      - tqdm==4.67.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - youtube-dl==2021.12.17
      - zipp==3.15.0
prefix: /opt/conda/envs/mirdata

tests/test_gtzan_genre.py::test_hiphop
tests/test_gtzan_genre.py::test_track_default_data_home tests/test_gtzan_genre.py::test_track tests/test_gtzan_genre.py::test_to_jams
mirdata/gtzan_genre.py
mirdata/gtzan_genre.py