diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index dbca739942..6a8903be85 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1324,6 +1324,7 @@ def _build_weather(data): _build_weather(weather) for weather in data ) self._configure_results() + self._assign_times() return self def _assign_total_irrad(self, data): @@ -1392,7 +1393,6 @@ def prepare_inputs(self, weather): self._check_multiple_input(weather, strict=False) self._verify_df(weather, required=['ghi', 'dni', 'dhi']) self._assign_weather(weather) - self._assign_times() self._prep_inputs_solar_pos(weather) self._prep_inputs_airmass() diff --git a/pvlib/tests/test_modelchain.py b/pvlib/tests/test_modelchain.py index 3b48ddf803..1e627b541b 100644 --- a/pvlib/tests/test_modelchain.py +++ b/pvlib/tests/test_modelchain.py @@ -774,6 +774,7 @@ def test_prepare_inputs_from_poa(sapm_dc_snl_ac_system, location, assert_frame_equal(mc.weather, weather_expected) # total_irrad attribute assert_frame_equal(mc.results.total_irrad, total_irrad) + assert not pd.isnull(mc.results.solar_position.index[0]) @pytest.mark.parametrize("input_type", [tuple, list])