Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete units #1372

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions Common/UnitDefinitions/CoefficientOfThermalExpansion.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,6 @@
"Θ": -1
},
"Units": [
{
"SingularName": "InverseKelvin",
"PluralName": "InverseKelvin",
"ObsoleteText": "Use PerKelvin instead.",
"BaseUnits": {
"Θ": "Kelvin"
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "1/K" ]
}
]
},
{
"SingularName": "InverseDegreeCelsius",
"PluralName": "InverseDegreeCelsius",
"ObsoleteText": "Use PerDegreeCelsius instead.",
"BaseUnits": {
"Θ": "DegreeCelsius"
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "1/°C" ]
}
]
},
{
"SingularName": "InverseDegreeFahrenheit",
"PluralName": "InverseDegreeFahrenheit",
"ObsoleteText": "Use PerDegreeFahrenheit instead.",
"BaseUnits": {
"Θ": "DegreeFahrenheit"
},
"FromUnitToBaseFunc": "{x} * 9 / 5",
"FromBaseToUnitFunc": "{x} * 5 / 9",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "1/°F" ]
}
]
},
{
"SingularName": "PerKelvin",
"PluralName": "PerKelvin",
Expand Down
13 changes: 0 additions & 13 deletions Common/UnitDefinitions/HeatTransferCoefficient.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@
}
]
},
{
"SingularName": "BtuPerSquareFootDegreeFahrenheit",
"PluralName": "BtusPerSquareFootDegreeFahrenheit",
"ObsoleteText": "The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead",
"FromUnitToBaseFunc": "{x} * 5.6782633411134878",
"FromBaseToUnitFunc": "{x} / 5.6782633411134878",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "Btu/ft²·°F" ]
}
]
},
{
"SingularName": "BtuPerHourSquareFootDegreeFahrenheit",
"PluralName": "BtusPerHourSquareFootDegreeFahrenheit",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions UnitsNet.Tests/CustomCode/CoefficientOfThermalExpansionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ public class CoefficientOfThermalExpansionTests : CoefficientOfThermalExpansionT
{
protected override bool SupportsSIUnitSystem => true;

protected override double InverseDegreeCelsiusInOnePerKelvin => 1.0;

protected override double InverseDegreeFahrenheitInOnePerKelvin => 0.5555555555555556;

protected override double InverseKelvinInOnePerKelvin => 1.0;

protected override double PerDegreeCelsiusInOnePerKelvin => 1.0;

protected override double PerDegreeFahrenheitInOnePerKelvin => 0.5555555555555556;
Expand All @@ -52,7 +46,7 @@ public void CoefficientOfThermalExpansionTimesTemperatureDelta()
{
double temperatureDeltaDegC = 2.0;
double ctePerDegC = 0.001;
CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromInverseDegreeCelsius(ctePerDegC);
CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromPerDegreeCelsius(ctePerDegC);
TemperatureDelta dT = TemperatureDelta.FromDegreesCelsius(temperatureDeltaDegC);
AssertEx.EqualTolerance(cte * dT, ctePerDegC * temperatureDeltaDegC, 1e-10);
}
Expand All @@ -62,7 +56,7 @@ public void TemperatureDeltaTimesCoefficientOfThermalExpansion()
{
double temperatureDeltaDegC = 2.0;
double ctePerDegC = 0.001;
CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromInverseDegreeCelsius(ctePerDegC);
CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromPerDegreeCelsius(ctePerDegC);
TemperatureDelta dT = TemperatureDelta.FromDegreesCelsius(temperatureDeltaDegC);
AssertEx.EqualTolerance(dT * cte, temperatureDeltaDegC * ctePerDegC, 1e-10);
}
Expand Down
1 change: 0 additions & 1 deletion UnitsNet.Tests/CustomCode/HeatTransferCoefficientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class HeatTransferCoefficientTests : HeatTransferCoefficientTestsBase
protected override double WattsPerSquareMeterKelvinInOneWattPerSquareMeterKelvin => 1;
protected override double BtusPerHourSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin => 1.7611018368230584e-1;
protected override double KilocaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin => 0.859845227859;
protected override double BtusPerSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin => 1.7611018368230584e-1;
protected override double CaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin => 859.845227859;
}
}
Loading