Skip to content

remove functions marked for 0.7 removal #772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/sphinx/source/whatsnew/v0.7.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ Testing
* Added 30 minutes to timestamps in `test_psm3.csv` to match change in NSRDB (:issue:`733`)
* Added tests for methods in bifacial.py.

Removal of prior version deprecations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Removed `irradiance.extraradiation`.
* Removed `irradiance.grounddiffuse`.
* Removed `irradiance.total_irrad`.
* Removed `irradiance.globalinplane`.
* Removed `atmosphere.relativeairmass`.
* Removed `atmosphere.relativeairmass`.
* Removed `solarposition.get_sun_rise_set_transit`.
* Removed `tmy` module.

Contributors
~~~~~~~~~~~~
Expand Down
3 changes: 0 additions & 3 deletions pvlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@
from pvlib import spa
from pvlib import modelchain
from pvlib import singlediode

# for backwards compatibility for pvlib.tmy module
from pvlib import tmy
11 changes: 0 additions & 11 deletions pvlib/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import numpy as np
import pandas as pd

from pvlib._deprecation import deprecated

APPARENT_ZENITH_MODELS = ('simple', 'kasten1966', 'kastenyoung1989',
'gueymard1993', 'pickering2002')
Expand Down Expand Up @@ -135,11 +134,6 @@ def get_absolute_airmass(airmass_relative, pressure=101325.):
return airmass_absolute


absoluteairmass = deprecated('0.6', alternative='get_absolute_airmass',
name='absoluteairmass', removal='0.7')(
get_absolute_airmass)


def get_relative_airmass(zenith, model='kastenyoung1989'):
'''
Gives the relative (not pressure-corrected) airmass.
Expand Down Expand Up @@ -246,11 +240,6 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
return am


relativeairmass = deprecated('0.6', alternative='get_relative_airmass',
name='relativeairmass', removal='0.7')(
get_relative_airmass)


def gueymard94_pw(temp_air, relative_humidity):
r"""
Calculates precipitable water (cm) from ambient air temperature (C)
Expand Down
75 changes: 0 additions & 75 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import pandas as pd

from pvlib import atmosphere, solarposition, tools
from pvlib._deprecation import deprecated

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


extraradiation = deprecated('0.6', alternative='get_extra_radiation',
name='extraradiation', removal='0.7')(
get_extra_radiation)


def _handle_extra_radiation_types(datetime_or_doy, epoch_year):
# This block will set the functions that can be used to convert the
# inputs to either day of year or pandas DatetimeIndex, and the
Expand Down Expand Up @@ -372,11 +366,6 @@ def get_total_irradiance(surface_tilt, surface_azimuth,
return irrads


total_irrad = deprecated('0.6', alternative='get_total_irradiance',
name='total_irrad', removal='0.7')(
get_total_irradiance)


def get_sky_diffuse(surface_tilt, surface_azimuth,
solar_zenith, solar_azimuth,
dni, ghi, dhi, dni_extra=None, airmass=None,
Expand Down Expand Up @@ -508,65 +497,6 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
return irrads


# globalinplane returns less data than poa_components, so better
# to copy it
@deprecated('0.6', alternative='poa_components', removal='0.7')
def globalinplane(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
r'''
Determine the three components on in-plane irradiance

Combines in-plane irradaince compoents from the chosen diffuse
translation, ground reflection and beam irradiance algorithms into
the total in-plane irradiance.

Parameters
----------
aoi : numeric
Angle of incidence of solar rays with respect to the module
surface, from :func:`aoi`.

dni : numeric
Direct normal irradiance (W/m^2), as measured from a TMY file or
calculated with a clearsky model.

poa_sky_diffuse : numeric
Diffuse irradiance (W/m^2) in the plane of the modules, as
calculated by a diffuse irradiance translation function

poa_ground_diffuse : numeric
Ground reflected irradiance (W/m^2) in the plane of the modules,
as calculated by an albedo model (eg. :func:`grounddiffuse`)

Returns
-------
irrads : OrderedDict or DataFrame
Contains the following keys:

* ``poa_global`` : Total in-plane irradiance (W/m^2)
* ``poa_direct`` : Total in-plane beam irradiance (W/m^2)
* ``poa_diffuse`` : Total in-plane diffuse irradiance (W/m^2)

Notes
------
Negative beam irradiation due to aoi :math:`> 90^{\circ}` or AOI
:math:`< 0^{\circ}` is set to zero.
'''

poa_direct = np.maximum(dni * np.cos(np.radians(aoi)), 0)
poa_global = poa_direct + poa_sky_diffuse + poa_ground_diffuse
poa_diffuse = poa_sky_diffuse + poa_ground_diffuse

irrads = OrderedDict()
irrads['poa_global'] = poa_global
irrads['poa_direct'] = poa_direct
irrads['poa_diffuse'] = poa_diffuse

if isinstance(poa_direct, pd.Series):
irrads = pd.DataFrame(irrads)

return irrads


def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
'''
Estimate diffuse irradiance from ground reflections given
Expand Down Expand Up @@ -632,11 +562,6 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
return diffuse_irrad


grounddiffuse = deprecated('0.6', alternative='get_ground_diffuse',
name='grounddiffuse', removal='0.7')(
get_ground_diffuse)


def isotropic(surface_tilt, dhi):
r'''
Determine diffuse irradiance from the sky on a tilted surface using
Expand Down
6 changes: 0 additions & 6 deletions pvlib/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,6 @@ def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy',
'transit': transit})


get_sun_rise_set_transit = deprecated('0.6.1',
alternative='sun_rise_set_transit_spa',
name='get_sun_rise_set_transit',
removal='0.7')(sun_rise_set_transit_spa)


def _ephem_convert_to_seconds_and_microseconds(date):
# utility from unreleased PyEphem 3.6.7.1
"""Converts a PyEphem date into seconds"""
Expand Down
11 changes: 0 additions & 11 deletions pvlib/test/test_atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import pytest

from pvlib import atmosphere
from pvlib._deprecation import pvlibDeprecationWarning

from conftest import fail_on_pvlib_version


def test_pres2alt():
Expand Down Expand Up @@ -74,14 +71,6 @@ def test_get_absolute_airmass():
assert_allclose(out, expected, equal_nan=True, atol=0.001)


@fail_on_pvlib_version('0.7')
def test_deprecated_07():
with pytest.warns(pvlibDeprecationWarning):
atmosphere.relativeairmass(2)
with pytest.warns(pvlibDeprecationWarning):
atmosphere.absoluteairmass(2)


def test_gueymard94_pw():
temp_air = np.array([0, 20, 40])
relative_humidity = np.array([0, 30, 100])
Expand Down
15 changes: 1 addition & 14 deletions pvlib/test/test_irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
from pandas.util.testing import assert_frame_equal, assert_series_equal

from pvlib import irradiance
from pvlib._deprecation import pvlibDeprecationWarning

from conftest import (fail_on_pvlib_version, needs_numpy_1_10, pandas_0_22,
from conftest import (needs_numpy_1_10, pandas_0_22,
requires_ephem, requires_numba)


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


@fail_on_pvlib_version('0.7')
def test_deprecated_07():
with pytest.warns(pvlibDeprecationWarning):
irradiance.extraradiation(300)
with pytest.warns(pvlibDeprecationWarning):
irradiance.grounddiffuse(40, 900)
with pytest.warns(pvlibDeprecationWarning):
irradiance.total_irrad(32, 180, 10, 180, 0, 0, 0, 1400, 1)
with pytest.warns(pvlibDeprecationWarning):
irradiance.globalinplane(0, 1000, 100, 10)


# setup for et rad test. put it here for readability
timestamp = pd.Timestamp('20161026')
dt_index = pd.DatetimeIndex([timestamp])
Expand Down
12 changes: 1 addition & 11 deletions pvlib/test/test_solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
from numpy.testing import assert_allclose
import pytest

from pvlib._deprecation import pvlibDeprecationWarning
from pvlib.location import Location
from pvlib import solarposition, spa

from conftest import (fail_on_pvlib_version, requires_ephem, needs_pandas_0_17,
from conftest import (requires_ephem, needs_pandas_0_17,
requires_spa_c, requires_numba)


Expand Down Expand Up @@ -111,15 +110,6 @@ def expected_rise_set_ephem():
index=times)


@fail_on_pvlib_version('0.7')
def test_deprecated_07():
tt = pd.DatetimeIndex(['2015-01-01 00:00:00']).tz_localize('MST')
with pytest.warns(pvlibDeprecationWarning):
solarposition.get_sun_rise_set_transit(tt,
39.7,
-105.2)


# the physical tests are run at the same time as the NREL SPA test.
# pyephem reproduces the NREL result to 2 decimal places.
# this doesn't mean that one code is better than the other.
Expand Down
18 changes: 2 additions & 16 deletions pvlib/test/test_tmy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,15 @@
import os

from pandas.util.testing import network
import pytest

from pvlib._deprecation import pvlibDeprecationWarning
from pvlib.iotools import tmy

from conftest import fail_on_pvlib_version


test_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
test_dir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe())))
tmy3_testfile = os.path.join(test_dir, '../data/703165TY.csv')
tmy2_testfile = os.path.join(test_dir, '../data/12839.tm2')


@fail_on_pvlib_version('0.7')
def test_deprecated_07():
with pytest.warns(pvlibDeprecationWarning):
from pvlib.tmy import readtmy2
readtmy2(tmy2_testfile)
with pytest.warns(pvlibDeprecationWarning):
from pvlib.tmy import readtmy3
readtmy3(tmy3_testfile)


def test_read_tmy3():
tmy.read_tmy3(tmy3_testfile)

Expand Down
13 changes: 0 additions & 13 deletions pvlib/tmy.py

This file was deleted.