Skip to content

Define gram-force by its conversion to the newton - #143

Merged
ronaldtse merged 1 commit into
mainfrom
fix/gram-force-canonical-conversion
Nov 12, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
fix/gram-force-canonical-conversion

Conversation

@suleman-uzair

Copy link
Copy Markdown
Member

Follow-up to #142. While checking the kilopond fix there, we found that the gram-force entry has the same kind of problem in a more severe form.

Its only root_units entry is kilo times gram-force itself, which says one gram-force equals a thousand gram-force and leaves no way to reach the newton. Every unit defined through it, including the kilogram-force, the kilopond and the pressure units based on them, cannot be converted at all: the Rust engine refuses them and the Ruby engine recurses until it runs out of stack.

This change removes that self-reference and gives gram-force a canonical_conversion to the newton (NISTu11) with factor 0.00980665, the same form bar (NISTu91) uses for its conversion to the pascal. So 1 gf = 9.80665 mN and 1 kp = 1 kgf = 9.80665 N exactly (NPL, "What is the SI unit of force?"; NIST SP 811, Appendix B.9). The record stays root: false, and no identifiers, names or symbols change.

Verification

  • bundle exec ruby validate_schemas.rb passes for all data files, and the identifier and reference validators pass too.
  • Resolving all 380 units by symbol in the Rust engine, 369 give the same results as before. The 11 that change are cwt (US), from Fix the root unit definitions of the US hundredweight and the kilopond #142, and the ten units built on gram-force (gf, kgf, kp, kgf·s²/m, kgf·m, kgf·m/s, gf/cm², kgf/cm², kgf/m², kgf/mm²), each of which now resolves to its exact standard-gravity value instead of being refused.
  • From the data alone, with no caller definitions, the Rust and Ruby engines both give 1 gf = 0.00980665 N, 1 kgf = 1 kp = 9.80665 N, 1 kp = 1000 gf and 1 kgf·m = 9.80665 N·m.

NISTu196 gram-force had a single root_units entry of kilo x NISTu196,
i.e. 1 gf = 1000 gf, a self-reference with no conversion path, so
gram-force and every unit defined through it (kilogram-force,
kilopond and their compounds) could not be converted.

The self-reference is removed and gram-force gets a canonical_conversion
to NISTu11 (newton) with factor 0.00980665, the same form bar (NISTu91)
uses for its conversion to the pascal. 1 gf = 9.80665 mN exactly
(standard gravity, CGPM 1901; NPL "What is the SI unit of force?";
NIST SP 811 Appendix B.9: kgf and kp = 9.80665 N).

The record stays root: false. No identifiers, names or symbols change.
@suleman-uzair
suleman-uzair marked this pull request as ready for review November 12, 2026 10:10
@ronaldtse
ronaldtse merged commit b0b4315 into main Nov 12, 2026
5 checks passed
@ronaldtse
ronaldtse deleted the fix/gram-force-canonical-conversion branch November 12, 2026 10:14
@ronaldtse

Copy link
Copy Markdown
Contributor

Thanks @suleman-uzair !

ronaldtse pushed a commit to suleman-uzair/unitsdb-ts that referenced this pull request Nov 13, 2026
Projected from the public immutable commit b210137 (gram-force
canonical conversion on top of main 035665f, which carries the
cwt (US) and kilopond fixes from #142) with the current projector.
Every record table (units, prefixes, dimensions, quantities, currencies,
scales) is byte-identical to the previous local candidate projection of
the same data tree; only provenance changes (data commit, script and
helper digests). The commit is untagged until UnitsDB releases it.
ronaldtse pushed a commit to unitsml/unitsdb-ts that referenced this pull request Nov 13, 2026
Projected from the public immutable commit b210137 (gram-force
canonical conversion on top of main 035665f, which carries the
cwt (US) and kilopond fixes from #142) with the current projector.
Every record table (units, prefixes, dimensions, quantities, currencies,
scales) is byte-identical to the previous local candidate projection of
the same data tree; only provenance changes (data commit, script and
helper digests). The commit is untagged until UnitsDB releases it.
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

Successfully merging this pull request may close these issues.

2 participants