Skip to content

Commit

Permalink
fix(energy): Fix Btu/Btu --> kWh/kWh factor error
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-p-may committed Nov 5, 2023
1 parent 90b6535 commit 13bfc41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ph_units/unit_types/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ class KiloWattHourPerKiloWattHour(Base_UnitType):

__symbol__ = "KWH/KWH"
__aliases__ = ["KWH/KWH"]
__factors__ = {"KWH/KWH": "{}*1", "BTU/BTU": "{}*3412.14"}
__factors__ = {"KWH/KWH": "{}*1", "BTU/BTU": "{}*1"}


class BtuPerBtu(Base_UnitType):
"""BTU/BTU"""

__symbol__ = "BTU/BTU"
__aliases__ = ["BTU/BTU"]
__factors__ = {"KWH/KWH": "{}*0.000293071", "BTU/BTU": "{}*1"}
__factors__ = {"KWH/KWH": "{}*1", "BTU/BTU": "{}*1"}
4 changes: 2 additions & 2 deletions tests/test_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ def test_Btu_per_ft2_per_degree_Farenheit():

def test_kWh_per_kWh():
assert convert(1, "KWH/KWH", "KWH/KWH") == 1
assert convert(1, "KWH/KWH", "BTU/BTU") == pytest.approx(3412.14)
assert convert(1, "KWH/KWH", "BTU/BTU") == 1


def test_Btu_per_Btu():
assert convert(1, "BTU/BTU", "BTU/BTU") == 1
assert convert(1, "BTU/BTU", "KWH/KWH") == pytest.approx(0.000293071)
assert convert(1, "BTU/BTU", "KWH/KWH") == 1


0 comments on commit 13bfc41

Please sign in to comment.