Skip to content

Commit 884a153

Browse files
authored
Clarify delta_t docstring descriptions (#1429)
* clarify delta_t docstrings * whatsnew
1 parent c243183 commit 884a153

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Documentation
6262
:py:class:`pvlib.modelchain.ModelChain` or procedural functions.
6363
(:pull:`1394`)
6464
* Fix some typos (:pull:`1414`)
65+
* Clarify the descriptions of ``delta_t`` in several solar position functions
66+
(:pull:`1429`)
6567

6668
Requirements
6769
~~~~~~~~~~~~

pvlib/solarposition.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ def spa_python(time, latitude, longitude,
304304
temperature : int or float, optional, default 12
305305
avg. yearly air temperature in degrees C.
306306
delta_t : float, optional, default 67.0
307+
Difference between terrestrial time and UT1.
307308
If delta_t is None, uses spa.calculate_deltat
308309
using time.year and time.month from pandas.DatetimeIndex.
309-
For most simulations specifing delta_t is sufficient.
310-
Difference between terrestrial time and UT1.
310+
For most simulations the default delta_t is sufficient.
311311
*Note: delta_t = None will break code using nrel_numba,
312312
this will be fixed in a future version.*
313-
The USNO has historical and forecasted delta_t [3].
313+
The USNO has historical and forecasted delta_t [3]_.
314314
atmos_refrac : None or float, optional, default None
315315
The approximate atmospheric refraction (in degrees)
316316
at sunrise and sunset.
@@ -405,18 +405,17 @@ def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy',
405405
Latitude in degrees, positive north of equator, negative to south
406406
longitude : float
407407
Longitude in degrees, positive east of prime meridian, negative to west
408-
delta_t : float, optional
409-
If delta_t is None, uses spa.calculate_deltat
410-
using times.year and times.month from pandas.DatetimeIndex.
411-
For most simulations specifing delta_t is sufficient.
412-
Difference between terrestrial time and UT1.
413-
delta_t = None will break code using nrel_numba,
414-
this will be fixed in a future version.
415-
By default, use USNO historical data and predictions
416408
how : str, optional, default 'numpy'
417409
Options are 'numpy' or 'numba'. If numba >= 0.17.0
418410
is installed, how='numba' will compile the spa functions
419411
to machine code and run them multithreaded.
412+
delta_t : float, optional, default 67.0
413+
Difference between terrestrial time and UT1.
414+
If delta_t is None, uses spa.calculate_deltat
415+
using times.year and times.month from pandas.DatetimeIndex.
416+
For most simulations the default delta_t is sufficient.
417+
*Note: delta_t = None will break code using nrel_numba,
418+
this will be fixed in a future version.*
420419
numthreads : int, optional, default 4
421420
Number of threads to use if how == 'numba'.
422421
@@ -972,13 +971,12 @@ def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4):
972971
to machine code and run them multithreaded.
973972
974973
delta_t : float, optional, default 67.0
974+
Difference between terrestrial time and UT1.
975975
If delta_t is None, uses spa.calculate_deltat
976976
using time.year and time.month from pandas.DatetimeIndex.
977-
For most simulations specifing delta_t is sufficient.
978-
Difference between terrestrial time and UT1.
977+
For most simulations the default delta_t is sufficient.
979978
*Note: delta_t = None will break code using nrel_numba,
980979
this will be fixed in a future version.*
981-
By default, use USNO historical data and predictions
982980
983981
numthreads : int, optional, default 4
984982
Number of threads to use if how == 'numba'.

pvlib/spa.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1097,15 +1097,9 @@ def solar_position(unixtime, lat, lon, elev, pressure, temp, delta_t,
10971097
temp : int or float
10981098
avg. yearly temperature at location in
10991099
degrees C; used for atmospheric correction
1100-
delta_t : float, optional
1101-
If delta_t is None, uses spa.calculate_deltat
1102-
using time.year and time.month from pandas.DatetimeIndex.
1103-
For most simulations specifing delta_t is sufficient.
1100+
delta_t : float
11041101
Difference between terrestrial time and UT1.
1105-
*Note: delta_t = None will break code using nrel_numba,
1106-
this will be fixed in a future version.
1107-
By default, use USNO historical data and predictions
1108-
atmos_refrac : float, optional
1102+
atmos_refrac : float
11091103
The approximate atmospheric refraction (in degrees)
11101104
at sunrise and sunset.
11111105
numthreads: int, optional, default 8

0 commit comments

Comments
 (0)