Skip to content

Commit

Permalink
Fixes in black version (#622)
Browse files Browse the repository at this point in the history
* 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 <36072284+rythmm24@users.noreply.github.com>
  • Loading branch information
tanmayy24 and rythmm24 committed Feb 2, 2024
1 parent 2c4ee52 commit c1e3cf9
Show file tree
Hide file tree
Showing 31 changed files with 54 additions and 17 deletions.
27 changes: 16 additions & 11 deletions mirdata/annotations.py
@@ -1,5 +1,6 @@
"""mirdata annotation data types
"""

import logging
import re
from typing import List, Optional, Tuple
Expand Down Expand Up @@ -681,9 +682,9 @@ def to_sparse_index(
nonzero_freqs = (
frequencies_flattened > 0
) # find indexes for frequencies not equal to 0
frequencies_flattened[
frequencies_flattened == 0
] = 1 # change zero frequency value to avoid NaN
frequencies_flattened[frequencies_flattened == 0] = (
1 # change zero frequency value to avoid NaN
)
freq_indexes = closest_index(
np.log(frequencies_flattened)[:, np.newaxis],
np.log(frequency_scale)[:, np.newaxis],
Expand Down Expand Up @@ -1249,9 +1250,11 @@ def convert_pitch_units(pitches, pitch_unit, target_pitch_unit):
# if input is a nested list, call this function recursively
if isinstance(pitches, list) and isinstance(pitches[0], list):
return [
[]
if len(plist) == 0
else list(convert_pitch_units(plist, pitch_unit, target_pitch_unit))
(
[]
if len(plist) == 0
else list(convert_pitch_units(plist, pitch_unit, target_pitch_unit))
)
for plist in pitches
]

Expand Down Expand Up @@ -1319,11 +1322,13 @@ def convert_amplitude_units(amplitude, amplitude_unit, target_amplitude_unit):
# if input is a nested list, call this function recursively
if isinstance(amplitude, list) and isinstance(amplitude[0], list):
return [
[]
if len(alist) == 0
else list(
convert_amplitude_units(
np.array(alist), amplitude_unit, target_amplitude_unit
(
[]
if len(alist) == 0
else list(
convert_amplitude_units(
np.array(alist), amplitude_unit, target_amplitude_unit
)
)
)
for alist in amplitude
Expand Down
1 change: 1 addition & 0 deletions mirdata/core.py
@@ -1,5 +1,6 @@
"""Core mirdata classes
"""

import json
import os
import random
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/acousticbrainz_genre.py
Expand Up @@ -38,6 +38,7 @@
grant agreement No 688382 AudioCommons.
"""

import json
import os

Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/baf.py
Expand Up @@ -110,6 +110,7 @@
Universities and Research of the Department of Business and Knowledge of
the Generalitat de Catalunya. Reference: DI46-2020.
"""

import os
from string import Template
from typing import Tuple, Optional
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/beatport_key.py
Expand Up @@ -23,6 +23,7 @@
Data License: Creative Commons Attribution Share Alike 4.0 International
"""

import csv
import os
import fnmatch
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/candombe.py
Expand Up @@ -17,6 +17,7 @@
Another set of annotations are provided as .beats files in which the bar numbers are removed.
"""

import csv
from typing import BinaryIO, Optional, TextIO, Tuple

Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/cante100.py
Expand Up @@ -44,6 +44,7 @@
For more details, please visit: http://www.cofla-project.com/?page_id=134
"""

import csv
import os
import xml.etree.ElementTree as ET
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/cipi.py
Expand Up @@ -21,6 +21,7 @@
need to be requested. Please do request the dataset here: https://zenodo.org/records/8037327. The dataset can only
be used for open research purposes.
"""

import json
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/dagstuhl_choirset.py
Expand Up @@ -41,6 +41,7 @@
(3) University of Potsdam, DE
(4) Joint Research Centre, European Commission, Seville, ES
"""

import csv
from typing import BinaryIO, Optional, TextIO, Tuple, List

Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/filosax.py
Expand Up @@ -35,6 +35,7 @@
Hence, when opening the dataset, use one of 4 versions: 'full', 'full_sax', 'lite', 'lite_sax'.
"""

import csv
import json
import os
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/giantsteps_tempo.py
Expand Up @@ -65,6 +65,7 @@
3577631.LOFI.mp3 119
"""

from typing import Optional, TextIO, Tuple

from deprecated.sphinx import deprecated
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/groove_midi.py
Expand Up @@ -45,6 +45,7 @@
For more details, please visit: http://magenta.tensorflow.org/datasets/groove
"""

import csv
import os
from typing import BinaryIO, Optional, Tuple
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/guitarset.py
Expand Up @@ -51,6 +51,7 @@
For more details, please visit: http://github.com/marl/guitarset/
"""

import logging
import os
from typing import BinaryIO, Optional, TextIO, Tuple, Dict, List
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/haydn_op20.py
Expand Up @@ -9,6 +9,7 @@
This dataset contains 30 pieces composed by Joseph Haydn in symbolic format, which have each been manually
annotated with harmonic analyses.
"""

import logging
import os
from typing import Optional, TextIO, List
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/idmt_smt_audio_effects.py
Expand Up @@ -32,6 +32,7 @@
DOI
10.5281/zenodo.7544032
"""

import os
import librosa
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/ikala.py
Expand Up @@ -13,6 +13,7 @@
For more details, please visit: http://mac.citi.sinica.edu.tw/ikala/
"""

import csv
import os
from typing import BinaryIO, Optional, TextIO, Tuple
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/irmas.py
Expand Up @@ -88,6 +88,7 @@
For more details, please visit: https://www.upf.edu/web/mtg/irmas
"""

import csv
import os
from typing import BinaryIO, List, Optional, TextIO, Tuple
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/openmic2018.py
Expand Up @@ -34,6 +34,7 @@
For more details, please visit: https://zenodo.org/record/1432913
"""

import json
import re
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/phenicx_anechoic.py
Expand Up @@ -44,6 +44,7 @@
For more details, please visit: https://www.upf.edu/web/mtg/phenicx-anechoic
"""

from typing import BinaryIO, Optional, TextIO, Tuple, cast

from deprecated.sphinx import deprecated
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/rwc_classical.py
Expand Up @@ -49,6 +49,7 @@
For more details, please visit: https://staff.aist.go.jp/m.goto/RWC-MDB/rwc-mdb-c.html
"""

import csv
import os
from typing import BinaryIO, Optional, TextIO, Tuple
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/rwc_jazz.py
Expand Up @@ -40,6 +40,7 @@
For more details, please visit: https://staff.aist.go.jp/m.goto/RWC-MDB/rwc-mdb-j.html
"""

import csv
import os
from typing import Optional, Tuple
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/rwc_popular.py
Expand Up @@ -12,6 +12,7 @@
For more details, please visit: https://staff.aist.go.jp/m.goto/RWC-MDB/rwc-mdb-p.html
"""

import csv
import os
from typing import Optional, TextIO, Tuple
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/salami.py
Expand Up @@ -14,6 +14,7 @@
For more details, please visit: https://github.com/DDMAL/salami-data-public
"""

import csv
import os
from typing import Optional, TextIO, Tuple
Expand Down
15 changes: 9 additions & 6 deletions mirdata/datasets/saraga_hindustani.py
Expand Up @@ -29,6 +29,7 @@
https://mtg.github.io/saraga/, where a really detailed explanation of the data and annotations is published.
"""

import os
import csv
import json
Expand Down Expand Up @@ -307,12 +308,14 @@ def load_tempo(fhandle):
tempo_annotation[sections[section_count]] = {
"tempo": float(tempo) if "." in tempo else int(tempo),
"matra_interval": float(matra) if "." in matra else int(matra),
"sama_interval": float(sama_interval)
if "." in sama_interval
else int(sama_interval),
"matras_per_cycle": float(matras_per_cycle)
if "." in matras_per_cycle
else int(matras_per_cycle),
"sama_interval": (
float(sama_interval) if "." in sama_interval else int(sama_interval)
),
"matras_per_cycle": (
float(matras_per_cycle)
if "." in matras_per_cycle
else int(matras_per_cycle)
),
"start_time": float(start_time) if "." in start_time else int(start_time),
"duration": float(duration) if "." in duration else int(duration),
}
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/slakh.py
Expand Up @@ -25,6 +25,7 @@
For more information see http://www.slakh.com/
"""

import os
from typing import BinaryIO, Optional, Tuple

Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/tonas.py
Expand Up @@ -41,6 +41,7 @@
"""

import csv
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions mirdata/datasets/vocadito.py
Expand Up @@ -15,6 +15,7 @@
For more details, please visit: https://zenodo.org/record/5578807
"""

import csv
import os
from typing import BinaryIO, List, Optional, TextIO, Tuple
Expand Down
1 change: 1 addition & 0 deletions mirdata/jams_utils.py
@@ -1,5 +1,6 @@
"""Utilities for converting mirdata Annotation classes to jams format.
"""

import logging
import os

Expand Down
1 change: 1 addition & 0 deletions tests/datasets/test_candombe.py
@@ -1,5 +1,6 @@
"""Tests for Candombe dataset
"""

import numpy as np
from mirdata import annotations
from mirdata.datasets import candombe
Expand Down
1 change: 1 addition & 0 deletions tests/datasets/test_filosax.py
@@ -1,6 +1,7 @@
"""
Tests for Filosax_Lite
"""

import os
import numpy as np
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_full_dataset.py
Expand Up @@ -2,6 +2,7 @@
This test takes a long time, but it makes sure that the datset can be locally downloaded,
validated successfully, and loaded.
"""

import os
import pytest
import tqdm
Expand Down

0 comments on commit c1e3cf9

Please sign in to comment.