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

Suggestion for more informative warning during set_attribute unit check #274

Closed
annakrystalli opened this issue May 17, 2019 · 2 comments
Closed

Comments

@annakrystalli
Copy link
Contributor

Hi!

Thanks for all the work on this very useful package!

I just wanted to make a small suggestion with regards to the warning message thrown during the set_attribute() unit checks, in particular, when the value is missing (NA). I appreciate that one reason a value being NA is because of omission. But I suspect another common reason, which was indeed my case, was that the variable is dimensionless. I assumed initially (admittedly without checking the function manual, that leaving it as NA was most appropriate but that correctly threw a warning:

#> Warning in set_attribute(attributes[i, ], factors = factors, missingValues
#> = missingValues): Unit 'NA' is not a recognized standard unit; treating
#> as custom unit. Please be sure you also define a custom unit in your EML
#> record, or replace with a recognized standard unit. See set_unitList() for
#> details.

After checking the manual, I only found that the field was required but no further guidance on the case where the variable has no units. Eventually I did find the dimensionless entry in the formal EML docs, but it took a little while.

So I did find my solution eventually, so it is fine to ignore this suggestion. But I think a message just mentioning dimensionless units, either in the docs or when the unrecognised unit is NA might both save folks some time + help educate!

@cboettig
Copy link
Member

Thanks @annakrystalli , excellent suggestion. Would you like to make a quick PR against

"or replace with a recognized standard unit. ",

to add a line to the effect that Unitless values should use "dimensionless" as the unit. or something like that?

@annakrystalli
Copy link
Contributor Author

annakrystalli commented May 18, 2019 via email

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

No branches or pull requests

2 participants