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

Add fractional units representation example #277

Closed
snowman2 opened this issue Jun 11, 2020 · 3 comments
Closed

Add fractional units representation example #277

snowman2 opened this issue Jun 11, 2020 · 3 comments

Comments

@snowman2
Copy link
Contributor

Follow on from: #248

Example: units: 0.245 m

@davidhassell
Copy link
Contributor

Hi @snowman2 - I'm not sure what is being proposed here, as such units are not supported ...

The Udunits syntax that allows scale factors and offsets to be applied to a unit is not supported by this standard. The application of any scale factors or offsets to data should be indicated by the scale_factor and add_offset attributes. Use of these attributes for data packing, which is their most important application, is discussed in detail in Section 8.1, "Packed Data".

... and since #248 has been closed. Please say if I've missed something!

Thanks,
David

@snowman2
Copy link
Contributor Author

snowman2 commented Jun 3, 2021

It works with udunits: pyproj4/pyproj#536 (comment)

>>> from cf_units import Unit
>>> u = Unit("0.5 m")
>>> u.convert(1, "m")
0.5

@JonathanGregory
Copy link
Contributor

It is unclear whether a change is proposed here, so I will close the issue. Feel free to reopen it if there is a question or change to discuss.

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

4 participants