---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-95-ff36a88e4e3a> in <module>
----> 1 soiling_hsu(greensboro_rain, cleaning_threshold=6, tilt=10, pm2_5=1e-5, pm10=1e-5)
~\Projects\pvlib-python\pvlib\losses.py in soiling_hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10, depo_veloc, rain_accum_period)
67
68 # accumulate rainfall into periods for comparison with threshold
---> 69 accum_rain = rainfall.rolling(rain_accum_period, closed='right').sum()
70 # cleaning is True for intervals with rainfall greater than threshold
71 cleaning_times = accum_rain.index[accum_rain >= cleaning_threshold]
~\projects\pvlib-python\venv\lib\site-packages\pandas\core\generic.py in rolling(self, window, min_periods, center, win_type, on, axis, closed)
10145 min_periods=min_periods,
10146 center=center, win_type=win_type,
> 10147 on=on, axis=axis, closed=closed)
10148
10149 cls.rolling = rolling
~\projects\pvlib-python\venv\lib\site-packages\pandas\core\window.py in rolling(obj, win_type, **kwds)
2624 return Window(obj, win_type=win_type, **kwds)
2625
-> 2626 return Rolling(obj, **kwds)
2627
2628
~\projects\pvlib-python\venv\lib\site-packages\pandas\core\window.py in __init__(self, obj, window, min_periods, center, win_type, axis, on, closed, **kwargs)
63 self.win_freq = None
64 self.axis = obj._get_axis_number(axis) if axis is not None else None
---> 65 self.validate()
66
67 @property
~\projects\pvlib-python\venv\lib\site-packages\pandas\core\window.py in validate(self)
1576 timedelta))):
1577
-> 1578 self._validate_monotonic()
1579 freq = self._validate_freq()
1580
~\projects\pvlib-python\venv\lib\site-packages\pandas\core\window.py in _validate_monotonic(self)
1610 formatted = self.on or 'index'
1611 raise ValueError("{0} must be "
-> 1612 "monotonic".format(formatted))
1613
1614 def _validate_freq(self):
Describe the bug
calling
pvlib.losses.soiling_hsu(read_tmy3(<tmy file>, coerce_year=<year>), ...)raisesValueError: index must be monotonicbecause the last hour of a TMY3 file has been coerced to the same year as the first index, instead of the first hour of the next yearTo Reproduce
Steps to reproduce the behavior:
raises
ValueError: index must be monotonicDetails
I'm not sure, I guess I would expect it to be able to handle TMY3 data, but maybe it's the TMY3 with the year coerced to the same number that's the problem? This would also fail TMY3 if you didn't coerce the year, but it might fail silently in some weird ugly way that you didn't notice at first.
Versions:
Additional context
related to #865 and #866