Skip to content

Deprecate more usage of QuantityType - #1019

Merged
angularsen merged 10 commits into
angularsen:masterfrom
tmilnthorp:quantityType
Jan 26, 2022
Merged

Deprecate more usage of QuantityType#1019
angularsen merged 10 commits into
angularsen:masterfrom
tmilnthorp:quantityType

Conversation

@tmilnthorp

Copy link
Copy Markdown
Collaborator

I noticed we had only partially deprecated QuantityType. I think this hits all of them.

@tmilnthorp

Copy link
Copy Markdown
CollaboratorAuthor

Continued from #864


// Used by the QuantityInfo .ctor to map a name to a QuantityType. Will be removed when QuantityType
// will be removed.
internal static readonly IDictionary<string, QuantityType> QuantityTypeByName = new Dictionary<string, QuantityType>

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

This was no longer used anywhere

@tmilnthorptmilnthorp self-assigned this Jan 26, 2022
public override int GetHashCode()
{{
return new {{ QuantityType, Value, Unit }}.GetHashCode();
return new {{ Info.Name, Value, Unit }}.GetHashCode();

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Matching implementation to main library

@codecov

codecovBot commented Jan 26, 2022

Copy link
Copy Markdown

Codecov Report

Merging #1019 (4a224d4) into master (7f67ffb) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@ Coverage Diff @@## master #1019 +/- ##
========================================
- Coverage 82.7% 82.7% -0.0% 
========================================
Files 310 310 Lines 46586 46585 -1 ========================================
- Hits 38526 38525 -1 
Misses 8060 8060 
Impacted FilesCoverage Δ
UnitsNet/GeneratedCode/Quantity.g.cs51.8% <ø> (-<0.1%)⬇️
UnitsNet/UnitConverter.cs82.4% <ø> (ø)
...nitsNet/GeneratedCode/Quantities/Acceleration.g.cs82.6% <100.0%> (ø)
...et/GeneratedCode/Quantities/AmountOfSubstance.g.cs82.9% <100.0%> (ø)
...tsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs77.8% <100.0%> (ø)
UnitsNet/GeneratedCode/Quantities/Angle.g.cs82.7% <100.0%> (ø)
...tsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs77.3% <100.0%> (ø)
...itsNet/GeneratedCode/Quantities/ApparentPower.g.cs77.8% <100.0%> (ø)
UnitsNet/GeneratedCode/Quantities/Area.g.cs84.5% <100.0%> (ø)
UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs75.0% <100.0%> (ø)
... and 104 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 7f67ffb...4a224d4. Read the comment docs.

@tmilnthorp

Copy link
Copy Markdown
CollaboratorAuthor

CodeCov is really hating me today.

Love the error for a deleted/unused line of code: "Your changes would remove code coverage for this line" 😄

@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 great to me!

{ "VolumetricHeatCapacity", QuantityType.VolumetricHeatCapacity },
{ "WarpingMomentOfInertia", QuantityType.WarpingMomentOfInertia },
};

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.

Good riddance!

@angularsen
angularsen merged commit f3d3b8c into angularsen:masterJan 26, 2022
@angularsen

Copy link
Copy Markdown
Owner

Nuget should be out shortly
Release UnitsNet/4.115.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

@tmilnthorp@angularsen