Repository navigation
fix(conversions): use the exact pascal factor in pressure_conversion - #15811
Open
Bhaveshmeghwal21 wants to merge 1 commit into
Open
Bhaveshmeghwal21 wants to merge 1 commit into
Bhaveshmeghwal21 wants to merge 1 commit into
Conversation
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.
Describe your change
pressure_conversionconverts through atm (value * from_factor * to_factor). Thepascalentry used0.0000098atm per pascal, but 1 Pa is 1/101325 atm = 9.86923e-6, the valuekilopascalalready uses (0.00986923). So every conversion from pascal came out about 0.7% low:The factor is now
0.00000986923. The pascal to psi doctest held the wrong output (0.000144), so I updated it to the corrected value (0.000145037; 1 Pa is 0.000145038 psi) and added a doctest for 101325 Pa = 1 atm. The doctest edit can't go in a separate PR: the old expected value came from the wrong factor, so it fails as soon as the factor is fixed.With this change
from_factor * to_factoris 1 (within 3e-6) for every unit in the table.pascalwas the only entry that was far off (0.993).Checklist