Skip to content

Commit bedd9e1

Browse files
Fix dtypes in get_pvgis_tmy when outputformat='epw' (#2417)
* Fix dtypes in get_pvgis_tmy when outputformat='epw' * Fix linter * Add GH # comment in code Co-authored-by: Kevin Anderson <[email protected]> * Undo review change Co-authored-by: Kevin Anderson <[email protected]> * Update v0.12.1.rst --------- Co-authored-by: Kevin Anderson <[email protected]>
1 parent d4dbe55 commit bedd9e1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Breaking Changes
1010

1111
Bug fixes
1212
~~~~~~~~~
13-
13+
* :py:func:`pvlib.iotools.get_pvgis_tmy` now returns the correct dtypes when
14+
when ``outputformat='epw'``. (:issue:`2399`, :pull:`2417`)
1415

1516
Enhancements
1617
~~~~~~~~~~~~

pvlib/iotools/pvgis.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ def _coerce_and_roll_tmy(tmy_data, tz, year):
410410
np.roll(tmy_data, tz, axis=0),
411411
columns=tmy_data.columns,
412412
index=new_index)
413+
# GH 2399
414+
new_tmy_data = \
415+
new_tmy_data.astype(dtype=dict(zip(tmy_data.columns, tmy_data.dtypes)))
413416
return new_tmy_data
414417

415418

0 commit comments

Comments
 (0)