ropensci / EML

Ecological Metadata Language interface for R: synthesis and integration of heterogenous data
https://docs.ropensci.org/EML
Other
97 stars 33 forks source link

Error with molePerKilogram in unit list returned by get_unitList() #330

Closed earnaud closed 2 years ago

earnaud commented 3 years ago

I am using the unit list returned by get_unitList() in a shiny app to build a list of choice among which the user shall chose a unit. I remove duplicates with the criterion of deprecatedInFavorOf column. But the molePerKilogram unit is duplicated without to be annotated as being deprecated anywhere. The only difference between the two units is the unitType (amountOfSubstanceWeight for one, none for the other)

earnaud commented 3 years ago

Here is a picture of the two units causing the issue. The description row seems to be invalid with the second unit. Also, this second unit has no description.

image

earnaud commented 2 years ago

Hi again ! I corrected some of the values returned by EML::get_unitList(). It concerns mainly the multiplicated units (e.g. millimeter) but also the wordly uncommon values (e.g. feet, inches). I added a unitType to those units, matching their base type despite of their mutiplier. I think this can greatly help to find the correct desired unit.

EMLunits.csv

amoeba commented 2 years ago

Hi @earnaud, thanks for reporting. The two molePerKilogram units does seem like a mistake. This package is largely the result of code-gen from the EML standard so the issue(s) you're seeing originate from there. Any fix could then be propagated to this package with a new release.

It sounds like from https://github.com/ropensci/EML/issues/330#issuecomment-958758116 that you found other issues. Is it easy to summarize them here? If not, I can go through your CSV and cross-reference things.