Skip to content

fmakv2 version added to fma_keys - #694

Open
campeasb wants to merge 1 commit into
mir-dataset-loaders:masterfrom
campeasb:feat/fmak-v2
Open

fmakv2 version added to fma_keys#694
campeasb wants to merge 1 commit into
mir-dataset-loaders:masterfrom
campeasb:feat/fmak-v2

Conversation

@campeasb

Copy link
Copy Markdown

fma_keys: add support for v2 metadata (backward-compatible)

One-liner:
Extend the existing fma_keys dataset to support the v2 metadata/index while keeping full backward compatibility with v1.


Description

This PR extends the existing fma_keys loader to handle a v2 metadata format and index.
There is no new dataset module; changes are limited to fma_keys internals + its top-level docstring.


What’s included

  • Support for the v2 CSV/metadata schema (track id, key, mode, optional Spotify URI, etc.).
  • Backward-compatible handling of both v1 and v2 indices/metadata (auto-detection based on schema).
  • Internal helper(s) for parsing/normalizing v2 fields (keys/modes mapping remains consistent across versions).
  • Docstring update in fma_keys to clearly document:
    • Annotations: track-level key & mode (e.g., C…B; major/minor).
    • Dataset size: ~5,489 tracks (~340 hours), 17 genres.
    • Origin: Free Music Archive subset annotated by an expert musician (perfect pitch, ~20y experience); small cross-annotation subset with high agreement.
    • Music types: multi-genre FMA content.
    • References: include FMA dataset reference (Defferrard et al., 2017) and any dataset notes relevant to key annotations.
    • Access & license: available via Zenodo; non-commercial research use.

Note: Figures above reflect the established FMA Keys dataset characteristics; docstring now explicitly mentions v1 and v2 formats and how they’re handled.


Changes (code)

  • Extend mirdata/datasets/fma_keys.py to parse v2 metadata/index.
  • Preserve existing public API and outputs (no breaking changes).
  • Small refactors for clarity around metadata normalization (keys/modes).

Tests & coverage

  • No new test files added.
  • Existing fma_keys tests continue to pass locally with v1.
  • Local runs confirm v2 parsing paths (where applicable) without impacting coverage (CI will validate).

Documentation

  • Top-level docstring of fma_keys updated to:
    • Describe both v1 and v2 metadata formats.
    • Include size/origin/usage/license info.
    • Link to canonical access (Zenodo) and relevant references.

Dataset loader checklist (adapted)

  • ✅ New script under scripts/… (no new dataset module added in this PR).
  • ✅ New index upload fmakv2_index.1.0.json
  • ✅ Sample/index handling remains aligned with fma_keys.
  • ✅ Loader lives in mirdata/datasets/fma_keys.py (extended, not duplicated).
  • ✅ Tests: no new files; existing tests pass (CI to confirm).
  • ✅ Docs: updated module docstring; table entries unchanged (no new dataset).
  • ✅ Formatting & typing: black, flake8, mypy (CI to validate).
  • tests/test_full_dataset.py on fma_keys (local sanity; CI to validate).
  • ✅ Codecov: no expected decrease.

Notes

  • The PR focuses strictly on versioning support within fma_keys (v1 + v2), not on introducing a separate dataset.
  • Public behavior is unchanged; v2 is parsed transparently.
  • If maintainers prefer, feel free to make small commits on top of this PR to streamline the merge (remove with please-do-not-edit if undesired).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant