Skip to content

Commit b4aab17

Browse files
author
JB
committed
Fix _m_to_cm: multiply by 100 to convert meters to cm
1 parent 3ad5a9e commit b4aab17

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

pvlib/iotools/era5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _j_to_w(j):
3737

3838

3939
def _m_to_cm(m):
40-
return m / 100
40+
return m * 100
4141

4242

4343
UNITS = {

tests/iotools/test_era5.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ def test_get_era5_timeout(params):
9292
match = 'Request timed out. Try increasing'
9393
with pytest.raises(requests.exceptions.Timeout, match=match):
9494
df, meta = pvlib.iotools.get_era5(**params, timeout=1)
95+
96+
def test_m_to_cm():
97+
from pvlib.iotools.era5 import _m_to_cm
98+
assert _m_to_cm(0.01) == 1 # 0.01 m = 1 cm

0 commit comments

Comments
 (0)