Skip to content

Updated method of modelchain.ModelChain.prepare_inputs in modelchain.py #893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
7 changes: 6 additions & 1 deletion pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pvlib.irradiance # avoid name conflict with full import
from pvlib.pvsystem import _DC_MODEL_PARAMS
from pvlib._deprecation import pvlibDeprecationWarning
from pvlib.tools import _build_kwargs


def basic_chain(times, latitude, longitude,
Expand Down Expand Up @@ -860,8 +861,12 @@ def prepare_inputs(self, weather, times=None):

self.times = self.weather.index

kwargs = _build_kwargs(['pressure', 'temp_air'], weather)
kwargs['temperature'] = kwargs.pop('temp_air')

self.solar_position = self.location.get_solarposition(
self.weather.index, method=self.solar_position_method)
self.weather.index, method=self.solar_position_method,
**kwargs)

self.airmass = self.location.get_airmass(
solar_position=self.solar_position, model=self.airmass_model)
Expand Down