Skip to content

Commit a873462

Browse files
authored
remove functions marked for 0.7 removal (#772)
* remove functions marked for 0.7 removal * extra line
1 parent c9dc7fe commit a873462

File tree

10 files changed

+14
-160
lines changed

10 files changed

+14
-160
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ Testing
3737
* Added 30 minutes to timestamps in `test_psm3.csv` to match change in NSRDB (:issue:`733`)
3838
* Added tests for methods in bifacial.py.
3939

40+
Removal of prior version deprecations
41+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42+
* Removed `irradiance.extraradiation`.
43+
* Removed `irradiance.grounddiffuse`.
44+
* Removed `irradiance.total_irrad`.
45+
* Removed `irradiance.globalinplane`.
46+
* Removed `atmosphere.relativeairmass`.
47+
* Removed `atmosphere.relativeairmass`.
48+
* Removed `solarposition.get_sun_rise_set_transit`.
49+
* Removed `tmy` module.
4050

4151
Contributors
4252
~~~~~~~~~~~~

pvlib/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@
1212
from pvlib import spa
1313
from pvlib import modelchain
1414
from pvlib import singlediode
15-
16-
# for backwards compatibility for pvlib.tmy module
17-
from pvlib import tmy

pvlib/atmosphere.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import numpy as np
99
import pandas as pd
1010

11-
from pvlib._deprecation import deprecated
1211

1312
APPARENT_ZENITH_MODELS = ('simple', 'kasten1966', 'kastenyoung1989',
1413
'gueymard1993', 'pickering2002')
@@ -135,11 +134,6 @@ def get_absolute_airmass(airmass_relative, pressure=101325.):
135134
return airmass_absolute
136135

137136

138-
absoluteairmass = deprecated('0.6', alternative='get_absolute_airmass',
139-
name='absoluteairmass', removal='0.7')(
140-
get_absolute_airmass)
141-
142-
143137
def get_relative_airmass(zenith, model='kastenyoung1989'):
144138
'''
145139
Gives the relative (not pressure-corrected) airmass.
@@ -246,11 +240,6 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
246240
return am
247241

248242

249-
relativeairmass = deprecated('0.6', alternative='get_relative_airmass',
250-
name='relativeairmass', removal='0.7')(
251-
get_relative_airmass)
252-
253-
254243
def gueymard94_pw(temp_air, relative_humidity):
255244
r"""
256245
Calculates precipitable water (cm) from ambient air temperature (C)

pvlib/irradiance.py

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import pandas as pd
1313

1414
from pvlib import atmosphere, solarposition, tools
15-
from pvlib._deprecation import deprecated
1615

1716
# see References section of grounddiffuse function
1817
SURFACE_ALBEDOS = {'urban': 0.18,
@@ -114,11 +113,6 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1,
114113
return Ea
115114

116115

117-
extraradiation = deprecated('0.6', alternative='get_extra_radiation',
118-
name='extraradiation', removal='0.7')(
119-
get_extra_radiation)
120-
121-
122116
def _handle_extra_radiation_types(datetime_or_doy, epoch_year):
123117
# This block will set the functions that can be used to convert the
124118
# inputs to either day of year or pandas DatetimeIndex, and the
@@ -372,11 +366,6 @@ def get_total_irradiance(surface_tilt, surface_azimuth,
372366
return irrads
373367

374368

375-
total_irrad = deprecated('0.6', alternative='get_total_irradiance',
376-
name='total_irrad', removal='0.7')(
377-
get_total_irradiance)
378-
379-
380369
def get_sky_diffuse(surface_tilt, surface_azimuth,
381370
solar_zenith, solar_azimuth,
382371
dni, ghi, dhi, dni_extra=None, airmass=None,
@@ -508,65 +497,6 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
508497
return irrads
509498

510499

511-
# globalinplane returns less data than poa_components, so better
512-
# to copy it
513-
@deprecated('0.6', alternative='poa_components', removal='0.7')
514-
def globalinplane(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
515-
r'''
516-
Determine the three components on in-plane irradiance
517-
518-
Combines in-plane irradaince compoents from the chosen diffuse
519-
translation, ground reflection and beam irradiance algorithms into
520-
the total in-plane irradiance.
521-
522-
Parameters
523-
----------
524-
aoi : numeric
525-
Angle of incidence of solar rays with respect to the module
526-
surface, from :func:`aoi`.
527-
528-
dni : numeric
529-
Direct normal irradiance (W/m^2), as measured from a TMY file or
530-
calculated with a clearsky model.
531-
532-
poa_sky_diffuse : numeric
533-
Diffuse irradiance (W/m^2) in the plane of the modules, as
534-
calculated by a diffuse irradiance translation function
535-
536-
poa_ground_diffuse : numeric
537-
Ground reflected irradiance (W/m^2) in the plane of the modules,
538-
as calculated by an albedo model (eg. :func:`grounddiffuse`)
539-
540-
Returns
541-
-------
542-
irrads : OrderedDict or DataFrame
543-
Contains the following keys:
544-
545-
* ``poa_global`` : Total in-plane irradiance (W/m^2)
546-
* ``poa_direct`` : Total in-plane beam irradiance (W/m^2)
547-
* ``poa_diffuse`` : Total in-plane diffuse irradiance (W/m^2)
548-
549-
Notes
550-
------
551-
Negative beam irradiation due to aoi :math:`> 90^{\circ}` or AOI
552-
:math:`< 0^{\circ}` is set to zero.
553-
'''
554-
555-
poa_direct = np.maximum(dni * np.cos(np.radians(aoi)), 0)
556-
poa_global = poa_direct + poa_sky_diffuse + poa_ground_diffuse
557-
poa_diffuse = poa_sky_diffuse + poa_ground_diffuse
558-
559-
irrads = OrderedDict()
560-
irrads['poa_global'] = poa_global
561-
irrads['poa_direct'] = poa_direct
562-
irrads['poa_diffuse'] = poa_diffuse
563-
564-
if isinstance(poa_direct, pd.Series):
565-
irrads = pd.DataFrame(irrads)
566-
567-
return irrads
568-
569-
570500
def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
571501
'''
572502
Estimate diffuse irradiance from ground reflections given
@@ -632,11 +562,6 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
632562
return diffuse_irrad
633563

634564

635-
grounddiffuse = deprecated('0.6', alternative='get_ground_diffuse',
636-
name='grounddiffuse', removal='0.7')(
637-
get_ground_diffuse)
638-
639-
640565
def isotropic(surface_tilt, dhi):
641566
r'''
642567
Determine diffuse irradiance from the sky on a tilted surface using

pvlib/solarposition.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,6 @@ def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy',
443443
'transit': transit})
444444

445445

446-
get_sun_rise_set_transit = deprecated('0.6.1',
447-
alternative='sun_rise_set_transit_spa',
448-
name='get_sun_rise_set_transit',
449-
removal='0.7')(sun_rise_set_transit_spa)
450-
451-
452446
def _ephem_convert_to_seconds_and_microseconds(date):
453447
# utility from unreleased PyEphem 3.6.7.1
454448
"""Converts a PyEphem date into seconds"""

pvlib/test/test_atmosphere.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import pytest
99

1010
from pvlib import atmosphere
11-
from pvlib._deprecation import pvlibDeprecationWarning
12-
13-
from conftest import fail_on_pvlib_version
1411

1512

1613
def test_pres2alt():
@@ -74,14 +71,6 @@ def test_get_absolute_airmass():
7471
assert_allclose(out, expected, equal_nan=True, atol=0.001)
7572

7673

77-
@fail_on_pvlib_version('0.7')
78-
def test_deprecated_07():
79-
with pytest.warns(pvlibDeprecationWarning):
80-
atmosphere.relativeairmass(2)
81-
with pytest.warns(pvlibDeprecationWarning):
82-
atmosphere.absoluteairmass(2)
83-
84-
8574
def test_gueymard94_pw():
8675
temp_air = np.array([0, 20, 40])
8776
relative_humidity = np.array([0, 30, 100])

pvlib/test/test_irradiance.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
from pandas.util.testing import assert_frame_equal, assert_series_equal
1313

1414
from pvlib import irradiance
15-
from pvlib._deprecation import pvlibDeprecationWarning
1615

17-
from conftest import (fail_on_pvlib_version, needs_numpy_1_10, pandas_0_22,
16+
from conftest import (needs_numpy_1_10, pandas_0_22,
1817
requires_ephem, requires_numba)
1918

2019

@@ -68,18 +67,6 @@ def relative_airmass(times):
6867
return pd.Series([np.nan, 7.58831596, 1.01688136, 3.27930443], times)
6968

7069

71-
@fail_on_pvlib_version('0.7')
72-
def test_deprecated_07():
73-
with pytest.warns(pvlibDeprecationWarning):
74-
irradiance.extraradiation(300)
75-
with pytest.warns(pvlibDeprecationWarning):
76-
irradiance.grounddiffuse(40, 900)
77-
with pytest.warns(pvlibDeprecationWarning):
78-
irradiance.total_irrad(32, 180, 10, 180, 0, 0, 0, 1400, 1)
79-
with pytest.warns(pvlibDeprecationWarning):
80-
irradiance.globalinplane(0, 1000, 100, 10)
81-
82-
8370
# setup for et rad test. put it here for readability
8471
timestamp = pd.Timestamp('20161026')
8572
dt_index = pd.DatetimeIndex([timestamp])

pvlib/test/test_solarposition.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
from numpy.testing import assert_allclose
1010
import pytest
1111

12-
from pvlib._deprecation import pvlibDeprecationWarning
1312
from pvlib.location import Location
1413
from pvlib import solarposition, spa
1514

16-
from conftest import (fail_on_pvlib_version, requires_ephem, needs_pandas_0_17,
15+
from conftest import (requires_ephem, needs_pandas_0_17,
1716
requires_spa_c, requires_numba)
1817

1918

@@ -111,15 +110,6 @@ def expected_rise_set_ephem():
111110
index=times)
112111

113112

114-
@fail_on_pvlib_version('0.7')
115-
def test_deprecated_07():
116-
tt = pd.DatetimeIndex(['2015-01-01 00:00:00']).tz_localize('MST')
117-
with pytest.warns(pvlibDeprecationWarning):
118-
solarposition.get_sun_rise_set_transit(tt,
119-
39.7,
120-
-105.2)
121-
122-
123113
# the physical tests are run at the same time as the NREL SPA test.
124114
# pyephem reproduces the NREL result to 2 decimal places.
125115
# this doesn't mean that one code is better than the other.

pvlib/test/test_tmy.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,15 @@
22
import os
33

44
from pandas.util.testing import network
5-
import pytest
65

7-
from pvlib._deprecation import pvlibDeprecationWarning
86
from pvlib.iotools import tmy
97

10-
from conftest import fail_on_pvlib_version
11-
12-
13-
test_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
8+
test_dir = os.path.dirname(
9+
os.path.abspath(inspect.getfile(inspect.currentframe())))
1410
tmy3_testfile = os.path.join(test_dir, '../data/703165TY.csv')
1511
tmy2_testfile = os.path.join(test_dir, '../data/12839.tm2')
1612

1713

18-
@fail_on_pvlib_version('0.7')
19-
def test_deprecated_07():
20-
with pytest.warns(pvlibDeprecationWarning):
21-
from pvlib.tmy import readtmy2
22-
readtmy2(tmy2_testfile)
23-
with pytest.warns(pvlibDeprecationWarning):
24-
from pvlib.tmy import readtmy3
25-
readtmy3(tmy3_testfile)
26-
27-
2814
def test_read_tmy3():
2915
tmy.read_tmy3(tmy3_testfile)
3016

pvlib/tmy.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)