Skip to content

Commit f34309e

Browse files
Apply suggestions from code review
Co-authored-by: Adam R. Jensen <[email protected]>
1 parent 9906815 commit f34309e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/sphinx/source/whatsnew/v0.13.2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Enhancements
2828
:py:func:`~pvlib.singlediode.bishop88_v_from_i`, and
2929
:py:func:`~pvlib.singlediode.bishop88_i_from_v`. (:issue:`2497`, :pull:`2498`)
3030
* Add :py:func:`~pvlib.iotools.get_era5`, a function for accessing
31-
ERA-5 reanalysis data. (:pull:`2573`)
31+
ERA5 reanalysis data. (:pull:`2573`)
3232

3333

3434
Documentation

pvlib/iotools/ecmwf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def get_era5(latitude, longitude, start, end, variables, api_key,
8282
ECMWF CDS API key.
8383
map_variables : bool, default True
8484
When true, renames columns of the DataFrame to pvlib variable names
85-
where applicable. See variable :const:`VARIABLE_MAP`.
85+
where applicable. Also converts units of some variables. See variable
86+
:const:`VARIABLE_MAP` and :const:`UNITS`.
8687
timeout : int, default 60
8788
Number of seconds to wait for the requested data to become available
8889
before timeout.
@@ -188,7 +189,7 @@ def get_era5(latitude, longitude, start, end, variables, api_key,
188189
if map_variables:
189190
# convert units and rename
190191
for shortname in df.columns:
191-
converter = UNITS[shortname]
192+
converter = UNITS.get(shortname, same)
192193
df[shortname] = converter(df[shortname])
193194
df = df.rename(columns=VARIABLE_MAP)
194195

0 commit comments

Comments
 (0)