8000 Updated method of modelchain.ModelChain.prepare_inputs in modelchain.py by Ahanmr · Pull Request #893 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

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
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Updated modelchain.py
 This handles the case where pressure or temp_air is not in weather, using the pvlib.tools._build_kwargs logic for keyword arguments.
#523
  • Loading branch information
Ahanmr authored Feb 17, 2020
commit 6caa825042630c15f202c2eab2705b436ec243af
6 changes: 5 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 @@ -859,10 +860,13 @@ def prepare_inputs(self, weather, times=None):
'is used for times.', pvlibDeprecationWarning)

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,
pressure=self.weather.pressure, temperature=self.weather.temp_air)
**kwargs)

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