Skip to content

Commit 059f32c

Browse files
committed
Remove none in type definition pvlib#1574
1st-F: (?<spaces> {8}| {4})(?<name>\w*) : (?<types>.*), default None$ 2nd-F: (?<spaces> {8}| {4})(?<name>\w*) : [Nn}one or (?<type>.*), optional$ 3rd-F: (?<spaces> {8}| {4})(?<name>\w*) : (?<type>.*) or [nN]one, optional$ R: $1$2 : $3, optional
1 parent 9c5f6b2 commit 059f32c

15 files changed

+77
-77
lines changed

pvlib/clearsky.py

Lines changed: 1 addition & 1 deletion
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

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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
map_variables: bool, default True
422422
When true, renames columns of the Dataframe to pvlib variable names
@@ -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/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: 14 additions & 14 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
@@ -2285,7 +2285,7 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None,
22852285
datetime_or_doy : int, float, array, pd.DatetimeIndex
22862286
Day of year or array of days of year e.g.
22872287
pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex.
2288-
dni_extra : None or numeric, default None
2288+
dni_extra : numeric, optional
22892289
Extraterrestrial direct normal irradiance. [W/m2]
22902290
min_cos_zenith : numeric, default 0.065
22912291
Minimum value of cos(zenith) to allow when calculating global
@@ -3098,7 +3098,7 @@ def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1,
30983098
True (not refraction-corrected) zenith angles in decimal
30993099
degrees. Angles must be >=0 and <=180.
31003100
3101-
clearsky_dni : None or Series, default None
3101+
clearsky_dni : Series, optional
31023102
Clearsky direct normal irradiance.
31033103
31043104
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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

pvlib/modelchain.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ def basic_chain(times, latitude, longitude,
121121
Inverter parameters as defined by the CEC. See
122122
:py:func:`inverter.sandia` for details.
123123
124-
irradiance : None or DataFrame, default None
124+
irradiance : DataFrame, optional
125125
If None, calculates clear sky data.
126126
Columns must be 'dni', 'ghi', 'dhi'.
127127
128-
weather : None or DataFrame, default None
128+
weather : DataFrame, optional
129129
If None, assumes air temperature is 20 C and
130130
wind speed is 0 m/s.
131131
Columns must be 'wind_speed', 'temp_air'.
@@ -139,11 +139,11 @@ def basic_chain(times, latitude, longitude,
139139
airmass_model : str, default 'kastenyoung1989'
140140
Passed to atmosphere.relativeairmass.
141141
142-
altitude : None or float, default None
142+
altitude : float, optional
143143
If None, computed from pressure. Assumed to be 0 m
144144
if pressure is also None.
145145
146-
pressure : None or float, default None
146+
pressure : float, optional
147147
If None, computed from altitude. Assumed to be 101325 Pa
148148
if altitude is also None.
149149
@@ -472,35 +472,35 @@ class ModelChain:
472472
airmass_model : str, default 'kastenyoung1989'
473473
Passed to location.get_airmass.
474474
475-
dc_model: None, str, or function, default None
475+
dc_model : None, str, or function, optional
476476
If None, the model will be inferred from the parameters that
477477
are common to all of system.arrays[i].module_parameters.
478478
Valid strings are 'sapm', 'desoto', 'cec', 'pvsyst', 'pvwatts'.
479479
The ModelChain instance will be passed as the first argument
480480
to a user-defined function.
481481
482-
ac_model: None, str, or function, default None
482+
ac_model : None, str, or function, optional
483483
If None, the model will be inferred from the parameters that
484484
are common to all of system.inverter_parameters.
485485
Valid strings are 'sandia', 'adr', 'pvwatts'. The
486486
ModelChain instance will be passed as the first argument to a
487487
user-defined function.
488488
489-
aoi_model: None, str, or function, default None
489+
aoi_model : None, str, or function, optional
490490
If None, the model will be inferred from the parameters that
491491
are common to all of system.arrays[i].module_parameters.
492492
Valid strings are 'physical', 'ashrae', 'sapm', 'martin_ruiz',
493493
'no_loss'. The ModelChain instance will be passed as the
494494
first argument to a user-defined function.
495495
496-
spectral_model: None, str, or function, default None
496+
spectral_model : None, str, or function, optional
497497
If None, the model will be inferred from the parameters that
498498
are common to all of system.arrays[i].module_parameters.
499499
Valid strings are 'sapm', 'first_solar', 'no_loss'.
500500
The ModelChain instance will be passed as the first argument to
501501
a user-defined function.
502502
503-
temperature_model: None, str or function, default None
503+
temperature_model : None, str or function, optional
504504
Valid strings are: 'sapm', 'pvsyst', 'faiman', 'fuentes', 'noct_sam'.
505505
The ModelChain instance will be passed as the first argument to a
506506
user-defined function.
@@ -514,7 +514,7 @@ class ModelChain:
514514
Valid strings are 'pvwatts', 'no_loss'. The ModelChain instance
515515
will be passed as the first argument to a user-defined function.
516516
517-
name: None or str, default None
517+
name : str, optional
518518
Name of ModelChain instance.
519519
"""
520520

@@ -575,7 +575,7 @@ def with_pvwatts(cls, system, location,
575575
airmass_model : str, default 'kastenyoung1989'
576576
Passed to location.get_airmass.
577577
578-
name: None or str, default None
578+
name : str, optional
579579
Name of ModelChain instance.
580580
581581
**kwargs
@@ -651,7 +651,7 @@ def with_sapm(cls, system, location,
651651
airmass_model : str, default 'kastenyoung1989'
652652
Passed to location.get_airmass.
653653
654-
name: None or str, default None
654+
name : str, optional
655655
Name of ModelChain instance.
656656
657657
**kwargs

0 commit comments

Comments
 (0)