Skip to content

Commit

Permalink
clean up 0.8 whatsnew, other minor doc issues (#1054)
Browse files Browse the repository at this point in the history
* remove api entry for pvsystem.sapm_aoi_loss

* fix issues in api.rst and whatsnew

* xarray whats new pattern

* fix various rst issues

* missing issues and contributors

* remove travis badge from readme

* Update docs/sphinx/source/whatsnew/v0.8.0.rst

Co-authored-by: Kevin Anderson <[email protected]>

* review fixes

* backticks, links

* typooooo

Co-authored-by: Kevin Anderson <[email protected]>
  • Loading branch information
wholmgren and kandersolar authored Sep 8, 2020
1 parent a6667a3 commit 72f3783
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 70 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
<tr>
<td>Build Status</td>
<td>
<a href="https://travis-ci.org/pvlib/pvlib-python">
<img src="https://travis-ci.org/pvlib/pvlib-python.svg?branch=master" alt="travis build status" />
</a>
<a href="http://pvlib-python.readthedocs.org/en/stable/">
<img src="https://readthedocs.org/projects/pvlib-python/badge/?version=stable" alt="documentation build status" />
</a>
Expand Down
25 changes: 18 additions & 7 deletions docs/sphinx/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Methods for irradiance calculations

pvsystem.PVSystem.get_irradiance
pvsystem.PVSystem.get_aoi
pvsystem.PVSystem.get_iam
tracking.SingleAxisTracker.get_irradiance

Decomposing and combining irradiance
Expand Down Expand Up @@ -235,9 +236,10 @@ PV temperature models
temperature.pvsyst_cell
temperature.faiman
temperature.fuentes
pvsystem.PVSystem.sapm_celltemp

Temperature Model Parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. currentmodule:: pvlib.temperature
.. autodata:: TEMPERATURE_MODEL_PARAMETERS
:annotation:
Expand Down Expand Up @@ -276,9 +278,9 @@ Functions for fitting diode models
.. autosummary::
:toctree: generated/

ivtools.fit_sde_sandia
ivtools.fit_sdm_cec_sam
ivtools.fit_sdm_desoto
ivtools.sde.fit_sandia_simple
ivtools.sdm.fit_cec_sam
ivtools.sdm.fit_desoto

Inverter models (DC to AC conversion)
-------------------------------------
Expand Down Expand Up @@ -310,7 +312,6 @@ Sandia array performance model (SAPM)
pvsystem.sapm
pvsystem.sapm_effective_irradiance
pvsystem.sapm_spectral_loss
pvsystem.sapm_aoi_loss
inverter.sandia
temperature.sapm_cell

Expand Down Expand Up @@ -360,7 +361,7 @@ Utilities for working with IV curve data
.. autosummary::
:toctree: generated/

ivtools.utility.rectify_iv_curve
ivtools.utils.rectify_iv_curve

Other
-----
Expand All @@ -376,25 +377,35 @@ Effects on PV System Output
===========================

Loss models
^^^^^^^^^^^
-----------

.. autosummary::
:toctree: generated/

pvsystem.combine_loss_factors

Snow
----

.. autosummary::
:toctree: generated/

snow.coverage_nrel
snow.fully_covered_nrel
snow.dc_loss_nrel

Soiling
-------

.. autosummary::
:toctree: generated/

soiling.hsu
soiling.kimber

Shading
-------

.. autosummary::
:toctree: generated/

Expand Down
113 changes: 64 additions & 49 deletions docs/sphinx/source/whatsnew/v0.8.0.rst
Original file line number Diff line number Diff line change
@@ -1,69 +1,42 @@
.. _whatsnew_0800:

v0.8.0 (Month day, year)
-------------------------

API Breaking Changes
~~~~~~~~~~~~~~~~~~~~

* The ``ivtools.py`` module has been reorganized into sub-modules and functions
in ``ivtools.py`` have been renamed (:pull:`708`)
- Functions for fitting diode models are now in ``ivtools\sdm.py``
- :py:func:`pvlib.ivtools.fit_sdm_cec_sam` is now :py:func:`pvlib.ivtools.sdm.fit_cec_sam`
- :py:func:`pvlib.ivtools.fit_sdm_desoto` is now :py:func:`pvlib.ivtools.sdm.fit_desoto`
- Functions for fitting the single diode equation are now in ``ivtools\sde.py``
- :py:func:`pvlib.ivtools.fit_sde_sandia` is now :py:func:`pvlib.ivtools.sde.fit_sandia_simple`

API Changes with Deprecations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Moved functions related to inverters from ``pvsystem.py`` to ``inverter.py``.
Functions are renamed to follow a more consistent pattern, as follows (:pull:`886`):
- :py:func:`pvlib.pvsystem.snlinverter` is now :py:func:`pvlib.inverter.sandia`
- :py:func:`pvlib.pvsystem.pvwatts_ac` is now :py:func:`pvlib.inverter.pvwatts`
- :py:func:`pvlib.pvsystem.adrinverter` is now :py:func:`pvlib.inverter.adr`
* Argument ``ac_model`` for :py:class:`pvlib.modelchain.ModelChain` now accepts
``'sandia'``, ``'pvwatts'`` and ``'adr'`` for the inverter models. (:pull:`886`)
* :py:class:`pvlib.pvsystem.PVSystem` ``module_type`` and ``racking_model`` now
default to ``None``. This continues a deprecation of assuming SAPM values
for cell temperature modeling. In this v0.8 release series, calling
:py:meth:`pvlib.pvsystem.PVSystem.sapm_celltemp` without setting ``PVSystem.temperature model parameters``,
or a valid combination of ``PVsystem.module_type`` and ``PVsystem.racking_model``, will cause
``PVSystem.temperature_model_parameters`` to be set to SAPM values for a
glass/glass module in open racking and emit a warning. In v0.9, users must
provide ``temperature_model_parameters`` or a valid combination of
``module_type`` and ``racking_model``. (:issue:`1030`, :pull:`1033`)
* Deprecated arbitrary keyword arguments for
:py:class:`pvlib.location.Location`, :py:class:`pvlib.pvsystem.PVSystem`,
:py:class:`pvlib.tracking.SingleAxisTracker`, and
:py:class:`pvlib.modelchain.ModelChain`. Supplying arbitrary keyword
to these objects will result in TypeErrors in v0.9. (:issue:`1029`, :pull:`1053`)
* ``pvlib.pvsystem.LocalizedPVSystem`` and ``pvlib.pvsystem.LocalizedSingleAxisTracker``
are deprecated and will be removed in 0.9. Use
:py:class:`pvlib.location.Location`, :py:class:`pvlib.pvsystem.PVSystem`,
:py:class:`pvlib.tracking.SingleAxisTracker`, and
:py:class:`pvlib.modelchain.ModelChain` instead.
(:issue:`1029`, :pull:`1034`, :pull:`1053`)
v0.8.0 (September 8, 2020)
--------------------------

Breaking changes
~~~~~~~~~~~~~~~~
* The ``ivtools.py`` module has been reorganized into a subpackage and functions
in ``ivtools.py`` have been renamed (:pull:`708`):

- Functions for fitting diode models are now in :py:mod:`pvlib.ivtools.sdm`
- :py:func:`pvlib.ivtools.fit_sdm_cec_sam` is now :py:func:`pvlib.ivtools.sdm.fit_cec_sam`
- :py:func:`pvlib.ivtools.fit_sdm_desoto` is now :py:func:`pvlib.ivtools.sdm.fit_desoto`
- Functions for fitting the single diode equation are now in :py:mod:`pvlib.ivtools.sde`
- :py:func:`pvlib.ivtools.fit_sde_sandia` is now :py:func:`pvlib.ivtools.sde.fit_sandia_simple`

API Changes
~~~~~~~~~~~
* Removed ``run_parallel_calculations`` and ``n_workers_for_parallel_calcs``
from :py:func:`pvlib.bifacial.pvfactors_timeseries` inputs (:issue:`902`) (:pull:`934`)

* :py:func:`pvlib.iotools.read_tmy3` can now only read local data files because
the NREL RREDC server hosting the TMY3 dataset has been retired. For
fetching TMY data from NREL servers, :py:func:`pvlib.iotools.get_psm3` is
now recommended to retrieve newer PSM3 data over the older TMY3 data.
(:issue:`996`) (:pull:`1004`)

* The tkinter-based file selection dialog has been removed from
:py:func:`pvlib.iotools.read_tmy2` and :py:func:`pvlib.iotools.read_tmy3`;
the filepath is now a required parameter. (:pull:`1004`)

* Removed ``systemdef`` function from ``pvsystem.py``. This function was not
used in pvlib and its output was not directly compatible with any pvlib
function. See :py:func:`pvlib.iotools.read_tmy2`,
:py:func:`pvlib.iotools.read_tmy3`, :py:meth:`pvlib.location.Location.from_tmy`, and
:py:class:`pvlib.pvsystem.LocalizedPVSystem` for alternatives. (:issue:`965`)
(:pull:`1008`)

* The following functions, methods, and arguments were deprecated in a previous
release and have now been removed (:issue:`966`, :pull:`1033`):

* ``pvsystem.PVSystem.ashraeiam``. Use :py:meth:`pvlib.pvsystem.PVSystem.get_iam`.
* ``pvsystem.PVSystem.physicaliam``. Use :py:meth:`pvlib.pvsystem.PVSystem.get_iam`.
* ``pvsystem.PVSystem.sapm_aoi_loss``. Use :py:meth:`pvlib.pvsystem.PVSystem.get_iam`.
Expand All @@ -80,6 +53,41 @@ API Changes
* ``temp_model`` keyword argument of
:py:meth:`pvlib.modelchain.ModelChain`. Use ``temperature_model`` instead.

Deprecations
~~~~~~~~~~~~
* Moved functions related to inverters from ``pvsystem.py`` to ``inverter.py``.
Functions are renamed to follow a more consistent pattern, as follows (:pull:`886`):

- ``pvlib.pvsystem.snlinverter`` is now :py:func:`pvlib.inverter.sandia`
- ``pvlib.pvsystem.pvwatts_ac`` is now :py:func:`pvlib.inverter.pvwatts`
- ``pvlib.pvsystem.adrinverter`` is now :py:func:`pvlib.inverter.adr`

* Argument ``ac_model`` for :py:class:`pvlib.modelchain.ModelChain` now accepts
``'sandia'``, ``'pvwatts'`` and ``'adr'`` for the inverter models. (:pull:`886`)

* :py:class:`pvlib.pvsystem.PVSystem` ``module_type`` and ``racking_model`` now
default to ``None``. This continues a deprecation of assuming SAPM values
for cell temperature modeling. In this v0.8 release series, calling
:py:meth:`pvlib.pvsystem.PVSystem.sapm_celltemp` without setting ``PVSystem.temperature_model_parameters``,
or a valid combination of ``PVsystem.module_type`` and ``PVsystem.racking_model``, will cause
``PVSystem.temperature_model_parameters`` to be set to SAPM values for a
glass/glass module in open racking and emit a warning. In v0.9, users must
provide ``temperature_model_parameters`` or a valid combination of
``module_type`` and ``racking_model``. (:issue:`1030`, :pull:`1033`)

* Deprecated arbitrary keyword arguments for
:py:class:`pvlib.location.Location`, :py:class:`pvlib.pvsystem.PVSystem`,
:py:class:`pvlib.tracking.SingleAxisTracker`, and
:py:class:`pvlib.modelchain.ModelChain`. Supplying arbitrary keyword
to these objects will result in TypeErrors in v0.9. (:issue:`1029`, :pull:`1053`)

* ``pvlib.pvsystem.LocalizedPVSystem`` and ``pvlib.pvsystem.LocalizedSingleAxisTracker``
are deprecated and will be removed in 0.9. Use
:py:class:`pvlib.location.Location`, :py:class:`pvlib.pvsystem.PVSystem`,
:py:class:`pvlib.tracking.SingleAxisTracker`, and
:py:class:`pvlib.modelchain.ModelChain` instead.
(:issue:`1029`, :pull:`1034`, :pull:`1053`)

Enhancements
~~~~~~~~~~~~
* Update :func:`~pvlib.bifacial.pvfactors_timeseries` to run with ``pvfactors`` v1.4.1 (:issue:`902`)(:pull:`934`)
Expand All @@ -99,9 +107,9 @@ Enhancements
objects configured for the respective modeling paradigms. The
configurations are defined in ``modelchain.PVWATTS_CONFIG``, and
``modelchain.SAPM_CONFIG``. (:issue:`1013`, :pull:`1022`)
* Added *racking_model*, *module_type*, and *temperature_model_parameters* to
PVSystem, LocalizedPVSystem, SingleAxisTracker, and
LocalizedSingleAxisTracker repr methods. (:issue:`1027`)
* Added ``racking_model``, ``module_type``, and ``temperature_model_parameters`` to
:py:class:`~pvlib.pvsystem.PVSystem` and :py:class:`~pvlib.tracking.SingleAxisTracker`
repr methods. (:issue:`1027`)
* Added :py:func:`~pvlib.tracking.calc_axis_tilt` to calculate the
tracker axes tilt and :py:func:`~pvlib.tracking.calc_cross_axis_tilt` to
calculate the cross-axis tilt, which is the angle, relative to horizontal, of
Expand All @@ -126,8 +134,10 @@ Bug fixes
~~~~~~~~~
* Fixed unit and default value errors in :py:func:`pvlib.soiling.hsu`. (:pull:`977`, :pull:`980`)
* Handle NUL characters and fix version column dtype in
:py:func:`~pvlib.iotools.crn.read_crn`. (:issue:`1025`)
:py:func:`~pvlib.iotools.read_crn`. (:issue:`1025`)
* Fix low sun angle tracker rotation calculation. (:issue:`824`)
* Fix issue with big-endian and little-endian data in ``forecast.py``.
(:issue:`921`)

Testing
~~~~~~~
Expand Down Expand Up @@ -182,3 +192,8 @@ Contributors
* Joshua S. Stein (:ghuser:`jsstein`)
* Marc A. Anoma (:ghuser:`anomam`)
* Will Holmgren (:ghuser:`wholmgren`)
* Brock Taute (:ghuser:`btaute`)
* Cameron Stark (:ghuser:`CameronTStark`)
* :ghuser:`kahemker`
* Miguel Sánchez de León Peque (:ghuser:`Peque`)
* Stephen Lightfoote (:ghuser:`srlightfoote`)
19 changes: 8 additions & 11 deletions pvlib/ivtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,17 @@ def rectify_iv_curve(voltage, current, decimals=None):
voltage : numeric [V]
current : numeric [A]
Raises
------
ValueError if voltage and current are different length
Notes
-----
``rectify_IV_curve`` ensures that the IV curve lies in the first quadrant
``rectify_iv_curve`` ensures that the IV curve lies in the first quadrant
of the (voltage, current) plane. The returned IV curve:
* increases in voltage
* contains no negative current or voltage values
* contains no NaNs
* contains no points with duplicate voltage values. Where voltage
values are repeated, a single data point is substituted with current
equal to the average of current at duplicated voltages.
* increases in voltage
* contains no negative current or voltage values
* contains no NaNs
* contains no points with duplicate voltage values. Where voltage
values are repeated, a single data point is substituted with current
equal to the average of current at duplicated voltages.
"""

df = pd.DataFrame(data=np.vstack((voltage, current)).T, columns=['v', 'i'])
Expand Down
4 changes: 4 additions & 0 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ def dc_model(self, model):
self._dc_model = partial(model, self)

def infer_dc_model(self):
"""Infer DC power model from system attributes."""
params = set(self.system.module_parameters.keys())
if {'A0', 'A1', 'C7'} <= params:
return self.sapm, 'sapm'
Expand Down Expand Up @@ -705,6 +706,7 @@ def ac_model(self, model):
self._ac_model = partial(model, self)

def infer_ac_model(self):
"""Infer AC power model from system attributes."""
inverter_params = set(self.system.inverter_parameters.keys())
if {'C0', 'C1', 'C2'} <= inverter_params:
return self.snlinverter
Expand Down Expand Up @@ -816,6 +818,7 @@ def spectral_model(self, model):
self._spectral_model = partial(model, self)

def infer_spectral_model(self):
"""Infer spectral model from system attributes."""
params = set(self.system.module_parameters.keys())
if {'A4', 'A3', 'A2', 'A1', 'A0'} <= params:
return self.sapm_spectral_loss
Expand Down Expand Up @@ -877,6 +880,7 @@ def temperature_model(self, model):
self._temperature_model = partial(model, self)

def infer_temperature_model(self):
"""Infer temperature model from system attributes."""
params = set(self.system.temperature_model_parameters.keys())
# remove or statement in v0.9
if {'a', 'b', 'deltaT'} <= params or (
Expand Down

0 comments on commit 72f3783

Please sign in to comment.