IPS-LMU / emuR

The main R package for the EMU Speech Database Management System (EMU-SDMS)
http://ips-lmu.github.io/EMU.html
23 stars 15 forks source link

Metadata functionality #231

Closed FredrikKarlssonSpeech closed 3 years ago

FredrikKarlssonSpeech commented 4 years ago

I orginally developed this functionality within a separate package, but has now worked into emuR. It passes testing within Rstudio and build fine, but "check" fails on my local machine, but the code that fails seems to be unrelated to the metadata functionality.

Metadata may be set for per bundle or for an entire session in "meta_json"-files. Session level metadata will be overwritten by information set in a bundle meta_json (but only for that bundle then of course).

This code addresses the issue #130 and part 1 of #222 (the second part may not be needed I am thinking now).

raphywink commented 4 years ago

Awesome! Really excited about this! Thanks heaps! Unfortunately, I won't get around to reviewing it for a few days because I still have quite a few important things pending. Will get back to you once I have had a look...

FredrikKarlssonSpeech commented 4 years ago

No hurry. I am just pleased with having this done and working. Migration of my tests to a form where they did not mess up all the other tests in the package was more of a challenge than I anticipated so I hope I have managed to sort it now. :-)

raphywink commented 4 years ago

In one of the @example blocks you have a function called articulator:::make_dummy_metafiles(ae) Do you maybe have those meta files anywhere? If so could you send them to me? BTW all of the test and checks are now passing. Strangely enough there was a comma missing in one of the file.path() commands which caused the tests to break...

FredrikKarlssonSpeech commented 4 years ago

Yes, sorry. That function is in the file "helpers_emuR-metadata.R" in tests/testthat.

Perhaps its best to just move that function from the test helpers to a non-exported function in emuR then? And instead call emuR:::make_dummy_metafiles(ae) in the @example block?

raphywink commented 4 years ago

Using ::: is generally not a good idea (CRAN also wouldn't like it I don't think). I'd prefer to maybe move that functionality into emuR::create_emuRdemoData( createAeMetaDataFiles=TRUE) (false default) but I'll have to think about it some more. Will look at this some more over the next few days.

FredrikKarlssonSpeech commented 4 years ago

Actually, the examples were put together before I added the add_metadata function. Now, you could easily rewrite them so that only exposed functions are used. And, they are more illustrative too (I think). I just pushed a new commit to my clone of your repo and hope you will able to fetch that one instead?