Skip to content

Fix calorie heat transfer coefficient abbreviations - #1749

Open
HuzaifaChaudary wants to merge 1 commit into
angularsen:masterfrom
HuzaifaChaudary:fix/calorie-heat-transfer-abbreviation
Open

HuzaifaChaudary wants to merge 1 commit into
angularsen:masterfrom
HuzaifaChaudary:fix/calorie-heat-transfer-abbreviation

Conversation

@HuzaifaChaudary

@HuzaifaChaudary HuzaifaChaudary commented Oct 22, 2026 •

Copy link
Copy Markdown

CaloriePerHourSquareMeterDegreeCelsius had the kcal/… abbreviations , and since it also has the Kilo prefix , the generated kilocalorie unit got kkcal/… :

CaloriesPerHourSquareMeterDegreeCelsius=kcal/(h·m²·°C),...
KilocaloriesPerHourSquareMeterDegreeCelsius=kkcal/(h·m²·°C),...

so HeatTransferCoefficient.Parse("1 kcal/(h·m²·°C)") returned 1 calorie per hour , 0.00116 W/(m²·K) instead of 1.163 , and a kilocalorie value printed as kkcal/(h·m²·°C) . the conversion factors were right , only the names were off by the prefix .

the calorie unit now has cal/… and the generated kilocalorie one kcal/… , the same pattern HeatFlux uses for kcal/(h·m²) . the change is in HeatTransferCoefficient.json , the rest is generate-code output . the regenerated HeatTransferCoefficientTestsBase had "4.2 kkcal/(h·m²·°C)" as the expected kilocalorie string before , with the old resource file 84 of its 266 tests fail , with the new one all pass . UnitsNet.Tests on net10.0 , macOS : 52558 passed , the 2 FeetInchesTests de-CH failures happen on master too ( ICU group separator ) .

found by converting one of every unit to its base unit with UnitsNet's own formulas and with pint , then looking at what disagreed . the other differences were definitions , Year365 vs pint's 365.25 days and the like , this was the one real bug . I also checked that each FromBaseToUnitFunc inverts its FromUnitToBaseFunc for the 758 units defined in the json files , they all do , up to floating point rounding .

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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