8000 add Mount classes by kandersolar · Pull Request #1176 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

add Mount classes #1176

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 54 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cb3c207
add Mount classes, incorporate into Array and PVSystem
kandersolar Feb 23, 2021
8a6d0e6
update pvsystem tests
kandersolar Feb 23, 2021
6d4240e
delete mounts module
kandersolar Feb 23, 2021
fc4064b
fix modelchain tests
kandersolar Feb 24, 2021
e8f1404
some modifications to SingleAxisTracker
kandersolar Feb 24, 2021
02a2b27
changes from review
kandersolar Feb 27, 2021
0be45ae
stickler
kandersolar Feb 27, 2021
9406ccd
Merge branch 'master' into mount_classes
kandersolar Mar 2, 2021
e1bdc67
use dataclasses for mounts
kandersolar Mar 7, 2021
61650e9
update tests
kandersolar Mar 7, 2021
fc47003
update docs
kandersolar Mar 7, 2021
887fd3a
whatsnew
kandersolar Mar 7, 2021
ecc4737
test mount classes
kandersolar Mar 7, 2021
cbb41e1
stickler
kandersolar Mar 7, 2021
9e663d2
more tests
kandersolar Mar 7, 2021
105edb7
another test
kandersolar Mar 7, 2021
6d32c41
fix typo
kandersolar Mar 7, 2021
4a6347e
clean up AbstractMount
kandersolar Mar 13, 2021
1e063ba
remove unnecessary use of dataclasses.field
kandersolar Mar 13, 2021
3dcf106
calculate -> get
kandersolar Mar 13, 2021
d4045a3
Merge remote-tracking branch 'upstream/master' into mount_classes
kandersolar Mar 21, 2021
b0b551f
Update pvlib/pvsystem.py
kandersolar Mar 21, 2021
515a359
stickler
kandersolar Mar 21, 2021
a874b11
test fixes
kandersolar Mar 21, 2021
17195ae
add optional surface_tilt parameter to PVSystem.fuentes_celltemp
kandersolar Mar 21, 2021
93716bb
move racking_model and module_height to the Mounts
kandersolar Mar 21, 2021
efe6b3b
fix some tests
kandersolar Mar 21, 2021
74a6be4
remove unnecessary fixture
kandersolar Mar 28, 2021
9da9eb4
Revert "remove unnecessary fixture"
kandersolar Mar 30, 2021
2320ed7
Merge remote-tracking branch 'upstream/master' into mount_classes
kandersolar May 14, 2021
6370143
update merged test
kandersolar May 14, 2021
6181e96
fix fuentes issue, sort of
kandersolar May 14, 2021
47b6884
pep8
kandersolar May 14, 2021
dbc1193
pep8
kandersolar May 14, 2021
e0eeef4
remove PVSystem.fuentes_celltemp surface_tilt parameter
kandersolar May 14, 2021
cf3fe20
placeholder fuentes surface_tilt logic
kandersolar May 14, 2021
7c18126
Merge branch 'master' into mount_classes
kandersolar May 21, 2021
86292c5
test updates
kandersolar May 21, 2021
cc5f45a
Merge remote-tracking branch 'upstream/master' into mount_classes
kandersolar Jun 17, 2021
739359e
remove unused imports
kandersolar Jun 17, 2021
59547f5
remove fuentes override complexity
kandersolar Jun 23, 2021
bed27c9
stickler
kandersolar Jun 23, 2021
1103f99
update RST pages
kandersolar Jun 23, 2021
e6504cd
Merge remote-tracking branch 'upstream/master' into mount_classes
kandersolar Jun 23, 2021
73aba9a
revert unnecessary docs change
kandersolar Jun 23, 2021
f3ff722
add link to pvsystem and modelchain pages in api listing
kandersolar Jun 29, 2021
9c0c3ff
other changes from review
kandersolar Jun 29, 2021
35da280
get module_height from mount instead of temperature_model_parameters
kandersolar Jun 29, 2021
1a43ea8
coverage for fuentes module_height parameter
kandersolar Jun 29, 2021
c1738e9
deprecate SingleAxisTracker
kandersolar Jul 21, 2021
8000 781b133
suppress SAT deprecation warnings in tests
kandersolar Jul 21, 2021
22341ec
Apply suggestions from code review
kandersolar Jul 22, 2021
6df8408
Tracking -> Tracker
kandersolar Jul 22, 2021
506edbc
Merge branch 'mount_classes' of https://github.com/kanderso-nrel/pvli…
kandersolar Jul 22, 2021
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
Merge remote-tracking branch 'upstream/master' into mount_classes
  • Loading branch information
kandersolar committed May 14, 2021
commit 2320ed7e414708ee7e9a4e98f208e00b4dd1eedf
38 changes: 6 additions & 32 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,8 @@ def faiman_celltemp(self, poa_global, temp_air, wind_speed=1.0):
return self.get_cell_temperature(poa_global, temp_air, wind_speed,
model='faiman')

@_unwrap_single_value
@deprecated('0.9', alternative='PVSystem.get_cell_temperature',
removal='0.10.0')
def fuentes_celltemp(self, poa_global, temp_air, wind_speed,
surface_tilt=None):
"""
Expand Down Expand Up @@ -788,38 +789,11 @@ def fuentes_celltemp(self, poa_global, temp_air, wind_speed,
If passed as a tuple the length must be the same as the number of
Arrays.
"""
# default to using the Array attribute, but allow user to
# override with a custom surface_tilt value
poa_global = self._validate_per_array(poa_global)
temp_air = self._validate_per_array(temp_air, system_wide=True)
wind_speed = self._validate_per_array(wind_speed, system_wide=True)
surface_tilt = self._validate_per_array(surface_tilt, system_wide=True)

def _build_kwargs_fuentes(array, user_tilt):
kwargs = {'surface_tilt': user_tilt}
if array.mount.module_height is not None:
kwargs['module_height'] = array.mount.module_height
temp_model_kwargs = _build_kwargs([
'noct_installed', 'wind_height', 'emissivity',
'absorption', 'surface_tilt', 'module_width', 'module_length'],
array.temperature_model_parameters)
kwargs.update(temp_model_kwargs)
if kwargs['surface_tilt'] is None:
raise ValueError(
"surface_tilt must be specified in "
"PVSystem.fuentes_celltemp if not providing a "
"default in the Array's temperature_model_parameters")
return kwargs
return tuple(
temperature.fuentes(
poa_global, temp_air, wind_speed,
**_build_kwargs_fuentes(array, user_tilt))
for array, poa_global, temp_air, wind_speed, user_tilt in zip(
self.arrays, poa_global, temp_air, wind_speed, surface_tilt
)
)
return self.get_cell_temperature(poa_global, temp_air, wind_speed,
model='fuentes')

@_unwrap_single_value
@deprecated('0.9', alternative='PVSystem.get_cell_temperature',
removal='0.10.0')
def noct_sam_celltemp(self, poa_global, temp_air, wind_speed,
effective_irradiance=None):
"""
Expand Down
54 changes: 20 additions & 34 deletions pvlib/tests/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,9 @@ def test_PVSystem_multi_array_celltemp_functions(model, two_array_system):
irrad_two = pd.Series(500, index=times)
temp_air = pd.Series(25, index=times)
wind_speed = pd.Series(1, index=times)
kwargs = {}
if celltemp == pvsystem.PVSystem.fuentes_celltemp:
kwargs['surface_tilt'] = 30

temp_one, temp_two = celltemp(
two_array_system, (irrad_one, irrad_two), temp_air, wind_speed,
**kwargs)
temp_one, temp_two = two_array_system.get_cell_temperature(
(irrad_one, irrad_two), temp_air, wind_speed, model=model)
assert (temp_one != temp_two).all()


Expand All @@ -587,23 +583,18 @@ def test_PVSystem_multi_array_celltemp_multi_temp(model, two_array_system):
temp_air_one = pd.Series(25, index=times)
temp_air_two = pd.Series(5, index=times)
wind_speed = pd.Series(1, index=times)
kwargs = {}
if celltemp == pvsystem.PVSystem.fuentes_celltemp:
kwargs['surface_tilt'] = 30

temp_one, temp_two = celltemp(
two_array_system,
temp_one, temp_two = two_array_system.get_cell_temperature(
(irrad, irrad),
(temp_air_one, temp_air_two),
wind_speed,
**kwargs
model=model
)
assert (temp_one != temp_two).all()
temp_one_swtich, temp_two_switch = two_array_system.get_cell_temperature(
(irrad, irrad),
(temp_air_two, temp_air_one),
wind_speed,
**kwargs
model=model
)
assert_series_equal(temp_one, temp_two_switch)
assert_series_equal(temp_two, temp_one_swtich)
Expand All @@ -617,23 +608,18 @@ def test_PVSystem_multi_array_celltemp_multi_wind(model, two_array_system):
temp_air = pd.Series(25, index=times)
wind_speed_one = pd.Series(1, index=times)
wind_speed_two = pd.Series(5, index=times)
kwargs = {}
if celltemp == pvsystem.PVSystem.fuentes_celltemp:
kwargs['surface_tilt'] = 30

temp_one, temp_two = celltemp(
two_array_system,
temp_one, temp_two = two_array_system.get_cell_temperature(
(irrad, irrad),
temp_air,
(wind_speed_one, wind_speed_two),
**kwargs
model=model
)
assert (temp_one != temp_two).all()
temp_one_swtich, temp_two_switch = two_array_system.get_cell_temperature(
(irrad, irrad),
temp_air,
(wind_speed_two, wind_speed_one),
**kwargs
model=model
)
assert_series_equal(temp_one, temp_two_switch)
assert_series_equal(temp_two, temp_one_swtich)
Expand Down Expand Up @@ -703,13 +689,11 @@ def test_PVSystem_fuentes_celltemp(mocker):
temps = pd.Series(25, index)
irrads = pd.Series(1000, index)
winds = pd.Series(1, index)

out = system.fuentes_celltemp(irrads, temps, winds, surface_tilt=0)
out = system.get_cell_temperature(irrads, temps, winds, model='fuentes')
assert_series_equal(spy.call_args[0][0], irrads)
assert_series_equal(spy.call_args[0][1], temps)
assert_series_equal(spy.call_args[0][2], winds)
assert spy.call_args[1]['surface_tilt'] == 0
assert spy.call_args[1]['noct_installed'] == noct_installed
assert spy.call_args[0][3] == noct_installed
assert_series_equal(out, pd.Series([52.85, 55.85, 55.85], index,
name='tmod'))

Expand All @@ -727,16 +711,18 @@ def test_PVSystem_fuentes_celltemp_override(mocker):
winds = pd.Series(1, index)

# uses default value
temp_model_params = {'noct_installed': noct_installed, 'surface_tilt': 20}
system = pvsystem.PVSystem(temperature_model_parameters=temp_model_params)
system.fuentes_celltemp(irrads, temps, winds)
temp_model_params = {'noct_installed': noct_installed}
system = pvsystem.PVSystem(temperature_model_parameters=temp_model_params,
surface_tilt=20)
system.get_cell_temperature(irrads, temps, winds, model='fuentes')
assert spy.call_args[1]['surface_tilt'] == 20

# if no default, uses the user-specified values
temp_model_params = {'noct_installed': noct_installed}
system = pvsystem.PVSystem(temperature_model_parameters=temp_model_params)
system.fuentes_celltemp(irrads, temps, winds, surface_tilt=40)
assert spy.call_args[1]['surface_tilt'] == 40
# can be overridden
temp_model_params = {'noct_installed': noct_installed, 'surface_tilt': 30}
system = pvsystem.PVSystem(temperature_model_parameters=temp_model_params,
surface_tilt=20)
system.get_cell_temperature(irrads, temps, winds, model='fuentes')
assert spy.call_args[1]['surface_tilt'] == 30


def test_Array__infer_temperature_model_params():
Expand Down
4 changes: 2 additions & 2 deletions pvlib/tests/test_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from numpy.testing import assert_allclose

import pvlib
from pvlib import tracking
from conftest import DATA_DIR, assert_frame_equal
from pvlib import tracking, pvsystem
from .conftest import DATA_DIR, assert_frame_equal

SINGLEAXIS_COL_ORDER = ['tracker_theta', 'aoi',
'surface_azimuth', 'surface_tilt']
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0