Skip to content

Add units to ForceChangeRate, PressureChangeRate, fix abbreviations - #914

Merged
angularsen merged 3 commits into
angularsen:masterfrom
n-tiz:master
Apr 9, 2021
Merged

Add units to ForceChangeRate, PressureChangeRate, fix abbreviations#914
angularsen merged 3 commits into
angularsen:masterfrom
n-tiz:master

Conversation

@n-tiz

@n-tizn-tiz commented Apr 1, 2021

Copy link
Copy Markdown
Contributor

Add new units:

  • ForceChangeRate: PoundForcePerMinute and PoundForcePerSecond
  • PressureChangeRate: PoundForcePerSquareInchPerSecond and PoundForcePerSquareInchPerMinute

Add new abbreviations:

  • Pressure: PoundForcePerSquareInch (ksi)

Fixed translation:

  • PressureChangeRate : Russians abbreviations for units per minutes

… and fix translations
Add new units:
- ForceChangeRate: PoundForcePerMinute and PoundForcePerSecond
- PressureChangeRate: PoundForcePerSquareInchPerSecond and PoundForcePerSquareInchPerMinute
Add new abbreviations:
- Pressure: PoundForcePerSquareInch (ksi)
Fixed translation:
- PressureChangeRate : Russians abbreviations for units per minutes
@codecov

codecovBot commented Apr 1, 2021

Copy link
Copy Markdown

Codecov Report

Merging #914 (0f2fa80) into master (6bd8b26) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@ Coverage Diff @@## master #914 +/- ##
========================================
+ Coverage 82.7% 82.8% +0.1% 
========================================
Files 291 291 Lines 44035 44148 +113 ========================================
+ Hits 36415 36528 +113 
Misses 7620 7620 
Impacted FilesCoverage Δ
UnitsNet/GeneratedCode/UnitAbbreviationsCache.g.cs100.0% <ø> (ø)
...neratedCode/NumberToForceChangeRateExtensions.g.cs100.0% <100.0%> (ø)
...atedCode/NumberToPressureChangeRateExtensions.g.cs100.0% <100.0%> (ø)
UnitsNet/GeneratedCode/Quantities/Force.g.cs83.7% <100.0%> (ø)
...sNet/GeneratedCode/Quantities/ForceChangeRate.g.cs82.4% <100.0%> (+1.5%)⬆️
...t/GeneratedCode/Quantities/PressureChangeRate.g.cs81.7% <100.0%> (+2.5%)⬆️
UnitsNet/GeneratedCode/UnitConverter.g.cs100.0% <100.0%> (ø)
...GeneratedCode/NumberToMagneticFieldExtensions.g.cs100.0% <0.0%> (ø)
UnitsNet/QuantityFormatter.cs94.9% <0.0%> (+0.5%)⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bd8b26...0f2fa80. Read the comment docs.

@angularsenangularsen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks almost good to go, just a few observations.

Comment threadCommon/UnitDefinitions/ForceChangeRate.json Outdated
Comment threadCommon/UnitDefinitions/PressureChangeRate.json
Comment threadUnitsNet.Tests/CustomCode/ForceChangeRateTests.cs
Comment threadUnitsNet.Tests/CustomCode/PressureChangeRateTests.cs
Comment threadUnitsNet/GeneratedCode/UnitAbbreviationsCache.g.cs Outdated
Comment threadUnitsNet/GeneratedCode/UnitAbbreviationsCache.g.cs Outdated
…undsForce definition
Remove the KiloPoundForce unit definition replaced by Kilo prefixe in PoundForce (and abbreviations for this prefixe)

@angularsenangularsen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Just one minor question, then this should be ready.

Comment threadCommon/UnitDefinitions/Force.json
"Abbreviations": [ "кипф", "койка", "К" ]
}
]
},

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice that you merged these two definitions. Support for Prefixes was added long after this unit was added.

{
"Culture": "en-US",
"Abbreviations": [ "psi/s", "lb/in²/s" ],
"AbbreviationsForPrefixes": { "Kilo": ["kipf/in²/s", "ksi/s" ]}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is ksi/s more widely used than kipf/in2/s? If so, consider swapping the order of these. Seems more consistent with psi/s being the first choice, too.

The first abbreviation is the one used by ToString() when no custom formatting is specified: https://github.com/angularsen/UnitsNet/wiki/String-Formatting

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I think you're right (that's what I think too), but actually i just copied the abbreviations from PoundForcePerSquareInch in Pressure.json

To keep it logical, i think we should change PoundForcePerSquareInch definition too, but as you said, the first abbreviation is used by ToString(), so it could introduce some breaking (even if i never see "kipf/in²" in any standard/document).

What do you think i should do?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think we can risk a minor breaking change and swap the order of Pressure too, for the sake of consistency.

…te, KilopoundForcePerSquareInchPerSecond and KilopoundForcePerSquareInch (ksi and kipf/in²)
ksi is now the first (and default )
abbreviation rather than kipf/in²
@angularsenangularsen changed the title Adding units (ForceChangeRate and PressureChangeRate), abbreviations, and fix translationsAdd units to ForceChangeRate, PressureChangeRate, fix abbreviationsApr 9, 2021
@angularsen
angularsen merged commit 7b742aa into angularsen:masterApr 9, 2021
@angularsen

Copy link
Copy Markdown
Owner

Thanks a lot! Nuget is on the way out.

Release UnitsNet/4.89.0 · angularsen/UnitsNet

Sign up for freeto 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

@n-tiz@angularsen