Skip to content

Commit 13d918b

Browse files
committed
change airmass function names
1 parent 1c85250 commit 13d918b

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

docs/sphinx/source/api.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ Airmass and atmospheric models
102102
:toctree: generated/
103103

104104
location.Location.get_airmass
105-
atmosphere.absoluteairmass
106-
atmosphere.relativeairmass
105+
atmosphere.absolute_airmass
106+
atmosphere.get_relative_airmass
107107
atmosphere.pres2alt
108108
atmosphere.alt2pres
109109
atmosphere.gueymard94_pw

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

+21-7
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,35 @@ v0.5.2 (__, 2017)
55

66
API Changes
77
~~~~~~~~~~~
8-
* removed unused 'pressure' arg from irradiance.liujordan function (:issue:`386`)
8+
* pvlib python is changing a handful of function names. In general, functions
9+
that can calculate a quantity using multiple algorithms now start
10+
with the prefix ``get_``. For example, ``relativeairmass`` can calculate
11+
airmass using one of many ``model`` arguments. Its name has been changed
12+
to ``get_relative_airmass``. The old function names remain in this
13+
release, but will emit a ``PVLibDeprecationWarning`` when called. The
14+
old functions will be removed in the 0.6 release. Functions composed
15+
of multiple words jammed together have been renamed with underscores
16+
separating the words (see above).
17+
Each change is detailed below. (:issue:`427`)
18+
* Deprecated relativeairmass. relativeairmass will be removed in 0.6.
19+
Use the new get_relative_airmass instead. (:issue:`427`)
20+
* Deprecated absoluteairmass. absoluteairmass will be removed in 0.6.
21+
Use the new absolute_airmass instead. (:issue:`427`)
922
* Deprecated irradiance.globalinplane. globalinplane will be removed in 0.6.
10-
Use the new irradiance.poa_components instead. (:issue:`422`)
23+
Use the new irradiance.poa_components instead. (:issue:`427`)
1124
* Added irradiance.poa_components. Function is the same as the now-deprecated
1225
irradiance.globalinplane, but adds 'poa_sky_diffuse' and
13-
'poa_ground_diffuse' to the output. (:issue:`422`)
26+
'poa_ground_diffuse' to the output. (:issue:`427`)
1427
* Deprecated irradiance.extraradiation. Use irradiance.get_extra_radiation
15-
instead. irradiance.extraradiation will be removed in 0.6. (:issue:`422`)
28+
instead. irradiance.extraradiation will be removed in 0.6. (:issue:`427`)
1629
* Deprecated irradiance.grounddiffuse. Use irradiance.get_ground_diffuse
17-
instead. irradiance.grounddiffuse will be removed in 0.6. (:issue:`422`)
18-
* Added irradiance.get_poa_sky_diffuse. (:issue:`422`)
30+
instead. irradiance.grounddiffuse will be removed in 0.6. (:issue:`427`)
31+
* Added irradiance.get_poa_sky_diffuse. (:issue:`427`)
1932
* Deprecated irradiance.total_irrad. Use irradiance.get_total_poa_irradiance
20-
instead. irradiance.total_irrad will be removed in 0.6. (:issue:`422`)
33+
instead. irradiance.total_irrad will be removed in 0.6. (:issue:`427`)
2134
* Removed 'klutcher' from get_sky_diffuse/total_irrad. This misspelling was
2235
deprecated long ago but never removed.
36+
* removed unused 'pressure' arg from irradiance.liujordan function (:issue:`386`)
2337

2438

2539
Enhancements

pvlib/atmosphere.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import pandas as pd
1010
from warnings import warn
1111

12+
from pvlib._deprecation import deprecated
13+
1214
APPARENT_ZENITH_MODELS = ('simple', 'kasten1966', 'kastenyoung1989',
1315
'gueymard1993', 'pickering2002')
1416
TRUE_ZENITH_MODELS = ('youngirvine1967', 'young1994')
@@ -95,7 +97,7 @@ def alt2pres(altitude):
9597
return press
9698

9799

98-
def absoluteairmass(airmass_relative, pressure=101325.):
100+
def absolute_airmass(airmass_relative, pressure=101325.):
99101
'''
100102
Determine absolute (pressure corrected) airmass from relative
101103
airmass and pressure
@@ -134,7 +136,11 @@ def absoluteairmass(airmass_relative, pressure=101325.):
134136
return airmass_absolute
135137

136138

137-
def relativeairmass(zenith, model='kastenyoung1989'):
139+
absoluteairmass = deprecated('0.5.2', alternative='absolute_airmass',
140+
name='absoluteairmass')(absolute_airmass)
141+
142+
143+
def get_relative_airmass(zenith, model='kastenyoung1989'):
138144
'''
139145
Gives the relative (not pressure-corrected) airmass.
140146
@@ -241,6 +247,10 @@ def relativeairmass(zenith, model='kastenyoung1989'):
241247
return am
242248

243249

250+
relativeairmass = deprecated('0.5.2', alternative='get_relative_airmass',
251+
name='relativeairmass')(get_relative_airmass)
252+
253+
244254
def gueymard94_pw(temp_air, relative_humidity):
245255
r"""
246256
Calculates precipitable water (cm) from ambient air temperature (C)

0 commit comments

Comments
 (0)