# Buggy code
def temperature_model(self, model):
    if model is None:
        self._temperature_model = self.infer_temperature_model()
    elif isinstance(model, str):
        model = model.lower()
        if model == "sapm":
            self._temperature_model = self.sapm_temp
        elif model == "pvsyst":
            self._temperature_model = self.pvsyst_temp
        elif model == "faiman":
            self._temperature_model = self.faiman_temp
        else:
            raise ValueError(model + " is not a valid temperature model")
        # check system.temperature_model_parameters for consistency
        name_from_params = self.infer_temperature_model().__name__
        if self._temperature_model.__name__ != name_from_params:
            raise ValueError(
                "Temperature model {} is inconsistent with "
                "PVsystem.temperature_model_parameters {}".format(
                    self._temperature_model.__name__,
                    self.system.temperature_model_parameters,
                )
            )
    else:
        self._temperature_model = partial(model, self)


# Traceback (TypeError)
In [1]: import pvlib
...: import pandas as pd
...:
...: index_naive = pd.date_range('2019-01-01', freq='h', periods=3)
...:
...: kwargs = {
...:     'poa_global': pd.Series(1000, index_naive),
...:     'temp_air': pd.Series(20, index_naive),
...:     'wind_speed': pd.Series(1, index_naive),
...:     'noct_installed': 45
...: }
...:

In [2]: print(pvlib.temperature.fuentes(**kwargs))
2019-01-01 00:00:00    47.85
2019-01-01 01:00:00    50.85
2019-01-01 02:00:00    50.85
Freq: H, Name: tmod, dtype: float64

In [3]: kwargs['poa_global'].index = index_naive.tz_localize('UTC')
...: print(pvlib.temperature.fuentes(**kwargs))
...:
Traceback (most recent call last):

File "<ipython-input-3-ff99badadc91>", line 2, in <module>
print(pvlib.temperature.fuentes(**kwargs))

File "/home/kevin/anaconda3/lib/python3.7/site-packages/pvlib/temperature.py", line 602, in fuentes
timedelta_hours = np.diff(poa_global.index).astype(float) / 1e9 / 60 / 60

TypeError: float() argument must be a string or a number, not 'Timedelta'

# Fixed code
def temperature_model(self, model):
    if model is None:
        self._temperature_model = self.infer_temperature_model()
    elif isinstance(model, str):
        model = model.lower()
        if model == "sapm":
            self._temperature_model = self.sapm_temp
        elif model == "pvsyst":
            self._temperature_model = self.pvsyst_temp
        elif model == "faiman":
            self._temperature_model = self.faiman_temp
        elif model == "fuentes":
            self._temperature_model = self.fuentes_temp
        else:
            raise ValueError(model + " is not a valid temperature model")
        # check system.temperature_model_parameters for consistency
        name_from_params = self.infer_temperature_model().__name__
        if self._temperature_model.__name__ != name_from_params:
            raise ValueError(
                "Temperature model {} is inconsistent with "
                "PVsystem.temperature_model_parameters {}".format(
                    self._temperature_model.__name__,
                    self.system.temperature_model_parameters,
                )
            )
    else:
        self._temperature_model = partial(model, self)