Skip to content

Commit 6606af7

Browse files
authored
Remove v0.9.0 deprecations (#1771)
* remove SingleAxisTracker * remove pvsyst_cell's `eta_m` * Remove deprecated PVSystem inverter and temperature methods * remove deprecated PVSystem attribute passthrough * remove overlooked eta_m test * remove deprecated ModelChain attribute passthrough * whatsnew * scrub sphinx docs
1 parent 9d8ca55 commit 6606af7

14 files changed

+20
-1048
lines changed

docs/sphinx/source/reference/classes.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ the :ref:`pvsystemdoc` and :ref:`modelchaindoc` pages.
1919
pvsystem.Array
2020
pvsystem.FixedMount
2121
pvsystem.SingleAxisTrackerMount
22-
tracking.SingleAxisTracker
2322
modelchain.ModelChain
2423
modelchain.ModelChainResult

docs/sphinx/source/reference/irradiance/class-methods.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ Methods for irradiance calculations
99
pvsystem.PVSystem.get_irradiance
1010
pvsystem.PVSystem.get_aoi
1111
pvsystem.PVSystem.get_iam
12-
tracking.SingleAxisTracker.get_irradiance

docs/sphinx/source/reference/tracking.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
Tracking
44
========
55

6-
SingleAxisTracker
7-
-----------------
8-
9-
The :py:class:`~tracking.SingleAxisTracker` inherits from
10-
:py:class:`~pvsystem.PVSystem`.
11-
12-
.. autosummary::
13-
:toctree: generated/
14-
15-
tracking.SingleAxisTracker
16-
tracking.SingleAxisTracker.singleaxis
17-
tracking.SingleAxisTracker.get_irradiance
18-
196
Functions
207
---------
218

docs/sphinx/source/user_guide/comparison_pvlib_matlab.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Major differences
5454
* pvlib-python implements a handful of class designed to simplify the
5555
PV modeling process. These include :py:class:`~pvlib.location.Location`,
5656
:py:class:`~pvlib.pvsystem.PVSystem`,
57-
:py:class:`~pvlib.tracking.SingleAxisTracker`,
5857
and
5958
:py:class:`~pvlib.modelchain.ModelChain`.
6059

docs/sphinx/source/user_guide/pvsystem.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -323,16 +323,3 @@ methods that calculate system losses. At present, these methods include
323323
only :py:meth:`pvlib.pvsystem.PVSystem.pvwatts_losses` and
324324
:py:func:`pvlib.pvsystem.pvwatts_losses`, but we hope to add more related functions
325325
and methods in the future.
326-
327-
328-
.. _sat:
329-
330-
SingleAxisTracker
331-
-----------------
332-
333-
The :py:class:`~pvlib.tracking.SingleAxisTracker` is a subclass of
334-
:py:class:`~pvlib.pvsystem.PVSystem`. The SingleAxisTracker class
335-
includes a few more keyword arguments and attributes that are specific
336-
to trackers, plus the
337-
:py:meth:`~pvlib.tracking.SingleAxisTracker.singleaxis` method. It also
338-
overrides the `get_aoi` and `get_irradiance` methods.

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ Breaking Changes
1717
(:pull:`1768`)
1818
* For consistency with the rest of pvlib, the ``tilt`` parameter is renamed
1919
to ``surface_tilt`` in :py:func:`pvlib.soiling.hsu`. (:issue:`1717`, :pull:`1738`)
20+
* The following, originally deprecated in :ref:`whatsnew_0900`, is now removed: (:pull:`1770`)
21+
22+
- The :py:class:`pvlib.tracking.SingleAxisTracker` class
23+
- The various model-specific :py:class:`~pvlib.pvsystem.PVSystem` inverter
24+
and cell temperature methods
25+
- Attribute "pass-through" from :py:class:`~pvlib.modelchain.ModelChain`
26+
to :py:class:`~pvlib.modelchain.ModelChainResult`
27+
- Attribute "pass-through" from :py:class:`~pvlib.pvsystem.PVSystem`
28+
to :py:class:`~pvlib.pvsystem.Array`
29+
- The ``eta_m`` parameter in :py:func:`pvlib.temperature.pvsyst_cell`
30+
2031

2132
Deprecations
2233
~~~~~~~~~~~~

pvlib/modelchain.py

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
from typing import Union, Tuple, Optional, TypeVar
1515

1616
from pvlib import (atmosphere, clearsky, inverter, pvsystem, solarposition,
17-
temperature, tools)
18-
from pvlib.tracking import SingleAxisTracker
17+
temperature)
1918
import pvlib.irradiance # avoid name conflict with full import
2019
from pvlib.pvsystem import _DC_MODEL_PARAMS
2120
from pvlib._deprecation import pvlibDeprecationWarning
@@ -465,13 +464,6 @@ class ModelChain:
465464
Name of ModelChain instance.
466465
"""
467466

468-
# list of deprecated attributes
469-
_deprecated_attrs = ['solar_position', 'airmass', 'total_irrad',
470-
'aoi', 'aoi_modifier', 'spectral_modifier',
471-
'cell_temperature', 'effective_irradiance',
472-
'dc', 'ac', 'diode_params', 'tracking',
473-
'weather', 'times', 'losses']
474-
475467
def __init__(self, system, location,
476468
clearsky_model='ineichen',
477469
transposition_model='haydavies',
@@ -503,26 +495,6 @@ def __init__(self, system, location,
503495

504496
self.results = ModelChainResult()
505497

506-
def __getattr__(self, key):
507-
if key in ModelChain._deprecated_attrs:
508-
msg = f'ModelChain.{key} is deprecated and will' \
509-
f' be removed in v0.10. Use' \
510-
f' ModelChain.results.{key} instead'
511-
warnings.warn(msg, pvlibDeprecationWarning)
512-
return getattr(self.results, key)
513-
# __getattr__ is only called if __getattribute__ fails.
514-
# In that case we should check if key is a deprecated attribute,
515-
# and fail with an AttributeError if it is not.
516-
raise AttributeError
517-
518-
def __setattr__(self, key, value):
519-
if key in ModelChain._deprecated_attrs:
520-
msg = f'ModelChain.{key} is deprecated from v0.9. Use' \
521-
f' ModelChain.results.{key} instead'
522-
warnings.warn(msg, pvlibDeprecationWarning)
523-
setattr(self.results, key, value)
524-
else:
525-
super().__setattr__(key, value)
526498

527499
@classmethod
528500
def with_pvwatts(cls, system, location,
@@ -1535,27 +1507,11 @@ def prepare_inputs(self, weather):
15351507
self._prep_inputs_solar_pos(weather)
15361508
self._prep_inputs_airmass()
15371509
self._prep_inputs_albedo(weather)
1510+
self._prep_inputs_fixed()
15381511

1539-
# PVSystem.get_irradiance and SingleAxisTracker.get_irradiance
1540-
# and PVSystem.get_aoi and SingleAxisTracker.get_aoi
1541-
# have different method signatures. Use partial to handle
1542-
# the differences.
1543-
if isinstance(self.system, SingleAxisTracker):
1544-
self._prep_inputs_tracking()
1545-
get_irradiance = partial(
1546-
self.system.get_irradiance,
1547-
self.results.tracking['surface_tilt'],
1548-
self.results.tracking['surface_azimuth'],
1549-
self.results.solar_position['apparent_zenith'],
1550-
self.results.solar_position['azimuth'])
1551-
else:
1552-
self._prep_inputs_fixed()
1553-
get_irradiance = partial(
1554-
self.system.get_irradiance,
1555-
self.results.solar_position['apparent_zenith'],
1556-
self.results.solar_position['azimuth'])
1557-
1558-
self.results.total_irrad = get_irradiance(
1512+
self.results.total_irrad = self.system.get_irradiance(
1513+
self.results.solar_position['apparent_zenith'],
1514+
self.results.solar_position['azimuth'],
15591515
_tuple_from_dfs(self.results.weather, 'dni'),
15601516
_tuple_from_dfs(self.results.weather, 'ghi'),
15611517
_tuple_from_dfs(self.results.weather, 'dhi'),
@@ -1636,10 +1592,7 @@ def prepare_inputs_from_poa(self, data):
16361592
self._prep_inputs_solar_pos(data)
16371593
self._prep_inputs_airmass()
16381594

1639-
if isinstance(self.system, SingleAxisTracker):
1640-
self._prep_inputs_tracking()
1641-
else:
1642-
self._prep_inputs_fixed()
1595+
self._prep_inputs_fixed()
16431596

16441597
return self
16451598

0 commit comments

Comments
 (0)