marl / jams

A JSON Annotated Music Specification for Reproducible MIR Research
ISC License
186 stars 27 forks source link

jams.load does not seem to work with one of your example files #199

Closed jeffd75 closed 5 years ago

jeffd75 commented 5 years ago

Hi I have been in trouble building my first JAMS files today. I have been following the example file given in the urinieto/jams repository (ejh_20140224.json) When I do jams.load with this example file, I get the following error message : Traceback (most recent call last): (..) File "/Users/jfducher/ml/myenv/lib/python3.6/site-packages/jams/core.py", line 213, in load jam = JAMS(**json.load(fdesc)) TypeError: init() got an unexpected keyword argument 'beats'

My file starts with chords and not beats, and I get exactly the same kind of error : Traceback (most recent call last): File "preprocessing.py", line 14, in another_jam = jams.load('essai2701219.jams') File "/Users/jfducher/ml/myenv/lib/python3.6/site-packages/jams/core.py", line 213, in load jam = JAMS(**json.load(fdesc)) TypeError: init() got an unexpected keyword argument 'chords'

I don't see anything in the JSON spec that could explain this error ... Can you help me there ?

Thx

bmcfee commented 5 years ago

Thanks for reporting this.

It looks like you're using @urinieto 's fork of JAMS, which is several versions (and 4 years) out of date. Please update to the most recent release (0.3.2 available on pypi).

jeffd75 commented 5 years ago

Thanks for this prompt answer. I have been installing it with pip :

pip3 install jams Collecting jams Downloading https://files.pythonhosted.org/packages/28/b0/82ea2e577d97ec8e1a660fef8115e8e909121c09064c74310b9c346fda8d/**jams-0.3.2**.tar.gz (50kB)

So the package I have installed in my environment seems to be the right one (v 0.3.2). However indeed I have been looking for example files in the examples folder of @urinieto's JAMS repository. It would be a good idea to remove them if they are outdated ;-)

I found the proper folder for examples. Sorry to have bothered you. Looks like the format changed quite a bit ;-(( best regards

bmcfee commented 5 years ago

Yes, the format did change quite a bit. It would be great if @urinieto could freeze / archive that fork to prevent confusion!

That said, you can still load old jams files as plain json. You won't get the niceties of the jams object model, but the data will be intact.