Skip to content

Commit

Permalink
Remove obsolete units (#1372)
Browse files Browse the repository at this point in the history
See #1200
  • Loading branch information
Muximize committed Mar 1, 2024
1 parent f7ce00b commit 8f503e9
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 364 deletions.
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

0 comments on commit 8f503e9

Please sign in to comment.