hgrecco / pint

Operate and manipulate physical quantities in Python
http://pint.readthedocs.org/
Other
2.37k stars 466 forks source link

USCSLengthSurvey group is defined based on the survey foot which is now defunct #1912

Open jacob-indigo opened 8 months ago

jacob-indigo commented 8 months ago

NGS and NIST announced in 2019 that after 2022, the survey foot (based on the 1893 definition of a foot) should no longer be used and all geodetic surveying should be based on the international foot (based on the 1959 definition of a foot). They released the following revised unit conversions: https://www.nist.gov/pml/us-surveyfoot/revised-unit-conversion-factors

Pint is still using the old conversions: https://github.com/hgrecco/pint/blob/29a139f0c31a056e15fbb13e3e6f827b56c4a9bb/pint/default_en.txt#L541C8-L541C24

hgrecco commented 8 months ago

I think we should include this but with a reasonable deprecation warning.

dalito commented 8 months ago

Somewhat related: It would be great to have provenance information on the factors in in the units file. A more extensible file format would help realizing this (https://github.com/hgrecco/pint/discussions/1561).

hgrecco commented 8 months ago

For the current format I have a few ideas that are easy to implement:

Inline

plain

bigstick = 4 stick # The one and only manual

with colon (similar to how attributes were documented at some point)

bigstick = 4 stick #: The one and only manual

with colon and a keyword (like # type :)

bigstick = 4 stick # source: The one and only manual

blocks

Current block syntax

@source The one and only manual
    # everything within this block has the same source
    bigstick = 4 stick
@end

Adding and removing a default source

# source: The one and only manual
# everything without source within this block has the same source

bigstick = 4 stick

# source: 
# This line above set it to blank

In addition, all these could be connected to some form of indirection that could be useful if there is a lot of repetition.

bigstick = 4 stick # source: [1]

# source [1]: The one and only manual

I do not like@source, while consistent with everything else in the definitions file it would make it uglier and difficult to read. I favour a combination of plain and block.

dalito commented 8 months ago

For the current format I like the last form most. It is easy to remember and familiar to most as it matches citing in literature.

jacob-indigo commented 8 months ago

I put up a PR for a first pass at this update. Let me know what you'd like to see from there.