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

Be smarter about parsing Unit names #19

Open
ChrisBarker-NOAA opened this issue Apr 15, 2020 · 1 comment
Open

Be smarter about parsing Unit names #19

ChrisBarker-NOAA opened this issue Apr 15, 2020 · 1 comment

Comments

@ChrisBarker-NOAA
Copy link
Contributor

ChrisBarker-NOAA commented Apr 15, 2020

The code currently "normalizes" names by removing spaces and capitalization. ANd recently "dot", to support, e.g. m.s-1

But we should probably be smarter. There may be places where spaces and/or capitalization matter.

UDunits, for instance, has an sytax for units where / and . mean something, and Capitalization is significant (so that, e.g. M means Mega, and m means milli -- maybe:-) )

-CHB

@ChrisBarker-NOAA
Copy link
Contributor Author

UDUNITS also accepts a LOT of variations:

meter second-1
meters second-1
meter seconds-1
meters seconds-1
meter s-1
meters s-1

So maybe a way to do this is to use UDUNITS to pre-parse the units.

Hmm -- one problem there -- jsNUCOS is used in WEbClients, and and currently uses the same unit list as PyNUCOS -- but I don't think adding UDUNITS there is an option.

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

1 participant