ropensci / emld

:package: JSON-LD representation of EML
https://docs.ropensci.org/emld
Other
13 stars 6 forks source link

Take another look at new `eml_version` behavior #61

Closed amoeba closed 4 years ago

amoeba commented 4 years ago

I found a situation that's making me rethink the new behavior we added to eml_version that prompts when interactive.

This code, from the EML package README:

me <- list(individualName = list(givenName = "Carl", surName = "Boettiger"))
my_eml <- list(dataset = list(
              title = "A Minimal Valid EML Dataset",
              creator = me,
              contact = me)
            )

write_eml(my_eml, "ex.xml")

triggers the prompt which I think is highly undesirable. emld uses calls like eml_version() all over the place and in places that will get called indirectly when interactive.

I think that having a package helper like eml_version() around is very useful and that we might want to remove the interactive prompt portion and make the calling semantics:

  1. eml_version() returns the current emld_db value, always
  2. eml_version(foo) sets the emld_db value to foo. Can error if foo is not set correctly
cboettig commented 4 years ago

yes, good catch! This proposal sounds good to me.

amoeba commented 4 years ago

Right on. I'll have a look at this some evening this week and send in a patch.