Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata functionality #231

Closed
wants to merge 7 commits into from
Closed

Metadata functionality #231

wants to merge 7 commits into from

Conversation

FredrikKarlssonSpeech
Copy link

@FredrikKarlssonSpeech FredrikKarlssonSpeech commented Mar 30, 2020

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.

  • New package dependency: openxlsx

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).

  • Metadata may be edited manually by using the export_metadata and import_metadata functions, and Excel (or a similar product) for manual editing of the intermediate file.
  • Metadata may also be added / overwritten programatically using add_metadata()
  • The user may get the metadata associated with a segment list using bibliographize() in a tidy manner
  • get_metadata may also be used to get all metadata for a database.

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

Fredrik Karlsson added 6 commits July 23, 2019 20:59
… asked to look, and will return lines with all NAs in them.

This fix will allow for segmentlists of type event and NA to be created.
* New package dependency: openxlsx

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).

* Metadata may be edited manually by using the export_metadata and import_metadata functions, and Excel (or a similar product) for manual editing of the intermediate file.

 - Metadata may also be added / overwritten programatically using add_metadata()

* The user may get the metadata associated with a segment list using bibliographize() in a tidy manner
 - get_metadata may also be used to get all metadata for a database.
* New package dependency: openxlsx

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).

* Metadata may be edited manually by using the export_metadata and import_metadata functions, and Excel (or a similar product) for manual editing of the intermediate file.

 - Metadata may also be added / overwritten programatically using add_metadata()

* The user may get the metadata associated with a segment list using bibliographize() in a tidy manner
 - get_metadata may also be used to get all metadata for a database.
 into metadata

# Conflicts:
#	R/emuR-metadata.R
@raphywink
Copy link

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
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link

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
Copy link
Author

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?

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.

2 participants