Skip to content

Commit 6500add

Browse files
committed
default None -> optional (pvlib#1574)
(?<spaces> {8}| {4})(?<name>\w*) : (?<types>.*), default None$ $1$2 : $3, optional (?<spaces> {8}| {4})(?<name>\w*) : None or (?<type>.*), optional$ $1$2 : $3, optional (?<spaces> {8}| {4})(?<name>\w*) : (?<type>.*) or [nN]one, optional$ $1$2 : $3, optional Over files: pvlib/**/*.py
1 parent 3497ff4 commit 6500add

17 files changed

+90
-90
lines changed

pvlib/clearsky.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None,
159159
160160
longitude : float or int
161161
162-
filepath : None or string, default None
162+
filepath : string, optional
163163
The path to the ``.h5`` file.
164164
165165
interp_turbidity : bool, default True
@@ -673,7 +673,7 @@ def detect_clearsky(measured, clearsky, times=None, window_length=10,
673673
Time series of measured GHI. [W/m2]
674674
clearsky : array or Series
675675
Time series of the expected clearsky GHI. [W/m2]
676-
times : DatetimeIndex or None, default None
676+
times : DatetimeIndex, optional
677677
Times of measured and clearsky values. If None the index of measured
678678
will be used.
679679
window_length : int, default 10

pvlib/iam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def sapm(aoi, module, upper=None):
514514
A dict or Series with the SAPM IAM model parameters.
515515
See the :py:func:`sapm` notes section for more details.
516516
517-
upper : None or float, default None
517+
upper : float, optional
518518
Upper limit on the results.
519519
520520
Returns

pvlib/iotools/epw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def read_epw(filename, coerce_year=None):
2525
filename : String
2626
Can be a relative file path, absolute file path, or url.
2727
28-
coerce_year : None or int, default None
28+
coerce_year : int, optional
2929
If supplied, the year of the data will be set to this value. This can
3030
be a useful feature because EPW data is composed of data from
3131
different years.
@@ -247,7 +247,7 @@ def parse_epw(csvdata, coerce_year=None):
247247
csvdata : file-like buffer
248248
a file-like buffer containing data in the EPW format
249249
250-
coerce_year : None or int, default None
250+
coerce_year : int, optional
251251
If supplied, the year of the data will be set to this value. This can
252252
be a useful feature because EPW data is composed of data from
253253
different years.

pvlib/iotools/pvgis.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
6363
In decimal degrees, between -90 and 90, north is positive (ISO 19115)
6464
longitude : float
6565
In decimal degrees, between -180 and 180, east is positive (ISO 19115)
66-
start : int or datetime like, default None
66+
start : int or datetime like, optional
6767
First year of the radiation time series. Defaults to first year
6868
available.
69-
end : int or datetime like, default None
69+
end : int or datetime like, optional
7070
Last year of the radiation time series. Defaults to last year
7171
available.
72-
raddatabase : str, default None
72+
raddatabase : str, optional
7373
Name of radiation database. Options depend on location, see [3]_.
7474
components : bool, default True
7575
Output solar radiation components (beam, diffuse, and reflected).
@@ -87,14 +87,14 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
8787
PVGIS website and pvlib<=0.9.5 is offset by 180 degrees.
8888
usehorizon : bool, default True
8989
Include effects of horizon
90-
userhorizon : list of float, default None
90+
userhorizon : list of float, optional
9191
Optional user specified elevation of horizon in degrees, at equally
9292
spaced azimuth clockwise from north, only valid if ``usehorizon`` is
9393
true, if ``usehorizon`` is true but ``userhorizon`` is ``None`` then
9494
PVGIS will calculate the horizon [4]_
9595
pvcalculation : bool, default False
9696
Return estimate of hourly PV production.
97-
peakpower : float, default None
97+
peakpower : float, optional
9898
Nominal power of PV system in kW. Required if pvcalculation=True.
9999
pvtechchoice : {'crystSi', 'CIS', 'CdTe', 'Unknown'}, default 'crystSi'
100100
PV technology.
@@ -309,7 +309,7 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):
309309
----------
310310
filename : str, pathlib.Path, or file-like buffer
311311
Name, path, or buffer of hourly data file downloaded from PVGIS.
312-
pvgis_format : str, default None
312+
pvgis_format : str, optional
313313
Format of PVGIS file or buffer. Equivalent to the ``outputformat``
314314
parameter in the PVGIS API. If ``filename`` is a file and
315315
``pvgis_format`` is ``None`` then the file extension will be used to
@@ -409,14 +409,14 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
409409
documentation [2]_ for more info.
410410
usehorizon : bool, default True
411411
include effects of horizon
412-
userhorizon : list of float, default None
412+
userhorizon : list of float, optional
413413
optional user specified elevation of horizon in degrees, at equally
414414
spaced azimuth clockwise from north, only valid if ``usehorizon`` is
415415
true, if ``usehorizon`` is true but ``userhorizon`` is ``None`` then
416416
PVGIS will calculate the horizon [3]_
417-
startyear : int, default None
417+
startyear : int, optional
418418
first year to calculate TMY
419-
endyear : int, default None
419+
endyear : int, optional
420420
last year to calculate TMY, must be at least 10 years from first year
421421
url : str, default :const:`pvlib.iotools.pvgis.URL`
422422
base url of PVGIS API, append ``tmy`` to get TMY endpoint
@@ -573,7 +573,7 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=True):
573573
----------
574574
filename : str, pathlib.Path, or file-like buffer
575575
Name, path, or buffer of file downloaded from PVGIS.
576-
pvgis_format : str, default None
576+
pvgis_format : str, optional
577577
Format of PVGIS file or buffer. Equivalent to the ``outputformat``
578578
parameter in the PVGIS TMY API. If ``filename`` is a file and
579579
``pvgis_format`` is ``None`` then the file extension will be used to

pvlib/iotools/sodapro.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
8787
integrated : boolean, default False
8888
Whether to return radiation parameters as integrated values (Wh/m^2)
8989
or as average irradiance values (W/m^2) (pvlib preferred units)
90-
label : {'right', 'left'}, default None
90+
label : {'right', 'left'}, optional
9191
Which bin edge label to label time-step with. The default is 'left' for
9292
all time steps except for '1M' which has a default of 'right'.
9393
map_variables : bool, default True
@@ -240,7 +240,7 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
240240
integrated : boolean, default False
241241
Whether to return radiation parameters as integrated values (Wh/m^2)
242242
or as average irradiance values (W/m^2) (pvlib preferred units)
243-
label : {'right', 'left'}, default None
243+
label : {'right', 'left'}, optional
244244
Which bin edge label to label time-step with. The default is 'left' for
245245
all time steps except for '1M' which has a default of 'right'.
246246
map_variables : bool, default True
@@ -341,7 +341,7 @@ def read_cams(filename, integrated=False, label=None, map_variables=True):
341341
integrated : boolean, default False
342342
Whether to return radiation parameters as integrated values (Wh/m^2)
343343
or as average irradiance values (W/m^2) (pvlib preferred units)
344-
label : {'right', 'left}, default None
344+
label : {'right', 'left}, optional
345345
Which bin edge label to label time-step with. The default is 'left' for
346346
all time steps except for '1M' which has a default of 'right'.
347347
map_variables : bool, default True

pvlib/iotools/tmy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def read_tmy3(filename, coerce_year=None, map_variables=None, recolumn=None,
4040
----------
4141
filename : str
4242
A relative file path or absolute file path.
43-
coerce_year : None or int, default None
43+
coerce_year : int, optional
4444
If supplied, the year of the index will be set to `coerce_year`, except
4545
for the last index value which will be set to the *next* year so that
4646
the index increases monotonically.
47-
map_variables : bool, default None
47+
map_variables : bool, optional
4848
When True, renames columns of the DataFrame to pvlib variable names
4949
where applicable. See variable :const:`VARIABLE_MAP`.
5050
recolumn : bool (deprecated, use map_variables instead)

pvlib/irradiance.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ def get_total_irradiance(surface_tilt, surface_azimuth,
340340
Global horizontal irradiance. [W/m2]
341341
dhi : numeric
342342
Diffuse horizontal irradiance. [W/m2]
343-
dni_extra : None or numeric, default None
343+
dni_extra : numeric, optional
344344
Extraterrestrial direct normal irradiance. [W/m2]
345-
airmass : None or numeric, default None
345+
airmass : numeric, optional
346346
Relative airmass (not adjusted for pressure). [unitless]
347347
albedo : numeric, default 0.25
348348
Ground surface albedo. [unitless]
349-
surface_type : None or str, default None
349+
surface_type : str, optional
350350
Surface type. See :py:func:`~pvlib.irradiance.get_ground_diffuse` for
351351
the list of accepted values.
352352
model : str, default 'isotropic'
@@ -417,9 +417,9 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
417417
Global horizontal irradiance. [W/m2]
418418
dhi : numeric
419419
Diffuse horizontal irradiance. [W/m2]
420-
dni_extra : None or numeric, default None
420+
dni_extra : numeric, optional
421421
Extraterrestrial direct normal irradiance. [W/m2]
422-
airmass : None or numeric, default None
422+
airmass : numeric, optional
423423
Relative airmass (not adjusted for pressure). [unitless]
424424
model : str, default 'isotropic'
425425
Irradiance model. Can be one of ``'isotropic'``, ``'klucher'``,
@@ -564,7 +564,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
564564
the reflection coefficient. Must be >=0 and <=1. Will be
565565
overridden if surface_type is supplied.
566566
567-
surface_type : None or string, default None
567+
surface_type : string, optional
568568
If not None, overrides albedo. String can be one of 'urban',
569569
'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', 'concrete',
570570
'aluminum', 'copper', 'fresh steel', 'dirty steel', 'sea'.
@@ -777,17 +777,17 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
777777
dni_extra : numeric
778778
Extraterrestrial normal irradiance in W/m^2.
779779
780-
solar_zenith : None or numeric, default None
780+
solar_zenith : numeric, optional
781781
Solar apparent (refraction-corrected) zenith angles in decimal
782782
degrees. Must supply ``solar_zenith`` and ``solar_azimuth`` or
783783
supply ``projection_ratio``.
784784
785-
solar_azimuth : None or numeric, default None
785+
solar_azimuth : numeric, optional
786786
Solar azimuth angles in decimal degrees. Must supply
787787
``solar_zenith`` and ``solar_azimuth`` or supply
788788
``projection_ratio``.
789789
790-
projection_ratio : None or numeric, default None
790+
projection_ratio : numeric, optional
791791
Ratio of angle of incidence projection to solar zenith angle
792792
projection. Must supply ``solar_zenith`` and ``solar_azimuth``
793793
or supply ``projection_ratio``.
@@ -1541,7 +1541,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True,
15411541
GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
15421542
input data must be Series.
15431543
1544-
temp_dew : None, float, or array-like, default None
1544+
temp_dew : None, float, or array-like, optional
15451545
Surface dew point temperatures, in degrees C. Values of temp_dew
15461546
may be numeric or NaN. Any single time period point with a
15471547
temp_dew=NaN does not have dew point improvements applied. If
@@ -1790,7 +1790,7 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325.,
17901790
GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
17911791
input data must be Series.
17921792
1793-
temp_dew : None, float, or array-like, default None
1793+
temp_dew : None, float, or array-like, optional
17941794
Surface dew point temperatures, in degrees C. Values of temp_dew
17951795
may be numeric or NaN. Any single time period point with a
17961796
temp_dew=NaN does not have dew point improvements applied. If
@@ -1898,7 +1898,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times,
18981898
GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
18991899
input data must be Series.
19001900
1901-
temp_dew : None, float, or array-like, default None
1901+
temp_dew : None, float, or array-like, optional
19021902
Surface dew point temperatures, in degrees C. Values of temp_dew
19031903
may be numeric or NaN. Any single time period point with a
19041904
temp_dew=NaN does not have dew point improvements applied. If
@@ -3008,7 +3008,7 @@ def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1,
30083008
True (not refraction-corrected) zenith angles in decimal
30093009
degrees. Angles must be >=0 and <=180.
30103010
3011-
clearsky_dni : None or Series, default None
3011+
clearsky_dni : Series, optional
30123012
Clearsky direct normal irradiance.
30133013
30143014
clearsky_tolerance : float, default 1.1

pvlib/ivtools/sde.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def fit_sandia_simple(voltage, current, v_oc=None, i_sc=None, v_mp_i_mp=None,
2525
1D array of `float` type containing current at each point on the IV
2626
curve, from ``i_sc`` to 0 inclusive. [A]
2727
28-
v_oc : float, default None
28+
v_oc : float, optional
2929
Open circuit voltage. If not provided, ``v_oc`` is taken as the
3030
last point in the ``voltage`` array. [V]
3131
32-
i_sc : float, default None
32+
i_sc : float, optional
3333
Short circuit current. If not provided, ``i_sc`` is taken as the
3434
first point in the ``current`` array. [A]
3535
36-
v_mp_i_mp : tuple of float, default None
36+
v_mp_i_mp : tuple of float, optional
3737
Voltage, current at maximum power point. If not provided, the maximum
3838
power point is found at the maximum of ``voltage`` \times ``current``.
3939
[V], [A]

pvlib/ivtools/sdm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
166166
Reference temperature condition [C]
167167
irrad_ref : float, default 1000
168168
Reference irradiance condition [W/m2]
169-
root_kwargs : dictionary, default None
169+
root_kwargs : dictionary, optional
170170
Dictionary of arguments to pass onto scipy.optimize.root()
171171
172172
Returns

pvlib/ivtools/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def rectify_iv_curve(voltage, current, decimals=None):
136136
----------
137137
voltage : numeric [V]
138138
current : numeric [A]
139-
decimals : int or None, default None
139+
decimals : int, optional
140140
number of decimal places to which voltage is rounded to remove
141141
duplicated points. If None, no rounding is done.
142142

pvlib/location.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Location:
4747
altitude : float, default 0
4848
Altitude from sea level in meters.
4949
50-
name : None or string, default None
50+
name : string, optional
5151
Sets the name attribute of the Location object.
5252
5353
See also
@@ -94,7 +94,7 @@ def from_tmy(cls, tmy_metadata, tmy_data=None, **kwargs):
9494
----------
9595
tmy_metadata : dict
9696
Returned from tmy.readtmy2 or tmy.readtmy3
97-
tmy_data : None or DataFrame, default None
97+
tmy_data : DataFrame, optional
9898
Optionally attach the TMY data to this object.
9999
100100
Returns
@@ -138,7 +138,7 @@ def from_epw(cls, metadata, data=None, **kwargs):
138138
----------
139139
metadata : dict
140140
Returned from epw.read_epw
141-
data : None or DataFrame, default None
141+
data : DataFrame, optional
142142
Optionally attach the epw data to this object.
143143
144144
Returns
@@ -173,7 +173,7 @@ def get_solarposition(self, times, pressure=None, temperature=12,
173173
----------
174174
times : pandas.DatetimeIndex
175175
Must be localized or UTC will be assumed.
176-
pressure : None, float, or array-like, default None
176+
pressure : None, float, or array-like, optional
177177
If None, pressure will be calculated using
178178
:py:func:`pvlib.atmosphere.alt2pres` and ``self.altitude``.
179179
temperature : None, float, or array-like, default 12
@@ -209,10 +209,10 @@ def get_clearsky(self, times, model='ineichen', solar_position=None,
209209
model : str, default 'ineichen'
210210
The clear sky model to use. Must be one of
211211
'ineichen', 'haurwitz', 'simplified_solis'.
212-
solar_position : None or DataFrame, default None
212+
solar_position : DataFrame, optional
213213
DataFrame with columns 'apparent_zenith', 'zenith',
214214
'apparent_elevation'.
215-
dni_extra : None or numeric, default None
215+
dni_extra : numeric, optional
216216
If None, will be calculated from times.
217217
218218
kwargs
@@ -279,9 +279,9 @@ def get_airmass(self, times=None, solar_position=None,
279279
280280
Parameters
281281
----------
282-
times : None or DatetimeIndex, default None
282+
times : DatetimeIndex, optional
283283
Only used if solar_position is not provided.
284-
solar_position : None or DataFrame, default None
284+
solar_position : DataFrame, optional
285285
DataFrame with with columns 'apparent_zenith', 'zenith'.
286286
model : str, default 'kastenyoung1989'
287287
Relative airmass model. See

0 commit comments

Comments
 (0)