Skip to content

Commit c1e3cf9

Browse files
tanmayy24rythmm24
andauthored
Fixes in black version (#622)
* Addition of ballroom * description text update * lint error fix * fixed path * Updated download info * Update in sphinx * Update in sphinx * Update in sphinx * added references * Sphinx version update * update in doc for ballroom * Fixed removal * Fixes in sphinx format * Fixes in sphinx format * Fixes in sphinx format * Fixes in sphinx format * Fixes in sphinx format * Fixes in sphinx format * Fixes in sphinx format * Fixes in sphinx format * Fixes in sphinx format * addition of dataset link * Reverted back the version in requirements.txt * change in ballroom status * Update in ballroom remote * black formatting fixes * black formatting fixes * fixes in black version * fixes in black version --------- Co-authored-by: Tanmay Khandelwal <[email protected]>
1 parent 2c4ee52 commit c1e3cf9

31 files changed

+54
-17
lines changed

mirdata/annotations.py

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""mirdata annotation data types
22
"""
3+
34
import logging
45
import re
56
from typing import List, Optional, Tuple
@@ -681,9 +682,9 @@ def to_sparse_index(
681682
nonzero_freqs = (
682683
frequencies_flattened > 0
683684
) # find indexes for frequencies not equal to 0
684-
frequencies_flattened[
685-
frequencies_flattened == 0
686-
] = 1 # change zero frequency value to avoid NaN
685+
frequencies_flattened[frequencies_flattened == 0] = (
686+
1 # change zero frequency value to avoid NaN
687+
)
687688
freq_indexes = closest_index(
688689
np.log(frequencies_flattened)[:, np.newaxis],
689690
np.log(frequency_scale)[:, np.newaxis],
@@ -1249,9 +1250,11 @@ def convert_pitch_units(pitches, pitch_unit, target_pitch_unit):
12491250
# if input is a nested list, call this function recursively
12501251
if isinstance(pitches, list) and isinstance(pitches[0], list):
12511252
return [
1252-
[]
1253-
if len(plist) == 0
1254-
else list(convert_pitch_units(plist, pitch_unit, target_pitch_unit))
1253+
(
1254+
[]
1255+
if len(plist) == 0
1256+
else list(convert_pitch_units(plist, pitch_unit, target_pitch_unit))
1257+
)
12551258
for plist in pitches
12561259
]
12571260

@@ -1319,11 +1322,13 @@ def convert_amplitude_units(amplitude, amplitude_unit, target_amplitude_unit):
13191322
# if input is a nested list, call this function recursively
13201323
if isinstance(amplitude, list) and isinstance(amplitude[0], list):
13211324
return [
1322-
[]
1323-
if len(alist) == 0
1324-
else list(
1325-
convert_amplitude_units(
1326-
np.array(alist), amplitude_unit, target_amplitude_unit
1325+
(
1326+
[]
1327+
if len(alist) == 0
1328+
else list(
1329+
convert_amplitude_units(
1330+
np.array(alist), amplitude_unit, target_amplitude_unit
1331+
)
13271332
)
13281333
)
13291334
for alist in amplitude

mirdata/core.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Core mirdata classes
22
"""
3+
34
import json
45
import os
56
import random

mirdata/datasets/acousticbrainz_genre.py

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
grant agreement No 688382 AudioCommons.
3939
4040
"""
41+
4142
import json
4243
import os
4344

mirdata/datasets/baf.py

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
Universities and Research of the Department of Business and Knowledge of
111111
the Generalitat de Catalunya. Reference: DI46-2020.
112112
"""
113+
113114
import os
114115
from string import Template
115116
from typing import Tuple, Optional

mirdata/datasets/beatport_key.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Data License: Creative Commons Attribution Share Alike 4.0 International
2424
2525
"""
26+
2627
import csv
2728
import os
2829
import fnmatch

mirdata/datasets/candombe.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
Another set of annotations are provided as .beats files in which the bar numbers are removed.
1818
1919
"""
20+
2021
import csv
2122
from typing import BinaryIO, Optional, TextIO, Tuple
2223

mirdata/datasets/cante100.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
For more details, please visit: http://www.cofla-project.com/?page_id=134
4545
4646
"""
47+
4748
import csv
4849
import os
4950
import xml.etree.ElementTree as ET

mirdata/datasets/cipi.py

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
need to be requested. Please do request the dataset here: https://zenodo.org/records/8037327. The dataset can only
2222
be used for open research purposes.
2323
"""
24+
2425
import json
2526
import logging
2627
import os

mirdata/datasets/dagstuhl_choirset.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
(3) University of Potsdam, DE
4242
(4) Joint Research Centre, European Commission, Seville, ES
4343
"""
44+
4445
import csv
4546
from typing import BinaryIO, Optional, TextIO, Tuple, List
4647

mirdata/datasets/filosax.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
Hence, when opening the dataset, use one of 4 versions: 'full', 'full_sax', 'lite', 'lite_sax'.
3636
3737
"""
38+
3839
import csv
3940
import json
4041
import os

mirdata/datasets/giantsteps_tempo.py

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
3577631.LOFI.mp3 119
6666
6767
"""
68+
6869
from typing import Optional, TextIO, Tuple
6970

7071
from deprecated.sphinx import deprecated

mirdata/datasets/groove_midi.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
For more details, please visit: http://magenta.tensorflow.org/datasets/groove
4646
4747
"""
48+
4849
import csv
4950
import os
5051
from typing import BinaryIO, Optional, Tuple

mirdata/datasets/guitarset.py

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
For more details, please visit: http://github.com/marl/guitarset/
5252
5353
"""
54+
5455
import logging
5556
import os
5657
from typing import BinaryIO, Optional, TextIO, Tuple, Dict, List

mirdata/datasets/haydn_op20.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
This dataset contains 30 pieces composed by Joseph Haydn in symbolic format, which have each been manually
1010
annotated with harmonic analyses.
1111
"""
12+
1213
import logging
1314
import os
1415
from typing import Optional, TextIO, List

mirdata/datasets/idmt_smt_audio_effects.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
DOI
3333
10.5281/zenodo.7544032
3434
"""
35+
3536
import os
3637
import librosa
3738
import numpy as np

mirdata/datasets/ikala.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
For more details, please visit: http://mac.citi.sinica.edu.tw/ikala/
1414
1515
"""
16+
1617
import csv
1718
import os
1819
from typing import BinaryIO, Optional, TextIO, Tuple

mirdata/datasets/irmas.py

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
For more details, please visit: https://www.upf.edu/web/mtg/irmas
8989
9090
"""
91+
9192
import csv
9293
import os
9394
from typing import BinaryIO, List, Optional, TextIO, Tuple

mirdata/datasets/openmic2018.py

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
3535
For more details, please visit: https://zenodo.org/record/1432913
3636
"""
37+
3738
import json
3839
import re
3940
from pathlib import Path

mirdata/datasets/phenicx_anechoic.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
For more details, please visit: https://www.upf.edu/web/mtg/phenicx-anechoic
4545
4646
"""
47+
4748
from typing import BinaryIO, Optional, TextIO, Tuple, cast
4849

4950
from deprecated.sphinx import deprecated

mirdata/datasets/rwc_classical.py

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
For more details, please visit: https://staff.aist.go.jp/m.goto/RWC-MDB/rwc-mdb-c.html
5050
5151
"""
52+
5253
import csv
5354
import os
5455
from typing import BinaryIO, Optional, TextIO, Tuple

mirdata/datasets/rwc_jazz.py

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
For more details, please visit: https://staff.aist.go.jp/m.goto/RWC-MDB/rwc-mdb-j.html
4141
4242
"""
43+
4344
import csv
4445
import os
4546
from typing import Optional, Tuple

mirdata/datasets/rwc_popular.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
For more details, please visit: https://staff.aist.go.jp/m.goto/RWC-MDB/rwc-mdb-p.html
1313
1414
"""
15+
1516
import csv
1617
import os
1718
from typing import Optional, TextIO, Tuple

mirdata/datasets/salami.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
For more details, please visit: https://github.com/DDMAL/salami-data-public
1515
1616
"""
17+
1718
import csv
1819
import os
1920
from typing import Optional, TextIO, Tuple

mirdata/datasets/saraga_hindustani.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
https://mtg.github.io/saraga/, where a really detailed explanation of the data and annotations is published.
3030
3131
"""
32+
3233
import os
3334
import csv
3435
import json
@@ -307,12 +308,14 @@ def load_tempo(fhandle):
307308
tempo_annotation[sections[section_count]] = {
308309
"tempo": float(tempo) if "." in tempo else int(tempo),
309310
"matra_interval": float(matra) if "." in matra else int(matra),
310-
"sama_interval": float(sama_interval)
311-
if "." in sama_interval
312-
else int(sama_interval),
313-
"matras_per_cycle": float(matras_per_cycle)
314-
if "." in matras_per_cycle
315-
else int(matras_per_cycle),
311+
"sama_interval": (
312+
float(sama_interval) if "." in sama_interval else int(sama_interval)
313+
),
314+
"matras_per_cycle": (
315+
float(matras_per_cycle)
316+
if "." in matras_per_cycle
317+
else int(matras_per_cycle)
318+
),
316319
"start_time": float(start_time) if "." in start_time else int(start_time),
317320
"duration": float(duration) if "." in duration else int(duration),
318321
}

mirdata/datasets/slakh.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
For more information see http://www.slakh.com/
2626
2727
"""
28+
2829
import os
2930
from typing import BinaryIO, Optional, Tuple
3031

mirdata/datasets/tonas.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
4242
4343
"""
44+
4445
import csv
4546
import logging
4647
import os

mirdata/datasets/vocadito.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
For more details, please visit: https://zenodo.org/record/5578807
1616
1717
"""
18+
1819
import csv
1920
import os
2021
from typing import BinaryIO, List, Optional, TextIO, Tuple

mirdata/jams_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Utilities for converting mirdata Annotation classes to jams format.
22
"""
3+
34
import logging
45
import os
56

tests/datasets/test_candombe.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for Candombe dataset
22
"""
3+
34
import numpy as np
45
from mirdata import annotations
56
from mirdata.datasets import candombe

tests/datasets/test_filosax.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests for Filosax_Lite
33
"""
4+
45
import os
56
import numpy as np
67
import pytest

tests/test_full_dataset.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
This test takes a long time, but it makes sure that the datset can be locally downloaded,
33
validated successfully, and loaded.
44
"""
5+
56
import os
67
import pytest
78
import tqdm

0 commit comments

Comments
 (0)