Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Bug fixes
* Fixed incorrect mapping of requested parameters names when using the ``get_psm3``
function. Also fixed the random reordering of the dataframe columns.
(:issue:`1629`, :issue:`1647`, :pull:`1648`)
* When using ``utc_time_range`` with :py:func:`pvlib.iotools.read_ecmwf_macc`,
the time index subset is now selected with ``nearest`` instead of ``before``
and ``after`` for consistency with ``cftime>=1.6.0``. (:issue:`1609`, :pull:`1656`)


Testing
Expand Down Expand Up @@ -56,3 +59,4 @@ Contributors
* Mark Mikofski (:ghuser:`mikofski`)
* Anton Driesse (:ghuser:`adriesse`)
* Adam R. Jensen (:ghuser:`AdamRJensen`)
* Michael Deceglie (:ghuser:`mdeceglie`)
4 changes: 2 additions & 2 deletions pvlib/iotools/ecmwf_macc.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ def read_ecmwf_macc(filename, latitude, longitude, utc_time_range=None):
nctime = ecmwf_macc.data['time']
if utc_time_range:
start_idx = netCDF4.date2index(
utc_time_range[0], nctime, select='before')
utc_time_range[0], nctime, select='nearest')
end_idx = netCDF4.date2index(
utc_time_range[-1], nctime, select='after')
utc_time_range[-1], nctime, select='nearest')
time_slice = slice(start_idx, end_idx + 1)
else:
time_slice = slice(0, ecmwf_macc.time_size)
Expand Down