Skip to content

Commit

Permalink
Adding loader for CompMusic Carnatic Varnam (#579)
Browse files Browse the repository at this point in the history
* Create script and index

* Create loader and fix index

* Create tests and undo index fix

* Add test resources and fix index again

* Fix test resources

* Add loaders and tests for taala and tonic

* Loader finished

* Update loader with new dataset

* fix loader with new updates

* add testing files and structre function

* core fixes to get the tests passing

* fix carnatic varnam with new dataset updates

* black formatting

* remove unused function

* new version 1.1 [wip]

* remove prints, loader good

* add load notation as exception

* index updated with new version 1.1

* update setup

* fix problem in _metadata

* merging...

* adding testing file and smart open

* shorten test file name

* add Exception is load_notation

* fix problem with exception

* add test coverage

* update remotes, improve docs

* fix remotes

* fix data folder naming in dataset
  • Loading branch information
genisplaja authored Mar 27, 2023
1 parent 8c84e50 commit 496eb4a
Show file tree
Hide file tree
Showing 68 changed files with 2,297 additions and 1,187 deletions.
17 changes: 2 additions & 15 deletions mirdata/datasets/acousticbrainz_genre.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,8 @@ class Track(core.Track):
"""

def __init__(
self,
track_id,
data_home,
dataset_name,
index,
metadata,
):
super().__init__(
track_id,
data_home,
dataset_name,
index,
metadata,
)
def __init__(self, track_id, data_home, dataset_name, index, metadata):
super().__init__(track_id, data_home, dataset_name, index, metadata)

self.path = os.path.normpath(self.get_path("data"))
self.genre = [genre for genre in self.track_id.split("#")[4:] if genre != ""]
Expand Down
37 changes: 6 additions & 31 deletions mirdata/datasets/beatles.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,8 @@ class Track(core.Track):
"""

def __init__(
self,
track_id,
data_home,
dataset_name,
index,
metadata,
):
super().__init__(
track_id,
data_home,
dataset_name,
index,
metadata,
)
def __init__(self, track_id, data_home, dataset_name, index, metadata):
super().__init__(track_id, data_home, dataset_name, index, metadata)

self.beats_path = self.get_path("beat")
self.chords_path = self.get_path("chords")
Expand Down Expand Up @@ -310,30 +297,18 @@ def __init__(self, data_home=None, version="default"):
license_info=LICENSE_INFO,
)

@deprecated(
reason="Use mirdata.datasets.beatles.load_audio",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatles.load_audio", version="0.3.4")
def load_audio(self, *args, **kwargs):
return load_audio(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.beatles.load_beats",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatles.load_beats", version="0.3.4")
def load_beats(self, *args, **kwargs):
return load_beats(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.beatles.load_chords",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatles.load_chords", version="0.3.4")
def load_chords(self, *args, **kwargs):
return load_chords(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.beatles.load_sections",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatles.load_sections", version="0.3.4")
def load_sections(self, *args, **kwargs):
return load_sections(*args, **kwargs)
42 changes: 7 additions & 35 deletions mirdata/datasets/beatport_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,8 @@ class Track(core.Track):
"""

def __init__(
self,
track_id,
data_home,
dataset_name,
index,
metadata,
):
super().__init__(
track_id,
data_home,
dataset_name,
index,
metadata,
)
def __init__(self, track_id, data_home, dataset_name, index, metadata):
super().__init__(track_id, data_home, dataset_name, index, metadata)

self.keys_path = self.get_path("key")
self.metadata_path = self.get_path("meta")
Expand Down Expand Up @@ -270,38 +257,23 @@ def __init__(self, data_home=None, version="default"):
license_info=LICENSE_INFO,
)

@deprecated(
reason="Use mirdata.datasets.beatport_key.load_audio",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatport_key.load_audio", version="0.3.4")
def load_audio(self, *args, **kwargs):
return load_audio(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.beatport_key.load_key",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatport_key.load_key", version="0.3.4")
def load_key(self, *args, **kwargs):
return load_key(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.beatport_key.load_tempo",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatport_key.load_tempo", version="0.3.4")
def load_tempo(self, *args, **kwargs):
return load_tempo(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.beatport_key.load_genre",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatport_key.load_genre", version="0.3.4")
def load_genre(self, *args, **kwargs):
return load_genre(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.beatport_key.load_artist",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.beatport_key.load_artist", version="0.3.4")
def load_artist(self, *args, **kwargs):
return load_artist(*args, **kwargs)

Expand Down
35 changes: 6 additions & 29 deletions mirdata/datasets/billboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,8 @@ class Track(core.Track):
salami_metadata (dict): Metadata of the Salami LAB file
"""

def __init__(
self,
track_id,
data_home,
dataset_name,
index,
metadata,
):
super().__init__(
track_id,
data_home,
dataset_name,
index,
metadata,
)
def __init__(self, track_id, data_home, dataset_name, index, metadata):
super().__init__(track_id, data_home, dataset_name, index, metadata)

self.audio_path = self.get_path("audio")
self.salami_path = self.get_path("salami")
Expand Down Expand Up @@ -516,30 +503,20 @@ def _metadata(self):
}
return metadata_index

@deprecated(
reason="Use mirdata.datasets.billboard.load_audio",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.billboard.load_audio", version="0.3.4")
def load_audio(self, *args, **kwargs):
return load_audio(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.billboard.load_sections",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.billboard.load_sections", version="0.3.4")
def load_sections(self, *args, **kwargs):
return load_sections(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.billboard.load_named_sections",
version="0.3.4",
reason="Use mirdata.datasets.billboard.load_named_sections", version="0.3.4"
)
def load_named_sections(self, *args, **kwargs):
return load_named_sections(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.billboard.load_chords",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.billboard.load_chords", version="0.3.4")
def load_chords(self, *args, **kwargs):
return load_chords(*args, **kwargs)
35 changes: 6 additions & 29 deletions mirdata/datasets/cante100.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,8 @@ class Track(core.Track):
"""

def __init__(
self,
track_id,
data_home,
dataset_name,
index,
metadata,
):
super().__init__(
track_id,
data_home,
dataset_name,
index,
metadata,
)
def __init__(self, track_id, data_home, dataset_name, index, metadata):
super().__init__(track_id, data_home, dataset_name, index, metadata)

self.spectrogram_path = self.get_path("spectrum")
self.f0_path = self.get_path("f0")
Expand Down Expand Up @@ -424,30 +411,20 @@ def _metadata(self):

return metadata

@deprecated(
reason="Use mirdata.datasets.cante100.load_audio",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.cante100.load_audio", version="0.3.4")
def load_audio(self, *args, **kwargs):
return load_audio(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.cante100.load_spectrogram",
version="0.3.4",
reason="Use mirdata.datasets.cante100.load_spectrogram", version="0.3.4"
)
def load_spectrogram(self, *args, **kwargs):
return load_spectrogram(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.cante100.load_melody",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.cante100.load_melody", version="0.3.4")
def load_melody(self, *args, **kwargs):
return load_melody(*args, **kwargs)

@deprecated(
reason="Use mirdata.datasets.cante100.load_notes",
version="0.3.4",
)
@deprecated(reason="Use mirdata.datasets.cante100.load_notes", version="0.3.4")
def load_notes(self, *args, **kwargs):
return load_notes(*args, **kwargs)
Loading

0 comments on commit 496eb4a

Please sign in to comment.