8000 Accept albedo in weather input to ModelChain.run_model method by cwhanse · Pull Request #1469 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Accept albedo in weather input to ModelChain.run_model method #1469

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

Merged
merged 16 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
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
from review
  • Loading branch information
cwhanse committed Jun 13, 2022
commit b9a7308c9df02df7490c7b9a679547af0d5e9032
2 changes: 1 addition & 1 deletion pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times,
applied.

albedo : numeric, default 0.25
Gound surface albedo. [unitless]
Ground surface albedo. [unitless]

model : String, default 'perez'
Irradiance model. See :py:func:`get_sky_diffuse` for allowed values.
Expand Down
4 changes: 2 additions & 2 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ def prepare_inputs(self, weather):

Parameters
----------
weather : tuple or list of DataFrames
weather : DataFrame, or tuple or list of DataFrames
Required column names include ``'dni'``, ``'ghi'``, ``'dhi'``.
Optional column names are ``'wind_speed'``, ``'temp_air'``,
``'albedo'``.
Expand Down Expand Up @@ -1770,7 +1770,7 @@ def run_model(self, weather):
is provided, `temperature_model` must be ``'sapm'``.

If optional column ``'albedo'`` is provided, ``'albedo'`` may not
be present on the ModelChain's PVSystem or PVSystem.Arrays.
be present on the ModelChain's PVSystem.Arrays.

If weather is a list or tuple, it must be of the same length and
order as the Arrays of the ModelChain's PVSystem.
Expand Down
8 changes: 4 additions & 4 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class PVSystem:
:py:class:`pvlib.modelchain.ModelChain` methods.

surface_type : None or string, default None
The ground surface type. Required if ``albedo`` is None.
See ``irradiance.SURFACE_ALBEDOS`` for valid values.
The ground surface type. See ``irradiance.SURFACE_ALBEDOS`` for
valid values.

module : None or string, default None
The model name of the modules.
Expand Down Expand Up @@ -1267,8 +1267,8 @@ class Array:
of 0.25 is used.

surface_type : None or string, default None
The ground surface type. Required if ``albedo`` is None.
See ``irradiance.SURFACE_ALBEDOS`` for valid values.
The ground surface type. See ``irradiance.SURFACE_ALBEDOS`` for valid
values.

module : None or string, default None
The model name of the modules.
Expand Down
20 changes: 16 additions & 4 deletions pvlib/tests/test_clearsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,22 @@ def test_bird():
etr, b_a, alb_series
)
Eb, Ebh, Gh, Dh = (irrads[_] for _ in field_names)
assert np.allclose(testdata['DEC'], np.rad2deg(declination[1:48]))
assert np.allclose(testdata['EQT'], eot[1:48], rtol=1e-4)
assert np.allclose(testdata['Hour Angle'], hour_angle[1:48])
assert np.allclose(testdata['Zenith Ang'], zenith[1:48])
direct_beam = pd.Series(np.where(dawn, Eb, 0.), index=times).fillna(0.)
assert np.allclose(
testdata['Direct Beam'].where(dusk, 0.), direct_beam[1:48], rtol=1e-3
)
direct_horz = pd.Series(np.where(dawn, Ebh, 0.), index=times).fillna(0.)
assert np.allclose(
testdata['Direct Hz'].where(dusk, 0.), direct_horz[1:48], rtol=1e-3
)
global_horz = pd.Series(np.where(dawn, Gh, 0.), index=times).fillna(0.)
assert np.allclose(
testdata['Global Hz'].where(dusk, 0.), global_horz[1:48], rtol=1e-3
)
diffuse_horz = pd.Series(np.where(dawn, Dh, 0.), index=times).fillna(0.)
assert np.allclose(
testdata['Dif Hz'].where(dusk, 0.), diffuse_horz[1:48], rtol=1e-3
)

# test keyword parameters
irrads2 = clearsky.bird(
Expand Down
0