Skip to content

Commit 933000d

Browse files
committed
Revert "Rename pvwatts to pvwattsv5 everywhere (pvlib#1558)"
This reverts commit e6e5b04.
1 parent 5a7c541 commit 933000d

File tree

13 files changed

+238
-515
lines changed

13 files changed

+238
-515
lines changed

docs/examples/bifacial/plot_bifi_model_pvwatts.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# %%
99
# This example shows how to complete a bifacial modeling example using the
10-
# :py:func:`pvlib.pvsystem.pvwattsv5_dc` with the
10+
# :py:func:`pvlib.pvsystem.pvwatts_dc` with the
1111
# :py:func:`pvlib.bifacial.pvfactors.pvfactors_timeseries` function to
1212
# transpose GHI data to both front and rear Plane of Array (POA) irradiance.
1313

@@ -83,27 +83,27 @@
8383
temp_cell = temperature.faiman(effective_irrad_bifi, temp_air=25,
8484
wind_speed=1)
8585

86-
# using the pvwattsv5_dc model and parameters detailed above,
86+
# using the pvwatts_dc model and parameters detailed above,
8787
# set pdc0 and return DC power for both bifacial and monofacial
8888
pdc0 = 1
8989
gamma_pdc = -0.0043
90-
pdc_bifi = pvsystem.pvwattsv5_dc(effective_irrad_bifi,
91-
temp_cell,
92-
pdc0,
93-
gamma_pdc=gamma_pdc
94-
).fillna(0)
90+
pdc_bifi = pvsystem.pvwatts_dc(effective_irrad_bifi,
91+
temp_cell,
92+
pdc0,
93+
gamma_pdc=gamma_pdc
94+
).fillna(0)
9595
pdc_bifi.plot(title='Bifacial Simulation on June Solstice', ylabel='DC Power')
9696

9797
# %%
9898
# For illustration, perform monofacial simulation using pvfactors front-side
9999
# irradiance (AOI-corrected), and plot along with bifacial results.
100100

101101
effective_irrad_mono = irrad['total_abs_front']
102-
pdc_mono = pvsystem.pvwattsv5_dc(effective_irrad_mono,
103-
temp_cell,
104-
pdc0,
105-
gamma_pdc=gamma_pdc
106-
).fillna(0)
102+
pdc_mono = pvsystem.pvwatts_dc(effective_irrad_mono,
103+
temp_cell,
104+
pdc0,
105+
gamma_pdc=gamma_pdc
106+
).fillna(0)
107107

108108
# plot monofacial results
109109
plt.figure()

docs/sphinx/source/reference/modelchain.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ ModelChain model definitions.
8181
modelchain.ModelChain.desoto
8282
modelchain.ModelChain.pvsyst
8383
modelchain.ModelChain.pvwatts_dc
84-
modelchain.ModelChain.pvwattsv5_dc
8584
modelchain.ModelChain.sandia_inverter
8685
modelchain.ModelChain.adr_inverter
8786
modelchain.ModelChain.pvwatts_inverter
88-
modelchain.ModelChain.pvwattsv5_inverter
8987
modelchain.ModelChain.ashrae_aoi_loss
9088
modelchain.ModelChain.physical_aoi_loss
9189
modelchain.ModelChain.sapm_aoi_loss
@@ -100,7 +98,6 @@ ModelChain model definitions.
10098
modelchain.ModelChain.dc_ohmic_model
10199
modelchain.ModelChain.no_dc_ohmic_loss
102100
modelchain.ModelChain.pvwatts_losses
103-
modelchain.ModelChain.pvwattsv5_losses
104101
modelchain.ModelChain.no_extra_losses
105102

106103
Inference methods

docs/sphinx/source/reference/pv_modeling.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ Inverter models (DC to AC conversion)
107107
inverter.sandia_multi
108108
inverter.adr
109109
inverter.pvwatts
110-
inverter.pvwattsv5
111110
inverter.pvwatts_multi
112-
inverter.pvwattsv5_multi
113111

114112
Functions for fitting inverter models
115113

@@ -154,11 +152,8 @@ PVWatts model
154152
:toctree: generated/
155153

156154
pvsystem.pvwatts_dc
157-
pvsystem.pvwattsv5_dc
158155
inverter.pvwatts
159-
inverter.pvwattsv5
160156
pvsystem.pvwatts_losses
161-
pvsystem.pvwattsv5_losses
162157

163158
Estimating PV model parameters
164159
------------------------------

docs/sphinx/source/user_guide/modelchain.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -290,25 +290,25 @@ Wrapping methods into a unified API
290290
Readers may notice that the source code of the :py:meth:`~pvlib.modelchain.ModelChain.run_model`
291291
method is model-agnostic. :py:meth:`~pvlib.modelchain.ModelChain.run_model` calls generic methods
292292
such as ``self.dc_model`` rather than a specific model such as
293-
``pvwattsv5_dc``. So how does :py:meth:`~pvlib.modelchain.ModelChain.run_model` know what models
293+
``pvwatts_dc``. So how does :py:meth:`~pvlib.modelchain.ModelChain.run_model` know what models
294294
it’s supposed to run? The answer comes in two parts, and allows us to
295295
explore more of the ModelChain API along the way.
296296

297297
First, ModelChain has a set of methods that wrap the PVSystem methods
298298
that perform the calculations (or further wrap the pvsystem.py module’s
299299
functions). Each of these methods takes the same arguments (``self``)
300300
and sets the same attributes, thus creating a uniform API. For example,
301-
the :py:meth:`~pvlib.modelchain.ModelChain.pvwattsv5_dc` method is shown below. Its only argument is
301+
the :py:meth:`~pvlib.modelchain.ModelChain.pvwatts_dc` method is shown below. Its only argument is
302302
``self``, and it sets the ``dc`` attribute.
303303

304304
.. ipython:: python
305305
306-
mc.pvwattsv5_dc??
306+
mc.pvwatts_dc??
307307
308-
The :py:meth:`~pvlib.modelchain.ModelChain.pvwattsv5_dc` method calls the pvwattsv5_dc method of the
308+
The :py:meth:`~pvlib.modelchain.ModelChain.pvwatts_dc` method calls the pvwatts_dc method of the
309309
PVSystem object that we supplied when we created the ModelChain instance,
310310
using data that is stored in the ModelChain ``effective_irradiance`` and
311-
``cell_temperature`` attributes. The :py:meth:`~pvlib.modelchain.ModelChain.pvwattsv5_dc` method assigns its
311+
``cell_temperature`` attributes. The :py:meth:`~pvlib.modelchain.ModelChain.pvwatts_dc` method assigns its
312312
result to the ``dc`` attribute of the ModelChain's ``results`` object. The code
313313
below shows a simple example of this.
314314

@@ -322,21 +322,21 @@ below shows a simple example of this.
322322
mc = ModelChain(pvwatts_system, location,
323323
aoi_model='no_loss', spectral_model='no_loss')
324324
325-
# manually assign data to the attributes that ModelChain.pvwattsv5_dc will need.
325+
# manually assign data to the attributes that ModelChain.pvwatts_dc will need.
326326
# for standard workflows, run_model would assign these attributes.
327327
mc.results.effective_irradiance = pd.Series(1000, index=[pd.Timestamp('20170401 1200-0700')])
328328
mc.results.cell_temperature = pd.Series(50, index=[pd.Timestamp('20170401 1200-0700')])
329329
330-
# run ModelChain.pvwattsv5_dc and look at the result
331-
mc.pvwattsv5_dc();
330+
# run ModelChain.pvwatts_dc and look at the result
331+
mc.pvwatts_dc();
332332
mc.results.dc
333333
334334
The :py:meth:`~pvlib.modelchain.ModelChain.sapm` method works in a manner similar
335-
to the :py:meth:`~pvlib.modelchain.ModelChain.pvwattsv5_dc`
335+
to the :py:meth:`~pvlib.modelchain.ModelChain.pvwatts_dc`
336336
method. It calls the :py:meth:`~pvlib.pvsystem.PVSystem.sapm` method using stored data, then
337337
assigns the result to the ``dc`` attribute of ``ModelChain.results``.
338338
The :py:meth:`~pvlib.modelchain.ModelChain.sapm` method differs from the
339-
:py:meth:`~pvlib.modelchain.ModelChain.pvwattsv5_dc` method in
339+
:py:meth:`~pvlib.modelchain.ModelChain.pvwatts_dc` method in
340340
a notable way: the PVSystem.sapm method returns a DataFrame with current,
341341
voltage, and power results, rather than a simple Series
342342
of power. The ModelChain methods for single diode models (e.g.,
@@ -370,7 +370,7 @@ DC quantities to the output of the full PVSystem.
370370
mc.sapm();
371371
mc.results.dc
372372
373-
We’ve established that the ``ModelChain.pvwattsv5_dc`` and
373+
We’ve established that the ``ModelChain.pvwatts_dc`` and
374374
``ModelChain.sapm`` have the same API: they take the same arugments
375375
(``self``) and they both set the ``dc`` attribute.\* Because the methods
376376
have the same API, we can call them in the same way. ModelChain includes
@@ -381,7 +381,7 @@ Again, so how does :py:meth:`~pvlib.modelchain.ModelChain.run_model` know which
381381
models it’s supposed to run?
382382

383383
At object construction, ModelChain assigns the desired model’s method
384-
(e.g. ``ModelChain.pvwattsv5_dc``) to the corresponding generic attribute
384+
(e.g. ``ModelChain.pvwatts_dc``) to the corresponding generic attribute
385385
(e.g. ``ModelChain.dc_model``) either with the value assigned to the ``dc_model``
386386
parameter at construction, or by inference as described in the next
387387
section.
@@ -428,15 +428,15 @@ method.
428428
mc.infer_ac_model??
429429
pvlib.modelchain._snl_params??
430430
pvlib.modelchain._adr_params??
431-
pvlib.modelchain._pvwattsv5_params??
431+
pvlib.modelchain._pvwatts_params??
432432
433433
ModelChain for a PVSystem with multiple Arrays
434434
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435435

436436
The PVSystem can represent a PV system with a single array of modules, or
437437
with multiple arrays (see :ref:`multiarray`). The same models are applied to
438438
all ``PVSystem.array`` objects, so each ``Array`` must contain the appropriate model
439-
parameters. For example, if ``ModelChain.dc_model='pvwattsv5'``, then each
439+
parameters. For example, if ``ModelChain.dc_model='pvwatts'``, then each
440440
``Array.module_parameters`` must contain ``'pdc0'``.
441441

442442
When the PVSystem contains multiple arrays, ``ModelChain.results`` attributes

docs/sphinx/source/user_guide/pvsystem.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,28 @@ that describe a PV system's modules and inverter are stored in
7070
7171
7272
Extrinsic data is passed to the arguments of PVSystem methods. For example,
73-
the :py:meth:`~pvlib.pvsystem.PVSystem.pvwattsv5_dc` method accepts extrinsic
73+
the :py:meth:`~pvlib.pvsystem.PVSystem.pvwatts_dc` method accepts extrinsic
7474
data irradiance and temperature.
7575

7676
.. ipython:: python
7777
78-
pdc = system.pvwattsv5_dc(g_poa_effective=1000, temp_cell=30)
78+
pdc = system.pvwatts_dc(g_poa_effective=1000, temp_cell=30)
7979
print(pdc)
8080
8181
Methods attached to a PVSystem object wrap the corresponding functions in
8282
:py:mod:`~pvlib.pvsystem`. The methods simplify the argument list by
8383
using data stored in the PVSystem attributes. Compare the
84-
:py:meth:`~pvlib.pvsystem.PVSystem.pvwattsv5_dc` method signature to the
85-
:py:func:`~pvlib.pvsystem.pvwattsv5_dc` function signature:
84+
:py:meth:`~pvlib.pvsystem.PVSystem.pvwatts_dc` method signature to the
85+
:py:func:`~pvlib.pvsystem.pvwatts_dc` function signature:
8686

87-
* :py:meth:`PVSystem.pvwattsv5_dc(g_poa_effective, temp_cell) <pvlib.pvsystem.PVSystem.pvwattsv5_dc>`
88-
* :py:func:`pvwattsv5_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.) <pvlib.pvsystem.pvwattsv5_dc>`
87+
* :py:meth:`PVSystem.pvwatts_dc(g_poa_effective, temp_cell) <pvlib.pvsystem.PVSystem.pvwatts_dc>`
88+
* :py:func:`pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.) <pvlib.pvsystem.pvwatts_dc>`
8989

90-
How does this work? The :py:meth:`~pvlib.pvsystem.PVSystem.pvwattsv5_dc`
90+
How does this work? The :py:meth:`~pvlib.pvsystem.PVSystem.pvwatts_dc`
9191
method looks in `PVSystem.module_parameters` for the `pdc0`, and
92-
`gamma_pdc` arguments. Then the :py:meth:`PVSystem.pvwattsv5_dc
93-
<pvlib.pvsystem.PVSystem.pvwattsv5_dc>` method calls the
94-
:py:func:`pvsystem.pvwattsv5_dc <pvlib.pvsystem.pvwattsv5_dc>` function with
92+
`gamma_pdc` arguments. Then the :py:meth:`PVSystem.pvwatts_dc
93+
<pvlib.pvsystem.PVSystem.pvwatts_dc>` method calls the
94+
:py:func:`pvsystem.pvwatts_dc <pvlib.pvsystem.pvwatts_dc>` function with
9595
all of the arguments and returns the result to the user. Note that the
9696
function includes a default value for the parameter `temp_ref`. This
9797
default value may be overridden by specifying the `temp_ref` key in the
@@ -101,7 +101,7 @@ default value may be overridden by specifying the `temp_ref` key in the
101101
102102
system.arrays[0].module_parameters['temp_ref'] = 0
103103
# lower temp_ref should lead to lower DC power than calculated above
104-
pdc = system.pvwattsv5_dc(1000, 30)
104+
pdc = system.pvwatts_dc(1000, 30)
105105
print(pdc)
106106
107107
Multiple methods may pull data from the same attribute. For example, the
@@ -320,8 +320,8 @@ Losses
320320

321321
The `losses_parameters` attribute contains data that may be used with
322322
methods that calculate system losses. At present, these methods include
323-
only :py:meth:`pvlib.pvsystem.PVSystem.pvwattsv5_losses` and
324-
:py:func:`pvlib.pvsystem.pvwattsv5_losses`, but we hope to add more related functions
323+
only :py:meth:`pvlib.pvsystem.PVSystem.pvwatts_losses` and
324+
:py:func:`pvlib.pvsystem.pvwatts_losses`, but we hope to add more related functions
325325
and methods in the future.
326326

327327

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,6 @@ v0.9.4 (anticipated December 2022)
55

66
Deprecations
77
~~~~~~~~~~~~
8-
* In anticipation of implementing newer versions of the PVWatts model
9-
in the future and to clarify the relevant PVWatts model version for
10-
existing functionality, several parts of pvlib have been renamed from
11-
`pvwatts` to `pvwattsv5`:
12-
13-
* ``pvlib.inverter.pvwatts`` is now :py:func:`pvlib.inverter.pvwattsv5`
14-
* ``pvlib.inverter.pvwatts_multi`` is now :py:func:`pvlib.inverter.pvwattsv5_multi`
15-
* ``pvlib.pvsystem.pvwatts_dc`` is now :py:func:`pvlib.pvsystem.pvwattsv5_dc`
16-
* ``pvlib.pvsystem.pvwatts_losses`` is now :py:func:`pvlib.pvsystem.pvwattsv5_losses`
17-
* ``pvlib.pvsystem.PVSystem.pvwatts_dc`` is now :py:meth:`pvlib.pvsystem.PVSystem.pvwattsv5_dc`
18-
* ``pvlib.pvsystem.PVSystem.pvwatts_losses`` is now :py:meth:`pvlib.pvsystem.PVSystem.pvwattsv5_losses`
19-
* ``pvlib.modelchain.ModelChain.pvwatts_dc`` is now :py:meth:`pvlib.modelchain.ModelChain.pvwattsv5_dc`
20-
* ``pvlib.modelchain.ModelChain.pvwatts_inverter`` is now :py:meth:`pvlib.modelchain.ModelChain.pvwattsv5_inverter`
21-
* ``pvlib.modelchain.ModelChain.pvwatts_losses`` is now :py:meth:`pvlib.modelchain.ModelChain.pvwattsv5_losses`
22-
23-
* The ``model`` parameter to :py:meth:`pvlib.pvsystem.PVSystem.get_ac` should
24-
now be ``'pvwattsv5'`` instead of ``'pvwatts'``.
25-
* The ``dc_model``, ``ac_model``, and ``losses_model`` parameters of
26-
:py:class:`pvlib.modelchain.ModelChain` should now be ``'pvwattsv5'``
27-
instead of ``'pvwatts'``.
28-
29-
The originals should continue to work for now (emitting a deprecation warning),
30-
but will be removed in a future release. (:issue:`1350`, :pull:`1558`)
318

329

3310
Enhancements

pvlib/inverter.py

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import pandas as pd
1515
from numpy.polynomial.polynomial import polyfit # different than np.polyfit
1616

17-
from pvlib._deprecation import deprecated
1817

1918
def _sandia_eff(v_dc, p_dc, inverter):
2019
r'''
@@ -331,9 +330,9 @@ def adr(v_dc, p_dc, inverter, vtol=0.10):
331330
return power_ac
332331

333332

334-
def pvwattsv5(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
333+
def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
335334
r"""
336-
NREL's PVWatts v5 inverter model.
335+
NREL's PVWatts inverter model.
337336
338337
The PVWatts inverter model [1]_ calculates inverter efficiency :math:`\eta`
339338
as a function of input DC power
@@ -371,14 +370,14 @@ def pvwattsv5(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
371370
Notes
372371
-----
373372
Note that ``pdc0`` is also used as a symbol in
374-
:py:func:`pvlib.pvsystem.pvwattsv5_dc`. ``pdc0`` in this function refers to
373+
:py:func:`pvlib.pvsystem.pvwatts_dc`. ``pdc0`` in this function refers to
375374
the DC power input limit of the inverter. ``pdc0`` in
376-
:py:func:`pvlib.pvsystem.pvwattsv5_dc` refers to the DC power of the
377-
modules at reference conditions.
375+
:py:func:`pvlib.pvsystem.pvwatts_dc` refers to the DC power of the modules
376+
at reference conditions.
378377
379378
See Also
380379
--------
381-
pvlib.inverter.pvwattsv5_multi
380+
pvlib.inverter.pvwatts_multi
382381
383382
References
384383
----------
@@ -405,19 +404,13 @@ def pvwattsv5(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
405404
return power_ac
406405

407406

408-
pvwatts = deprecated(since='0.9.4',
409-
name='pvwatts',
410-
alternative='pvwattsv5',
411-
removal='0.11')(pvwattsv5)
412-
413-
414-
def pvwattsv5_multi(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
407+
def pvwatts_multi(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
415408
r"""
416-
Extend NREL's PVWatts v5 inverter model for multiple MPPT inputs.
409+
Extend NREL's PVWatts inverter model for multiple MPP inputs.
417410
418-
DC input power is summed over MPPT inputs to obtain the DC power
419-
input to the PVWatts v5 inverter model.
420-
See :py:func:`pvlib.inverter.pvwattsv5` for details.
411+
DC input power is summed over MPP inputs to obtain the DC power
412+
input to the PVWatts inverter model. See :py:func:`pvlib.inverter.pvwatts`
413+
for details.
421414
422415
Parameters
423416
----------
@@ -439,15 +432,9 @@ def pvwattsv5_multi(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
439432
440433
See Also
441434
--------
442-
pvlib.inverter.pvwattsv5
435+
pvlib.inverter.pvwatts
443436
"""
444-
return pvwattsv5(sum(pdc), pdc0, eta_inv_nom, eta_inv_ref)
445-
446-
447-
pvwatts_multi = deprecated(since='0.9.4',
448-
name='pvwatts_multi',
449-
alternative='pvwattsv5_multi',
450-
removal='0.11')(pvwattsv5_multi)
437+
return pvwatts(sum(pdc), pdc0, eta_inv_nom, eta_inv_ref)
451438

452439

453440
def fit_sandia(ac_power, dc_power, dc_voltage, dc_voltage_level, p_ac_0, p_nt):

0 commit comments

Comments
 (0)