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

Design decision: easily parsable unit definitions #5

Open
avirshup opened this issue Sep 16, 2016 · 6 comments
Open

Design decision: easily parsable unit definitions #5

avirshup opened this issue Sep 16, 2016 · 6 comments

Comments

@avirshup
Copy link
Contributor

avirshup commented Sep 16, 2016

This is a consequence of the requirement that all quantities include units - #2

Anyone parsing the file format will need to be able to parse the physical units of all the numbers, so there needs to be an agreed-upon standard.

This is easy for names like angstrom or eV. It becomes more complicated for units like angstrom/eV or fs^2/hectare - and ideally, we don't want to require anyone supporting this format to have to write their own mathematical parser.

@avirshup
Copy link
Contributor Author

From @jchodera on Slack:

@avirshup
Copy link
Contributor Author

avirshup commented Sep 16, 2016

Another possibility is to require units in the form {unit1:exponent1, unit2:exponent2, ...}, e.g.

{...,
 velocities: {value: [ [1,2,3], [-1, -2, -3]],
              units: {'angstrom':1, 'femtosecond':-1}},
 ...}

I like this only because it doesn't require anyone to parse mathematical notation.

@davidlmobley
Copy link
Contributor

I'll revisit this later, but I had to chuckle at square femtoseconds per hectare...

@egonw
Copy link

egonw commented Sep 17, 2016

The QUDT ontology may fulfill this and has the math in the ontology to make unit changes, e.g. convert fs to s... the Java library jQUDT does that.

@davidlmobley
Copy link
Contributor

Another possibility is to require units in the form {unit1:exponent1, unit2:exponent2, ...}, e.g.

@avirshup - that seems acceptable to me if there are no other good alternatives; I don't know anything about the QUDT stuff that @egonw mentioned but it should be looked at, I think!

@egonw
Copy link

egonw commented Sep 24, 2016

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

3 participants