Repository navigation
Fix Tesla BaseUnits to match MagneticField dimensions - #1734
Open
tmilnthorp wants to merge 1 commit into
Open
tmilnthorp wants to merge 1 commit into
tmilnthorp wants to merge 1 commit into
Conversation
Tesla is kg·s⁻²·A⁻¹, but its BaseUnits were defined as meter, kilogram and ampere: length instead of time. This also propagated to the derived BaseUnits of nanotesla, microtesla and millitesla. Add a test that every unit's BaseUnits covers exactly its quantity's BaseDimensions. StandardVolumeFlow is exempt, since it is dimensioned as mass flow while its units are defined by standard volume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XKhDsyHDc5BHrmibxScqG
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1734 +/- ##
======================================
Coverage 98% 98%
======================================
Files 515 515
Lines 24092 24092
======================================
Hits 23692 23692
Misses 400 400
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MagneticFieldis dimensioned as M·T⁻²·I⁻¹ (tesla = kg·s⁻²·A⁻¹), but theTeslaunit'sBaseUnitswere defined as meter, kilogram and ampere. That's length instead of time. The wrong set also carried over to the derivedBaseUnitsof nanotesla, microtesla and millitesla.Changes
Common/UnitDefinitions/MagneticField.json: replaceL: MeterwithT: Secondin Tesla'sBaseUnits.MagneticField.g.cs. Only the four tesla-familyBaseUnitslines change.UnitBaseUnits_CoverExactlyTheQuantityBaseDimensions: for every quantity, each unit with definedBaseUnitsmust specify exactly the base dimensions the quantity has.StandardVolumeFlowis exempt. It is dimensioned as mass flow (M·T⁻¹), but its units are defined by standard volume (L³·T⁻¹), so itsBaseUnitsintentionally differ.Testing
MagneticField.UnitsNet.Testson net10.0: 52,558 passed, 2 failed. The two failures areFeetInchesTests.TryParseFeetIncheswithde-CH. They fail the same way on unmodifiedmaster(see draft Fix feet/inches parsing with apostrophe grouping #1724).🤖 Generated with Claude Code
https://claude.ai/code/session_012XKhDsyHDc5BHrmibxScqG