8000 Bug in get_pvgis_hourly related to optimal tilt (#1356) · AdamRJensen/pvlib-python@9871868 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9871868

Browse files
Bug in get_pvgis_hourly related to optimal tilt (pvlib#1356)
* Bug in get_pvgis_hourly related to optimal tilt Currently, the `optimalangles` boolean input argument was passed correctly to the `optimalangles` parameter but also by mistake to `optimalinclination`. Instead the boolean argument `optimal_surface_tilt` should be passed to the `optimalinclination` parameter. * Fix test url * Update whatsnew * Update whatsnew Co-authored-by: Kevin Anderson <57452607+kanderso-nrel@users.noreply.github.com> Co-authored-by: Kevin Anderson <57452607+kanderso-nrel@users.noreply.github.com>
1 parent ed05fdd commit 9871868

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

docs/sphinx/source/whatsnew/v0.9.1.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Bug fixes
1818
(:issue:`1311`, :pull:`1315`)
1919
* Fixed a bug in :py:func:`pvlib.spectrum.spectrl2` where negative spectral irradiance
2020
values were returned when the sun is behind the plane of array (:issue:`1348`, :pull:`1349`)
21+
* Fixed bug in :py:func:`pvlib.iotools.get_pvgis_hourly` where the ``optimal_surface_tilt``
22+
argument was not being passed to the ``optimalinclination`` request parameter (:pull:`1356`)
2123

2224

2325
Testing
@@ -36,3 +38,4 @@ Contributors
3638
* :ghuser:`Carlosbogo`
3739
* Christian Weickhmann (:ghuser:`cweickhmann`)
3840
* Kevin Anderson (:ghuser:`kanderso-nrel`)
41+
* Adam R. Jensen (:ghuser:`AdamRJensen`)

pvlib/iotools/pvgis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
190190
'trackingtype': trackingtype, 'components': int(components),
191191
'usehorizon': int(usehorizon),
192192
'optimalangles': int(optimalangles),
193-
'optimalinclination': int(optimalangles), 'loss': loss}
193+
'optimalinclination': int(optimal_surface_tilt), 'loss': loss}
194194
# pvgis only takes 0 for False, and 1 for True, not strings
195195
if userhorizon is not None:
196196
params['userhorizon'] = ','.join(str(x) for x in userhorizon)

pvlib/tests/iotools/test_pvgis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def test_get_pvgis_hourly_bad_outputformat(requests_mock):
273273
get_pvgis_hourly(latitude=45, longitude=8, outputformat='basic')
274274

275275

276-
url_additional_inputs = 'https://re.jrc.ec.europa.eu/api/seriescalc?lat=55.6814&lon=12.5758&outputformat=csv&angle=0&aspect=0&pvcalculation=1&pvtechchoice=crystSi&mountingplace=free&trackingtype=0&components=1&usehorizon=1&optimalangles=1&optimalinclination=1&loss=2&userhorizon=10%2C15%2C20%2C10&peakpower=5' # noqa: E501
276+
url_additional_inputs = 'https://re.jrc.ec.europa.eu/api/seriescalc?lat=55.6814&lon=12.5758&outputformat=csv&angle=0&aspect=0&pvcalculation=1&pvtechchoice=crystSi&mountingplace=free&trackingtype=0&components=1&usehorizon=1&optimalangles=1&optimalinclination=0&loss=2&userhorizon=10%2C15%2C20%2C10&peakpower=5' # noqa: E501
277277

278278

279279
def test_get_pvgis_hourly_additional_inputs(requests_mock):

0 commit comments

Comments
 (0)
0