Skip to content

Commit 5dea6ae

Browse files
authored
Merge branch 'master' into scaling_dt_fix
2 parents fa474cc + 7766bc6 commit 5dea6ae

20 files changed

+1683
-400
lines changed

ci/azure/conda_linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
- script: |
3939
source activate test_env
4040
export NREL_API_KEY=$(nrelApiKey)
41+
export BSRN_FTP_USERNAME=$(BSRN_FTP_USERNAME)
42+
export BSRN_FTP_PASSWORD=$(BSRN_FTP_PASSWORD)
4143
pytest pvlib --remote-data --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
4244
displayName: 'pytest'
4345
- task: PublishTestResults@2

docs/sphinx/source/api.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ object-oriented programming. These classes can help users keep track of
1313
data in a more organized way, and can help to simplify the modeling
1414
process. The classes do not add any functionality beyond the procedural
1515
code. Most of the object methods are simple wrappers around the
16-
corresponding procedural code.
16+
corresponding procedural code. For examples of using these classes, see
17+
the :ref:`pvsystemdoc` and :ref:`modelchaindoc` pages.
1718

1819
.. autosummary::
1920
:toctree: generated/
2021

2122
location.Location
2223
pvsystem.PVSystem
2324
pvsystem.Array
25+
pvsystem.FixedMount
26+
pvsystem.SingleAxisTrackerMount
2427
tracking.SingleAxisTracker
2528
modelchain.ModelChain
2629
modelchain.ModelChainResult
@@ -486,7 +489,11 @@ of sources and file formats relevant to solar energy modeling.
486489
iotools.parse_psm3
487490
iotools.get_pvgis_tmy
488491
iotools.read_pvgis_tmy
492+
iotools.get_pvgis_hourly
493+
iotools.read_pvgis_hourly
494+
iotools.get_bsrn
489495
iotools.read_bsrn
496+
iotools.parse_bsrn
490497
iotools.get_cams
491498
iotools.read_cams
492499
iotools.parse_cams

docs/sphinx/source/modelchain.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. _modelchaindoc:
12

23
ModelChain
34
==========
@@ -40,7 +41,7 @@ objects, module data, and inverter data.
4041
# pvlib imports
4142
import pvlib
4243
43-
from pvlib.pvsystem import PVSystem
44+
from pvlib.pvsystem import PVSystem, FixedMount
4445
from pvlib.location import Location
4546
from pvlib.modelchain import ModelChain
4647
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS
@@ -53,8 +54,8 @@ objects, module data, and inverter data.
5354
sandia_module = sandia_modules['Canadian_Solar_CS5P_220M___2009_']
5455
cec_inverter = cec_inverters['ABB__MICRO_0_25_I_OUTD_US_208__208V_']
5556
56-
Now we create a Location object, a PVSystem object, and a ModelChain
57-
object.
57+
Now we create a Location object, a Mount object, a PVSystem object, and a
58+
ModelChain object.
5859

5960
.. ipython:: python
6061
@@ -448,11 +449,11 @@ are in the same order as in ``PVSystem.arrays``.
448449
location = Location(latitude=32.2, longitude=-110.9)
449450
inverter_parameters = {'pdc0': 10000, 'eta_inv_nom': 0.96}
450451
module_parameters = {'pdc0': 250, 'gamma_pdc': -0.004}
451-
array_one = Array(surface_tilt=20, surface_azimuth=200,
452+
array_one = Array(mount=FixedMount(surface_tilt=20, surface_azimuth=200),
452453
module_parameters=module_parameters,
453454
temperature_model_parameters=temperature_model_parameters,
454455
modules_per_string=10, strings=2)
455-
array_two = Array(surface_tilt=20, surface_azimuth=160,
456+
array_two = Array(mount=FixedMount(surface_tilt=20, surface_azimuth=160),
456457
module_parameters=module_parameters,
457458
temperature_model_parameters=temperature_model_parameters,
458459
modules_per_string=10, strings=2)

docs/sphinx/source/pvsystem.rst

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ provided for each array, and the arrays are provided to
138138
.. ipython:: python
139139
140140
module_parameters = {'pdc0': 5000, 'gamma_pdc': -0.004}
141-
array_one = pvsystem.Array(module_parameters=module_parameters)
142-
array_two = pvsystem.Array(module_parameters=module_parameters)
141+
mount = pvsystem.FixedMount(surface_tilt=20, surface_azimuth=180)
142+
array_one = pvsystem.Array(mount=mount, module_parameters=module_parameters)
143+
array_two = pvsystem.Array(mount=mount, module_parameters=module_parameters)
143144
system_two_arrays = pvsystem.PVSystem(arrays=[array_one, array_two],
144145
inverter_parameters=inverter_parameters)
145146
print([array.module_parameters for array in system_two_arrays.arrays])
@@ -148,7 +149,7 @@ provided for each array, and the arrays are provided to
148149
149150
The :py:class:`~pvlib.pvsystem.Array` class includes those
150151
:py:class:`~pvlib.pvsystem.PVSystem` attributes that may vary from array
151-
to array. These attributes include `surface_tilt`, `surface_azimuth`,
152+
to array. These attributes include
152153
`module_parameters`, `temperature_model_parameters`, `modules_per_string`,
153154
`strings_per_inverter`, `albedo`, `surface_type`, `module_type`, and
154155
`racking_model`.
@@ -179,27 +180,30 @@ Tilt and azimuth
179180
The first parameters which describe the DC part of a PV system are the tilt
180181
and azimuth of the modules. In the case of a PV system with a single array,
181182
these parameters can be specified using the `PVSystem.surface_tilt` and
182-
`PVSystem.surface_azimuth` attributes.
183+
`PVSystem.surface_azimuth` attributes. This will automatically create
184+
an :py:class:`~pvlib.pvsystem.Array` with a :py:class:`~pvlib.pvsystem.FixedMount`
185+
at the specified tilt and azimuth:
183186

184187
.. ipython:: python
185188
186189
# single south-facing array at 20 deg tilt
187190
system_one_array = pvsystem.PVSystem(surface_tilt=20, surface_azimuth=180)
188-
print(system_one_array.arrays[0].surface_tilt,
189-
system_one_array.arrays[0].surface_azimuth)
191+
print(system_one_array.arrays[0].mount)
190192
191193
192194
In the case of a PV system with several arrays, the parameters are specified
193-
for each array using the attributes `Array.surface_tilt` and `Array.surface_azimuth`.
195+
for each array by passing a different :py:class:`~pvlib.pvsystem.FixedMount`
196+
(or another `Mount` class):
194197

195198
.. ipython:: python
196199
197-
array_one = pvsystem.Array(surface_tilt=30, surface_azimuth=90)
198-
print(array_one.surface_tilt, array_one.surface_azimuth)
199-
array_two = pvsystem.Array(surface_tilt=30, surface_azimuth=220)
200+
array_one = pvsystem.Array(pvsystem.FixedMount(surface_tilt=30, surface_azimuth=90))
201+
print(array_one.mount.surface_tilt, array_one.mount.surface_azimuth)
202+
array_two = pvsystem.Array(pvsystem.FixedMount(surface_tilt=30, surface_azimuth=220))
200203
system = pvsystem.PVSystem(arrays=[array_one, array_two])
201204
system.num_arrays
202-
[(array.surface_tilt, array.surface_azimuth) for array in system.arrays]
205+
for array in system.arrays:
206+
print(array.mount)
203207
204208
205209
The `surface_tilt` and `surface_azimuth` attributes are used in PVSystem
@@ -215,8 +219,7 @@ and `solar_azimuth` as arguments.
215219
216220
# single south-facing array at 20 deg tilt
217221
system_one_array = pvsystem.PVSystem(surface_tilt=20, surface_azimuth=180)
218-
print(system_one_array.arrays[0].surface_tilt,
219-
system_one_array.arrays[0].surface_azimuth)
222+
print(system_one_array.arrays[0].mount)
220223
221224
# call get_aoi with solar_zenith, solar_azimuth
222225
aoi = system_one_array.get_aoi(solar_zenith=30, solar_azimuth=180)
@@ -229,7 +232,7 @@ operates in a similar manner.
229232
.. ipython:: python
230233
231234
# two arrays each at 30 deg tilt with different facing
232-
array_one = pvsystem.Array(surface_tilt=30, surface_azimuth=90)
235+
array_one = pvsystem.Array(pvsystem.FixedMount(surface_tilt=30, surface_azimuth=90))
233236
array_one_aoi = array_one.get_aoi(solar_zenith=30, solar_azimuth=180)
234237
print(array_one_aoi)
235238
@@ -240,7 +243,7 @@ operates on all `Array` instances in the `PVSystem`, whereas the the
240243

241244
.. ipython:: python
242245
243-
array_two = pvsystem.Array(surface_tilt=30, surface_azimuth=220)
246+
array_two = pvsystem.Array(pvsystem.FixedMount(surface_tilt=30, surface_azimuth=220))
244247
system_multiarray = pvsystem.PVSystem(arrays=[array_one, array_two])
245248
print(system_multiarray.num_arrays)
246249
# call get_aoi with solar_zenith, solar_azimuth
@@ -315,8 +318,8 @@ Losses
315318

316319
The `losses_parameters` attribute contains data that may be used with
317320
methods that calculate system losses. At present, these methods include
318-
only :py:meth:`PVSystem.pvwatts_losses` and
319-
:py:func:`pvsystem.pvwatts_losses`, but we hope to add more related functions
321+
only :py:meth:`pvlib.pvsystem.PVSystem.pvwatts_losses` and
322+
:py:func:`pvlib.pvsystem.pvwatts_losses`, but we hope to add more related functions
320323
and methods in the future.
321324

322325

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,20 @@ Deprecations
100100
* ``PVSystem.surface_azimuth``
101101
* ``PVSystem.temperature_model_parameters``
102102

103+
* The :py:class:`pvlib.tracking.SingleAxisTracker` class is deprecated and
104+
replaced by using :py:class:`pvlib.pvsystem.PVSystem` with the new
105+
:py:class:`pvlib.pvsystem.SingleAxisTrackerMount` (:pull:`1176`)
106+
103107

104108
Enhancements
105109
~~~~~~~~~~~~
106-
* Add :func:`~pvlib.iotools.read_bsrn` for reading BSRN solar radiation data
107-
files. (:pull:`1145`, :issue:`1015`)
110+
* Added :func:`~pvlib.iotools.read_pvgis_hourly` and
111+
:func:`~pvlib.iotools.get_pvgis_hourly` for reading and retrieving hourly
112+
solar radiation data and PV power output from PVGIS. (:pull:`1186`,
113+
:issue:`849`)
114+
* Add :func:`~pvlib.iotools.get_bsrn` and :func:`~pvlib.iotools.read_bsrn`
115+
for retrieving and reading BSRN solar radiation data files.
116+
(:pull:`1254`, :pull:`1145`, :issue:`1015`)
108117
* Add :func:`~pvlib.iotools.get_cams`,
109118
:func:`~pvlib.iotools.parse_cams`, and
110119
:func:`~pvlib.iotools.read_cams`
@@ -116,6 +125,9 @@ Enhancements
116125
* Added :py:class:`~pvlib.pvsystem.Array` class to represent an array of
117126
modules separately from a :py:class:`~pvlib.pvsystem.PVSystem`.
118127
(:pull:`1076`, :issue:`1067`)
128+
* Added :py:class:`~pvlib.pvsystem.FixedMount` and
129+
:py:class:`~pvlib.pvsystem.SingleAxisTrackerMount` classes to use with
130+
the new :py:class:`~pvlib.pvsystem.Array` class (:pull:`1176`)
119131
* Added capability for modeling a PV system with multiple arrays in
120132
:py:class:`~pvlib.pvsystem.PVSystem`. Updates the ``PVSystem`` API
121133
to operate on and return tuples where each element of the tuple corresponds
@@ -179,6 +191,8 @@ Bug fixes
179191
passing a pandas time series with a sampling rate faster than 1 second.
180192
(:issue:`1257`, :pull:`1258`)
181193
(:issue:`1257`, :pull:``)
194+
* Changed deprecated use of ``.astype()`` to ``.view()`` in :py:mod:`~pvlib.solarposition`.
195+
(:pull:`1256`, :issue:`1261`, :pull:`1262`)
182196

183197
Testing
184198
~~~~~~~
@@ -216,3 +230,5 @@ Contributors
216230
* Miguel Sánchez de León Peque (:ghuser:`Peque`)
217231
* Joe Ranalli (:ghuser:`jranalli`)
218232
* Chas Schweizer (:ghuser:`cpr-chas`)
233+
* Yoann Louvet (:ghuser:`YoannUniKS`)
234+
* Brandon Carpenter (:ghuser:`hashstat`)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"inputs": {"location": {"latitude": 45.0, "longitude": 8.0, "elevation": 250.0}, "meteo_data": {"radiation_db": "PVGIS-CMSAF", "meteo_db": "ERA-Interim", "year_min": 2013, "year_max": 2014, "use_horizon": true, "horizon_db": null, "horizon_data": "DEM-calculated"}, "mounting_system": {"two_axis": {"slope": {"value": "-", "optimal": "-"}, "azimuth": {"value": "-", "optimal": "-"}}}, "pv_module": {"technology": "CIS", "peak_power": 10.0, "system_loss": 5.0}}, "outputs": {"hourly": [{"time": "20130101:0055", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 3.01, "WS10m": 1.23, "Int": 0.0}, {"time": "20130101:0155", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 2.22, "WS10m": 1.46, "Int": 0.0}, {"time": "20130101:0255", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 1.43, "WS10m": 1.7, "Int": 0.0}, {"time": "20130101:0355", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 0.64, "WS10m": 1.93, "Int": 0.0}, {"time": "20130101:0455", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 0.77, "WS10m": 1.8, "Int": 0.0}, {"time": "20130101:0555", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 0.91, "WS10m": 1.66, "Int": 0.0}, {"time": "20130101:0655", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 1.05, "WS10m": 1.53, "Int": 0.0}, {"time": "20130101:0755", "P": 3464.5, "Gb(i)": 270.35, "Gd(i)": 91.27, "Gr(i)": 6.09, "H_sun": 6.12, "T2m": 1.92, "WS10m": 1.44, "Int": 0.0}, {"time": "20130101:0855", "P": 1586.9, "Gb(i)": 80.76, "Gd(i)": 83.95, "Gr(i)": 9.04, "H_sun": 13.28, "T2m": 2.79, "WS10m": 1.36, "Int": 0.0}, {"time": "20130101:0955", "P": 713.3, "Gb(i)": 5.18, "Gd(i)": 70.57, "Gr(i)": 7.31, "H_sun": 18.56, "T2m": 3.66, "WS10m": 1.27, "Int": 0.0}]}, "meta": {"inputs": {"location": {"description": "Selected location", "variables": {"latitude": {"description": "Latitude", "units": "decimal degree"}, "longitude": {"description": "Longitude", "units": "decimal degree"}, "elevation": {"description": "Elevation", "units": "m"}}}, "meteo_data": {"description": "Sources of meteorological data", "variables": {"radiation_db": {"description": "Solar radiation database"}, "meteo_db": {"description": "Database used for meteorological variables other than solar radiation"}, "year_min": {"description": "First year of the calculations"}, "year_max": {"description": "Last year of the calculations"}, "use_horizon": {"description": "Include horizon shadows"}, "horizon_db": {"description": "Source of horizon data"}}}, "mounting_system": {"description": "Mounting system", "choices": "fixed, vertical_axis, inclined_axis, two_axis", "fields": {"slope": {"description": "Inclination angle from the horizontal plane", "units": "degree"}, "azimuth": {"description": "Orientation (azimuth) angle of the (fixed) PV system (0 = S, 90 = W, -90 = E)", "units": "degree"}}}, "pv_module": {"description": "PV module parameters", "variables": {"technology": {"description": "PV technology"}, "peak_power": {"description": "Nominal (peak) power of the PV module", "units": "kW"}, "system_loss": {"description": "Sum of system losses", "units": "%"}}}}, "outputs": {"hourly": {"type": "time series", "timestamp": "hourly averages", "variables": {"P": {"description": "PV system power", "units": "W"}, "Gb(i)": {"description": "Beam (direct) irradiance on the inclined plane (plane of the array)", "units": "W/m2"}, "Gd(i)": {"description": "Diffuse irradiance on the inclined plane (plane of the array)", "units": "W/m2"}, "Gr(i)": {"description": "Reflected irradiance on the inclined plane (plane of the array)", "units": "W/m2"}, "H_sun": {"description": "Sun height", "units": "degree"}, "T2m": {"description": "2-m air temperature", "units": "degree Celsius"}, "WS10m": {"description": "10-m total wind speed", "units": "m/s"}, "Int": {"description": "1 means solar radiation values are reconstructed"}}}}}}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Latitude (decimal degrees): 45.000
2+
Longitude (decimal degrees): 8.000
3+
Elevation (m): 250
4+
Radiation database: PVGIS-SARAH
5+
6+
7+
Slope: 30 deg.
8+
Azimuth: 0 deg.
9+
time,Gb(i),Gd(i),Gr(i),H_sun,T2m,WS10m,Int
10+
20160101:0010,0.0,0.0,0.0,0.0,3.44,1.43,0.0
11+
20160101:0110,0.0,0.0,0.0,0.0,2.94,1.47,0.0
12+
20160101:0210,0.0,0.0,0.0,0.0,2.43,1.51,0.0
13+
20160101:0310,0.0,0.0,0.0,0.0,1.93,1.54,0.0
14+
20160101:0410,0.0,0.0,0.0,0.0,2.03,1.62,0.0
15+
20160101:0510,0.0,0.0,0.0,0.0,2.14,1.69,0.0
16+
20160101:0610,0.0,0.0,0.0,0.0,2.25,1.77,0.0
17+
20160101:0710,0.0,0.0,0.0,0.0,3.06,1.49,0.0
18+
20160101:0810,26.71,8.28,0.21,8.06,3.87,1.22,1.0
19+
20160101:0910,14.69,5.76,0.16,14.8,4.67,0.95,1.0
20+
20160101:1010,2.19,0.94,0.03,19.54,5.73,0.77,1.0
21+
20160101:1110,2.11,0.94,0.03,21.82,6.79,0.58,1.0
22+
20160101:1210,4.25,1.88,0.05,21.41,7.84,0.4,1.0
23+
20160101:1310,0.0,0.0,0.0,0.0,7.43,0.72,0.0
24+
25+
Gb(i): Beam (direct) irradiance on the inclined plane (plane of the array) (W/m2)
26+
Gd(i): Diffuse irradiance on the inclined plane (plane of the array) (W/m2)
27+
Gr(i): Reflected irradiance on the inclined plane (plane of the array) (W/m2)
28+
H_sun: Sun height (degree)
29+
T2m: 2-m air temperature (degree Celsius)
30+
WS10m: 10-m total wind speed (m/s)
31+
Int: 1 means solar radiation values are reconstructed
32+
33+
34+
35+
PVGIS (c) European Union, 2001-2021

pvlib/data/variables_style_rules.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dni_extra;direct normal irradiance at top of atmosphere (extraterrestrial)
77
dhi;diffuse horizontal irradiance
88
bhi;beam/direct horizontal irradiance
99
ghi;global horizontal irradiance
10+
gri;ground-reflected irradiance
1011
aoi;angle of incidence between :math:`90\deg` and :math:`90\deg`
1112
aoi_projection;cos(aoi)
1213
airmass;airmass

pvlib/iotools/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
from pvlib.iotools.psm3 import read_psm3 # noqa: F401
1414
from pvlib.iotools.psm3 import parse_psm3 # noqa: F401
1515
from pvlib.iotools.pvgis import get_pvgis_tmy, read_pvgis_tmy # noqa: F401
16+
from pvlib.iotools.pvgis import read_pvgis_hourly # noqa: F401
17+
from pvlib.iotools.pvgis import get_pvgis_hourly # noqa: F401
18+
from pvlib.iotools.bsrn import get_bsrn # noqa: F401
1619
from pvlib.iotools.bsrn import read_bsrn # noqa: F401
20+
from pvlib.iotools.bsrn import parse_bsrn # noqa: F401
1721
from pvlib.iotools.sodapro import get_cams # noqa: F401
1822
from pvlib.iotools.sodapro import read_cams # noqa: F401
1923
from pvlib.iotools.sodapro import parse_cams # noqa: F401

0 commit comments

Comments
 (0)