Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upShould `validate_units` be reworked to use the right version of the unitDictionary? #56
Comments
|
I agree - if its creating EML 2.2, it should be validating against the 2.2 unitDictionary. Current dictionary (EML 2.2): related to EDIorg/EMLassemblyline#72 (comment) |
The old version was out of sync with the released version so I've copied it in from upstream Ref ropensci#56
Ref ropensci#56 While `eml_validate` determines the root schema to use when validating, `validate_units` was still defaulting to the version set in `emld_db`. This changes `validate_units` so it uses the appropriate `eml-unitDictionary.xml` file for the root element. I've also added two test files and a test to exercise this so we know validate_units is working correctly now.
In ropensci/emld#56 we updated the eml-unitDictionary file to actually match the released EML 2.2.0 version and this test needed to be updated to match the new document
@jeanetteclark ran into a situation earlier where she was working with an EML 2.1.1 doc but had her
emld_dboption set aseml-2.2.0.As you can see below,
emld/R/eml_validate.R
Line 52 in 4e6db62
emld/R/validate_units.R
Lines 15 to 19 in 4e6db62
With the new machinery in place to automatically detect the appropriate EML schema to validate with from the input doc, this causes her 2.1.1 doc to have its units validated with the EML 2.2.0 unitDictionary.
I consider this just an oversight on my part and would be happy to change this behavior so that the version of the unitDictionary is dependent on the input document and not the global.
What do others think?
PS:
eml_additional_validationis also not version-specific but I think the rules are backwards compatible so that's fine enough for now I think.