Skip to content

Commit b6350ea

Browse files
authored
💥Add CoefficientOfThermalExpansion units, change base unit (#1287)
Fixes #1259 ### Add units PerKelvin PerDegreeCelsius PerDegreeFahrenheit PpmPerKelvin PpmPerDegreeCelsius PpmPerDegreeFahrenheit ### 💥Change base unit From `InverseKelvin` to `PerKelvin`. ### Obsolete units (renamed) InverseKelvin InverseDegreeCelsius InverseDegreeFahrenheit
1 parent 0ae889b commit b6350ea

File tree

15 files changed

+691
-193
lines changed

15 files changed

+691
-193
lines changed

Common/UnitDefinitions/CoefficientOfThermalExpansion.json

Lines changed: 97 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name": "CoefficientOfThermalExpansion",
3-
"BaseUnit": "InverseKelvin",
3+
"BaseUnit": "PerKelvin",
44
"XmlDocSummary": "A unit that represents a fractional change in size in response to a change in temperature.",
55
"BaseDimensions": {
66
"Θ": -1
@@ -9,6 +9,7 @@
99
{
1010
"SingularName": "InverseKelvin",
1111
"PluralName": "InverseKelvin",
12+
"ObsoleteText": "Use PerKelvin instead.",
1213
"BaseUnits": {
1314
"Θ": "Kelvin"
1415
},
@@ -17,13 +18,14 @@
1718
"Localization": [
1819
{
1920
"Culture": "en-US",
20-
"Abbreviations": [ "K⁻¹", "1/K" ]
21+
"Abbreviations": [ "1/K" ]
2122
}
2223
]
2324
},
2425
{
2526
"SingularName": "InverseDegreeCelsius",
2627
"PluralName": "InverseDegreeCelsius",
28+
"ObsoleteText": "Use PerDegreeCelsius instead.",
2729
"BaseUnits": {
2830
"Θ": "DegreeCelsius"
2931
},
@@ -32,13 +34,14 @@
3234
"Localization": [
3335
{
3436
"Culture": "en-US",
35-
"Abbreviations": [ "°C⁻¹", "1/°C" ]
37+
"Abbreviations": [ "1/°C" ]
3638
}
3739
]
3840
},
3941
{
4042
"SingularName": "InverseDegreeFahrenheit",
4143
"PluralName": "InverseDegreeFahrenheit",
44+
"ObsoleteText": "Use PerDegreeFahrenheit instead.",
4245
"BaseUnits": {
4346
"Θ": "DegreeFahrenheit"
4447
},
@@ -47,7 +50,97 @@
4750
"Localization": [
4851
{
4952
"Culture": "en-US",
50-
"Abbreviations": [ "°F⁻¹", "1/°F" ]
53+
"Abbreviations": [ "1/°F" ]
54+
}
55+
]
56+
},
57+
{
58+
"SingularName": "PerKelvin",
59+
"PluralName": "PerKelvin",
60+
"BaseUnits": {
61+
"Θ": "Kelvin"
62+
},
63+
"FromUnitToBaseFunc": "{x}",
64+
"FromBaseToUnitFunc": "{x}",
65+
"Localization": [
66+
{
67+
"Culture": "en-US",
68+
"Abbreviations": [ "K⁻¹" ]
69+
}
70+
]
71+
},
72+
{
73+
"SingularName": "PerDegreeCelsius",
74+
"PluralName": "PerDegreeCelsius",
75+
"BaseUnits": {
76+
"Θ": "DegreeCelsius"
77+
},
78+
"FromUnitToBaseFunc": "{x}",
79+
"FromBaseToUnitFunc": "{x}",
80+
"Localization": [
81+
{
82+
"Culture": "en-US",
83+
"Abbreviations": [ "°C⁻¹" ]
84+
}
85+
]
86+
},
87+
{
88+
"SingularName": "PerDegreeFahrenheit",
89+
"PluralName": "PerDegreeFahrenheit",
90+
"BaseUnits": {
91+
"Θ": "DegreeFahrenheit"
92+
},
93+
"FromUnitToBaseFunc": "{x} * 9 / 5",
94+
"FromBaseToUnitFunc": "{x} * 5 / 9",
95+
"Localization": [
96+
{
97+
"Culture": "en-US",
98+
"Abbreviations": [ "°F⁻¹" ]
99+
}
100+
]
101+
},
102+
{
103+
"SingularName": "PpmPerKelvin",
104+
"PluralName": "PpmPerKelvin",
105+
"BaseUnits": {
106+
"Θ": "Kelvin"
107+
},
108+
"FromUnitToBaseFunc": "{x} / 1e6",
109+
"FromBaseToUnitFunc": "{x} * 1e6",
110+
"Localization": [
111+
{
112+
"Culture": "en-US",
113+
"Abbreviations": [ "ppm/K" ]
114+
}
115+
]
116+
},
117+
{
118+
"SingularName": "PpmPerDegreeCelsius",
119+
"PluralName": "PpmPerDegreeCelsius",
120+
"BaseUnits": {
121+
"Θ": "DegreeCelsius"
122+
},
123+
"FromUnitToBaseFunc": "{x} / 1e6",
124+
"FromBaseToUnitFunc": "{x} * 1e6",
125+
"Localization": [
126+
{
127+
"Culture": "en-US",
128+
"Abbreviations": [ "ppm/°C" ]
129+
}
130+
]
131+
},
132+
{
133+
"SingularName": "PpmPerDegreeFahrenheit",
134+
"PluralName": "PpmPerDegreeFahrenheit",
135+
"BaseUnits": {
136+
"Θ": "DegreeFahrenheit"
137+
},
138+
"FromUnitToBaseFunc": "{x} * 9 / 5e6",
139+
"FromBaseToUnitFunc": "{x} * 5e6 / 9",
140+
"Localization": [
141+
{
142+
"Culture": "en-US",
143+
"Abbreviations": [ "ppm/°F" ]
51144
}
52145
]
53146
}

Common/UnitEnumValues.g.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@
154154
"CoefficientOfThermalExpansion": {
155155
"InverseDegreeCelsius": 1,
156156
"InverseDegreeFahrenheit": 2,
157-
"InverseKelvin": 3
157+
"InverseKelvin": 3,
158+
"PerDegreeCelsius": 9,
159+
"PerDegreeFahrenheit": 11,
160+
"PerKelvin": 13,
161+
"PpmPerDegreeCelsius": 6,
162+
"PpmPerDegreeFahrenheit": 4,
163+
"PpmPerKelvin": 7
158164
},
159165
"Compressibility": {
160166
"InverseAtmosphere": 1,

UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs

Lines changed: 85 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensionsTest.g.cs

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)