Repository: sharkdp/numbat (rust)

Issue:
Add heat energy units therm and thermie

https://en.wikipedia.org/wiki/Therm
https://en.wikipedia.org/wiki/Thermie

Pull request description:
Add new heat energy units
Closes #471

Patch:
diff --git a/book/src/list-units.md b/book/src/list-units.md
index 4e3d8fd..a33cce1 100644
--- a/book/src/list-units.md
+++ b/book/src/list-units.md
@@ -47,6 +47,8 @@ and — where sensible — units allow for [binary prefixes](https://en.wikipedi
 | `Energy` | [Joule](https://en.wikipedia.org/wiki/Joule) | `J`, `joule`, `joules` |
 | `Energy` | [Planck energy](https://en.wikipedia.org/wiki/Planck_energy) | `planck_energy` |
 | `Energy` | [Rydberg unit of energy](https://en.wikipedia.org/wiki/Rydberg_constant) | `Ry` |
+| `Energy` | [Therm](https://en.wikipedia.org/wiki/Therm) | `therm`, `therms` |
+| `Energy` | [Thermie](https://en.wikipedia.org/wiki/Thermie) | `thermie`, `thermies` |
 | `Energy` | [Watt-hour](https://en.wikipedia.org/wiki/Watt_hour) | `watthour`, `Wh` |
 | `EquivalentDose` | [Sievert](https://en.wikipedia.org/wiki/Sievert) | `sievert`, `sieverts`, `Sv` |
 | `Force` | [Dyne](https://en.wikipedia.org/wiki/Dyne) | `dyn`, `dyne` |
diff --git a/numbat/modules/units/misc.nbt b/numbat/modules/units/misc.nbt
index 34cca9c..2920c25 100644
--- a/numbat/modules/units/misc.nbt
+++ b/numbat/modules/units/misc.nbt
@@ -30,6 +30,17 @@ unit calorie: Energy = 4.184 joule
 @aliases(Btu)
 unit BTU: Energy = 1055.05585262 joule
 
+@name("Therm")
+@description("A non-SI metric unit of heat energy. This is the ISO definition, also called Therm (EC).")
+@url("https://en.wikipedia.org/wiki/Therm")
+@aliases(therms)
+unit therm: Energy = 100_000 BTU
+
+@name("Thermie")
+@url("https://en.wikipedia.org/wiki/Thermie")
+@aliases(thermies)
+unit thermie: Energy = 1000 kcal
+
 @name("Pound-force")
 @url("https://en.wikipedia.org/wiki/Pound_(force)")
 @aliases(lbf: short)


Test patch:
diff --git a/examples/tests/unit_consistency_misc.nbt b/examples/tests/unit_consistency_misc.nbt
index 70d16f3..019f10b 100644
--- a/examples/tests/unit_consistency_misc.nbt
+++ b/examples/tests/unit_consistency_misc.nbt
@@ -62,6 +62,8 @@ assert_eq(8e-15, 8 ppq, 1e-16)
 
 assert_eq(1 calorie, 4.184 J)
 assert_eq(1 BTU, 1055.05585262 J)
+assert_eq(1 therm, 1.05505585262e8 J)
+assert_eq(1 thermie, 4.184e6 J)
 assert_eq(1 lbf, 4.448222 N)
 assert_eq(1 ozf, (4.448222 / 16.0) N, 1e-5 N)
 assert_eq(60 RPM, 1 Hz)