Skip to content
Open
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
3 changes: 0 additions & 3 deletions docs/sphinx/source/reference/iotools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ clear-sky irradiance globally.

iotools.get_cams
iotools.read_cams
iotools.parse_cams


NASA POWER
Expand Down Expand Up @@ -152,7 +151,6 @@ long-wave radiation.

iotools.get_bsrn
iotools.read_bsrn
iotools.parse_bsrn


SOLRAD
Expand Down Expand Up @@ -269,7 +267,6 @@ Functions for reading irradiance/weather data files.
iotools.read_tmy2
iotools.read_tmy3
iotools.read_epw
iotools.parse_epw
iotools.read_panond


Expand Down
9 changes: 0 additions & 9 deletions docs/sphinx/source/reference/modelchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,3 @@ on the information in the associated :py:class:`~pvsystem.PVSystem` object.
modelchain.ModelChain.infer_temperature_model
modelchain.ModelChain.infer_losses_model

Functions
---------

Functions for power modeling.

.. autosummary::
:toctree: generated/

modelchain.get_orientation
16 changes: 15 additions & 1 deletion docs/sphinx/source/whatsnew/v0.16.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@ Breaking Changes
* Remove empty ``poa_horizon`` key from the ``diffuse_components`` output of
:py:func:`pvlib.irradiance.haydavies`.
(:pull:`2788`)

* Removed private function :py:func:`pvlib.irradiance._liujordan`.
(:issue:`2764`, :pull:`2766`)
* Removed deprecated iotools aliases :py:func:`pvlib.iotools.parse_bsrn`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Removed deprecated iotools aliases :py:func:`pvlib.iotools.parse_bsrn`,
* Removed deprecated iotools functions :py:func:`pvlib.iotools.parse_bsrn`,

:py:func:`pvlib.iotools.parse_epw`, and
:py:func:`pvlib.iotools.parse_cams`. Use
:py:func:`pvlib.iotools.read_bsrn`, :py:func:`pvlib.iotools.read_epw`,
and :py:func:`pvlib.iotools.read_cams` instead.
(:issue:`2767`, :pull:`2766`)
* Removed deprecated modelchain function
:py:func:`pvlib.modelchain.get_orientation`.
(:issue:`2767`, :pull:`2766`)
* Removed the deprecated ``server`` keyword argument from
:py:func:`pvlib.iotools.sodapro.get_cams`. Use ``url`` instead.
(:issue:`2767`, :pull:`2766`)

Deprecations
~~~~~~~~~~~~
Expand Down Expand Up @@ -83,3 +96,4 @@ Contributors
* Andrew Chen (:ghuser:`chuenchen309`)
* Sai Asish Y (:ghuser:`SAY-5`)
* Kevin Anderson (:ghuser:`kandersolar`)
* Johann Loux (:ghuser:`JoLo90`)
4 changes: 1 addition & 3 deletions pvlib/iotools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pvlib.iotools.tmy import read_tmy2, read_tmy3 # noqa: F401
from pvlib.iotools.epw import read_epw, parse_epw # noqa: F401
from pvlib.iotools.epw import read_epw # noqa: F401
from pvlib.iotools.srml import read_srml # noqa: F401
from pvlib.iotools.srml import get_srml # noqa: F401
from pvlib.iotools.surfrad import read_surfrad # noqa: F401
Expand All @@ -22,10 +22,8 @@
from pvlib.iotools.pvgis import get_pvgis_horizon # noqa: F401
from pvlib.iotools.bsrn import get_bsrn # noqa: F401
from pvlib.iotools.bsrn import read_bsrn # noqa: F401
from pvlib.iotools.bsrn import parse_bsrn # noqa: F401
from pvlib.iotools.sodapro import get_cams # noqa: F401
from pvlib.iotools.sodapro import read_cams # noqa: F401
from pvlib.iotools.sodapro import parse_cams # noqa: F401
from pvlib.iotools.panond import read_panond # noqa: F401
from pvlib.iotools.acis import get_acis_prism # noqa: F401
from pvlib.iotools.acis import get_acis_nrcc # noqa: F401
Expand Down
5 changes: 0 additions & 5 deletions pvlib/iotools/bsrn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import os

from pvlib.tools import _file_context_manager
from pvlib._deprecation import deprecated

BSRN_FTP_URL = "ftp.bsrn.awi.de"

Expand Down Expand Up @@ -462,7 +461,3 @@ def read_bsrn(filename, logical_records=('0100',)):
with open_func(filename, mode) as f:
content = _parse_bsrn(f, logical_records)
return content


parse_bsrn = deprecated(since="0.13.0", name="parse_bsrn",
alternative="read_bsrn")(read_bsrn)
5 changes: 0 additions & 5 deletions pvlib/iotools/epw.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import pandas as pd

from pvlib.tools import _file_context_manager
from pvlib._deprecation import deprecated


def read_epw(filename, coerce_year=None):
Expand Down Expand Up @@ -309,7 +308,3 @@ def _parse_epw(csvdata, coerce_year=None):
data.index = idx

return data, meta


parse_epw = deprecated(since="0.13.0", name="parse_epw",
alternative="read_epw")(read_epw)
11 changes: 0 additions & 11 deletions pvlib/iotools/sodapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import warnings
from pvlib import tools

from pvlib._deprecation import deprecated, renamed_kwarg_warning

URL = 'api.soda-solardata.com'

CAMS_INTEGRATED_COLUMNS = [
Expand Down Expand Up @@ -45,11 +43,6 @@
'0 year 1 month 0 day 0 h 0 min 0 s': '1M'}


@renamed_kwarg_warning(
since='0.13.0',
old_param_name='server',
new_param_name='url',
removal="0.14.0")
def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
altitude=None, time_step='1h', time_ref='UT', verbose=False,
integrated=False, label=None, map_variables=True,
Expand Down Expand Up @@ -357,7 +350,3 @@ def read_cams(filename, integrated=False, label=None, map_variables=True):
data = data.rename(columns=VARIABLE_MAP)

return data, metadata


parse_cams = deprecated(since="0.13.0", name="parse_cams",
alternative="read_cams")(read_cams)
58 changes: 0 additions & 58 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3234,64 +3234,6 @@ def campbell_norman(zenith, transmittance, pressure=101325.0,
return irrads


def _liujordan(zenith, transmittance, airmass, dni_extra=1367.0):
'''
Determine DNI, DHI, GHI from extraterrestrial flux, transmittance,
and optical air mass number.

Liu and Jordan, 1960, developed a simplified direct radiation model.
DHI is from an empirical equation for diffuse radiation from Liu and
Jordan, 1960.

Parameters
----------
zenith: pd.Series
True (not refraction-corrected) zenith angles in decimal
degrees. If Z is a vector it must be of the same size as all
other vector inputs. [°]

transmittance: float
Atmospheric transmittance between 0 and 1.

airmass: numeric
Optical air mass. [unitless]

dni_extra: float, default 1367.0
Direct irradiance incident at the top of the atmosphere.

Returns
-------
irradiance: DataFrame
Modeled direct normal irradiance, direct horizontal irradiance,
and global horizontal irradiance in Wm⁻²

References
----------
.. [1] Campbell, G. S., J. M. Norman (1998) An Introduction to
Environmental Biophysics. 2nd Ed. New York: Springer.

.. [2] Liu, B. Y., R. C. Jordan, (1960). "The interrelationship and
characteristic distribution of direct, diffuse, and total solar
radiation". Solar Energy 4:1-19
'''

tau = transmittance

dni = dni_extra*tau**airmass
dhi = 0.3 * (1.0 - tau**airmass) * dni_extra * np.cos(np.radians(zenith))
ghi = dhi + dni * np.cos(np.radians(zenith))

irrads = OrderedDict()
irrads['ghi'] = ghi
irrads['dni'] = dni
irrads['dhi'] = dhi

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

return irrads


def _get_perez_coefficients(perezmodel):
'''
Find coefficients for the Perez model
Expand Down
39 changes: 0 additions & 39 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from pvlib.pvsystem import _DC_MODEL_PARAMS
from pvlib.tools import _build_kwargs

from pvlib._deprecation import deprecated

# keys that are used to detect input data and assign data to appropriate
# ModelChain attribute
# for ModelChain.weather
Expand Down Expand Up @@ -61,43 +59,6 @@
)


@deprecated(
since="0.13.1",
removal="",
name="pvlib.modelchain.get_orientation",
alternative=None,
addendum=None,
)
def get_orientation(strategy, **kwargs):
"""
Determine a PV system's surface tilt and surface azimuth
using a named strategy.

Parameters
----------
strategy: str
The orientation strategy.
Allowed strategies include 'flat', 'south_at_latitude_tilt'.
**kwargs:
Strategy-dependent keyword arguments. See code for details.

Returns
-------
surface_tilt, surface_azimuth
"""
if strategy == 'south_at_latitude_tilt':
surface_azimuth = 180
surface_tilt = kwargs['latitude']
elif strategy == 'flat':
surface_azimuth = 180
surface_tilt = 0
else:
raise ValueError('invalid orientation strategy. strategy must '
'be one of south_at_latitude_tilt, flat,')

return surface_tilt, surface_azimuth


def _getmcattr(self, attr):
"""
Helper for __repr__ methods, needed to avoid recursion in property
Expand Down
2 changes: 1 addition & 1 deletion pvlib/tracking.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import pandas as pd

from pvlib.tools import cosd, sind, tand, acosd, asind
from pvlib.tools import cosd, sind, tand, acosd
from pvlib import irradiance
from pvlib import shading
from pvlib._deprecation import renamed_kwarg_warning
Expand Down
10 changes: 1 addition & 9 deletions tests/iotools/test_bsrn.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
import os
import tempfile
from pvlib.iotools import read_bsrn, get_bsrn, parse_bsrn
from pvlib.iotools import read_bsrn, get_bsrn
from tests.conftest import (
TESTS_DATA_DIR,
RERUNS,
Expand All @@ -15,8 +15,6 @@
requires_bsrn_credentials,
)

from pvlib._deprecation import pvlibDeprecationWarning


@pytest.fixture(scope="module")
def bsrn_credentials():
Expand All @@ -35,12 +33,6 @@ def expected_index():
tz='UTC')


def test_parse_bsrn_deprecated():
with pytest.warns(pvlibDeprecationWarning, match='Use read_bsrn instead'):
with open(TESTS_DATA_DIR / 'bsrn-lr0100-pay0616.dat') as fbuf:
data, metadata = parse_bsrn(fbuf)


@pytest.mark.parametrize('testfile', [
('bsrn-pay0616.dat.gz'),
('bsrn-lr0100-pay0616.dat'),
Expand Down
11 changes: 0 additions & 11 deletions tests/iotools/test_epw.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from pvlib.iotools import epw
from tests.conftest import TESTS_DATA_DIR, RERUNS, RERUNS_DELAY

from pvlib._deprecation import pvlibDeprecationWarning

epw_testfile = TESTS_DATA_DIR / 'NLD_Amsterdam062400_IWEC.epw'


Expand All @@ -23,15 +21,6 @@ def test_read_epw_buffer():
assert meta['latitude'] == 52.3


def test_parse_epw_deprecated():
with pytest.warns(pvlibDeprecationWarning, match='Use read_epw instead'):
with open(epw_testfile, 'r') as f:
df, meta = epw.parse_epw(f)
assert len(df) == 8760
assert 'ghi' in df.columns
assert meta['latitude'] == 52.3


@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_read_epw_remote():
Expand Down
6 changes: 0 additions & 6 deletions tests/iotools/test_sodapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,6 @@ def test_read_cams_integrated_unmapped_label():
assert_frame_equal(out, expected, check_less_precise=True)


def test_parse_cams_deprecated():
with pytest.warns(pvlibDeprecationWarning, match='Use read_cams instead'):
with open(testfile_radiation_verbose, mode="r") as fbuf:
_ = sodapro.parse_cams(fbuf)


def test_read_cams_metadata():
_, metadata = sodapro.read_cams(testfile_mcclear_monthly, integrated=False)
assert metadata['Time reference'] == 'Universal time (UT)'
Expand Down
3 changes: 2 additions & 1 deletion tests/test_clearsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,5 +892,6 @@ def test_bird():
# XXX: testdata starts at 1am so noon is at index = 11
np.allclose(
[Eb3, Ebh3, Gh3, Dh3],
testdata2[['Direct Beam', 'Direct Hz', 'Global Hz', 'Dif Hz']].iloc[11],
testdata2[['Direct Beam', 'Direct Hz',
'Global Hz', 'Dif Hz']].iloc[11],
rtol=1e-3)
9 changes: 1 addition & 8 deletions tests/test_modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
from pvlib.pvsystem import PVSystem
from pvlib.location import Location

from pvlib._deprecation import pvlibDeprecationWarning

from .conftest import assert_series_equal, assert_frame_equal

import pytest


Expand Down Expand Up @@ -1821,12 +1820,6 @@ def test_invalid_models(model, sapm_dc_snl_ac_system, location):
ModelChain(sapm_dc_snl_ac_system, location, **kwargs)


def test_bad_get_orientation():
with pytest.warns(pvlibDeprecationWarning, match='will be removed soon'):
with pytest.raises(ValueError):
modelchain.get_orientation('bad value')


# tests for PVSystem with multiple Arrays
def test_with_sapm_pvsystem_arrays(sapm_dc_snl_ac_system_Array, location,
weather):
Expand Down
Loading