Skip to content

Docstring cleanup: "default None", doi #1828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
29b3aa8
Align reference
echedey-ls Jun 26, 2023
15d8107
Update irradiance.py
echedey-ls Jun 26, 2023
9c5f6b2
Remove parenthesis in types
echedey-ls Aug 6, 2023
059f32c
Remove none in type definition #1574
echedey-ls Aug 6, 2023
96a4f58
Change if none ocurrences (I)
echedey-ls Aug 6, 2023
a89addb
Change if none ocurrences (II)
echedey-ls Aug 6, 2023
e931a5d
Too long line
echedey-ls Aug 6, 2023
e9495e0
Too long line
echedey-ls Aug 6, 2023
469edc2
fix doi external links
echedey-ls Oct 28, 2023
7b3cc76
Merge branch 'main' into refactor-docstring-params-2
echedey-ls Oct 28, 2023
1bc3b12
Apply cwhanse suggestion
echedey-ls Oct 31, 2023
57f67bb
Apply cwhanse suggestion
echedey-ls Oct 31, 2023
8794a2e
Apply cwhanse suggestion
echedey-ls Oct 31, 2023
2378db1
Apply cwhanse suggestion
echedey-ls Oct 31, 2023
6171e77
Modified cwhanse suggestion
echedey-ls Oct 31, 2023
3c3779e
Merge branch 'refactor-docstring-params-2' of https://github.com/eche…
echedey-ls Oct 31, 2023
c75a662
Update modelchain.py
echedey-ls Oct 31, 2023
9c52070
Some None's missed
echedey-ls Oct 31, 2023
232156c
``none``'s, some more ``'s to variables and some other nones
echedey-ls Oct 31, 2023
b8f942b
Special ``none`` cases (please review)
echedey-ls Oct 31, 2023
f7c6c7c
Linter
echedey-ls Oct 31, 2023
ec2b176
Run more regexes
echedey-ls Oct 31, 2023
daa5e65
More Nones
echedey-ls Nov 1, 2023
8ddcd7e
Update irradiance.py
echedey-ls Nov 1, 2023
1a39119
Revert "Special ``none`` cases (please review)"
echedey-ls Nov 2, 2023
eb0806d
Apply suggestions from code review
echedey-ls Nov 2, 2023
57d61af
Update irradiance.py
echedey-ls Nov 2, 2023
69c8321
Update pvlib/irradiance.py
echedey-ls Nov 2, 2023
1f24c92
Update irradiance.py
echedey-ls Nov 3, 2023
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
2 changes: 1 addition & 1 deletion pvlib/bifacial/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _unshaded_ground_fraction(surface_tilt, surface_azimuth, solar_zenith,
.. [1] Mikofski, M., Darawali, R., Hamer, M., Neubert, A., and Newmiller,
J. "Bifacial Performance Modeling in Large Arrays". 2019 IEEE 46th
Photovoltaic Specialists Conference (PVSC), 2019, pp. 1282-1287.
doi: 10.1109/PVSC40753.2019.8980572.
:doi:`10.1109/PVSC40753.2019.8980572`.
"""
tan_phi = _solar_projection_tangent(solar_zenith, solar_azimuth,
surface_azimuth)
Expand Down
6 changes: 3 additions & 3 deletions pvlib/clearsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None,

longitude : float or int

filepath : None or string, default None
filepath : string, optional
The path to the ``.h5`` file.

interp_turbidity : bool, default True
Expand Down Expand Up @@ -704,8 +704,8 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
clearsky : array or Series
Time series of the expected clearsky GHI. [W/m2]
times : DatetimeIndex or None, default None.
Times of measured and clearsky values. If None the index of measured
will be used.
Times of measured and clearsky values. If not specified, the index of
measured will be used.
infer_limits : bool, default False
If True, does not use passed in kwargs (or defaults), but instead
interpolates these values from Table 1 in [2]_.
Expand Down
8 changes: 4 additions & 4 deletions pvlib/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def sapm(aoi, module, upper=None):
A dict or Series with the SAPM IAM model parameters.
See the :py:func:`sapm` notes section for more details.

upper : None or float, default None
upper : float, optional
Upper limit on the results.

Returns
Expand All @@ -541,7 +541,7 @@ def sapm(aoi, module, upper=None):

.. [3] B.H. King et al, "Recent Advancements in Outdoor Measurement
Techniques for Angle of Incidence Effects," 42nd IEEE PVSC (2015).
DOI: 10.1109/PVSC.2015.7355849
:doi:`10.1109/PVSC.2015.7355849`

See Also
--------
Expand Down Expand Up @@ -607,7 +607,7 @@ def marion_diffuse(model, surface_tilt, **kwargs):
.. [1] B. Marion "Numerical method for angle-of-incidence correction
factors for diffuse radiation incident photovoltaic modules",
Solar Energy, Volume 147, Pages 344-348. 2017.
DOI: 10.1016/j.solener.2017.03.027
:doi:`10.1016/j.solener.2017.03.027`

Examples
--------
Expand Down Expand Up @@ -694,7 +694,7 @@ def marion_integrate(function, surface_tilt, region, num=None):
.. [1] B. Marion "Numerical method for angle-of-incidence correction
factors for diffuse radiation incident photovoltaic modules",
Solar Energy, Volume 147, Pages 344-348. 2017.
DOI: 10.1016/j.solener.2017.03.027
:doi:`10.1016/j.solener.2017.03.027`

Examples
--------
Expand Down
4 changes: 2 additions & 2 deletions pvlib/iotools/epw.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def read_epw(filename, coerce_year=None):
filename : String
Can be a relative file path, absolute file path, or url.

coerce_year : None or int, default None
coerce_year : int, optional
If supplied, the year of the data will be set to this value. This can
be a useful feature because EPW data is composed of data from
different years.
Expand Down Expand Up @@ -247,7 +247,7 @@ def parse_epw(csvdata, coerce_year=None):
csvdata : file-like buffer
a file-like buffer containing data in the EPW format

coerce_year : None or int, default None
coerce_year : int, optional
If supplied, the year of the data will be set to this value. This can
be a useful feature because EPW data is composed of data from
different years.
Expand Down
10 changes: 5 additions & 5 deletions pvlib/iotools/pvgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):
----------
filename : str, pathlib.Path, or file-like buffer
Name, path, or buffer of hourly data file downloaded from PVGIS.
pvgis_format : str, default None
pvgis_format : str, optional
Format of PVGIS file or buffer. Equivalent to the ``outputformat``
parameter in the PVGIS API. If ``filename`` is a file and
``pvgis_format`` is ``None`` then the file extension will be used to
Expand Down Expand Up @@ -409,14 +409,14 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
documentation [2]_ for more info.
usehorizon : bool, default True
include effects of horizon
userhorizon : list of float, default None
userhorizon : list of float, optional
optional user specified elevation of horizon in degrees, at equally
spaced azimuth clockwise from north, only valid if ``usehorizon`` is
true, if ``usehorizon`` is true but ``userhorizon`` is ``None`` then
PVGIS will calculate the horizon [3]_
startyear : int, default None
startyear : int, optional
first year to calculate TMY
endyear : int, default None
endyear : int, optional
last year to calculate TMY, must be at least 10 years from first year
map_variables: bool, default True
When true, renames columns of the Dataframe to pvlib variable names
Expand Down Expand Up @@ -573,7 +573,7 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=True):
----------
filename : str, pathlib.Path, or file-like buffer
Name, path, or buffer of file downloaded from PVGIS.
pvgis_format : str, default None
pvgis_format : str, optional
Format of PVGIS file or buffer. Equivalent to the ``outputformat``
parameter in the PVGIS TMY API. If ``filename`` is a file and
``pvgis_format`` is ``None`` then the file extension will be used to
Expand Down
4 changes: 2 additions & 2 deletions pvlib/iotools/sodapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
identifier: {'mcclear', 'cams_radiation'}
Specify whether to retrieve CAMS Radiation or McClear parameters
altitude: float, optional
Altitude in meters. If None, then the altitude is determined from the
NASA SRTM database
Altitude in meters. If not specified, then the altitude is determined
from the NASA SRTM database
time_step: str, {'1min', '15min', '1h', '1d', '1M'}, default: '1h'
Time step of the time series, either 1 minute, 15 minute, hourly,
daily, or monthly.
Expand Down
4 changes: 2 additions & 2 deletions pvlib/iotools/tmy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def read_tmy3(filename, coerce_year=None, map_variables=None, recolumn=None,
----------
filename : str
A relative file path or absolute file path.
coerce_year : None or int, default None
coerce_year : int, optional
If supplied, the year of the index will be set to `coerce_year`, except
for the last index value which will be set to the *next* year so that
the index increases monotonically.
map_variables : bool, default None
map_variables : bool, optional
When True, renames columns of the DataFrame to pvlib variable names
where applicable. See variable :const:`VARIABLE_MAP`.
recolumn : bool (deprecated, use map_variables instead)
Expand Down
36 changes: 18 additions & 18 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,13 @@ def get_total_irradiance(surface_tilt, surface_azimuth,
Global horizontal irradiance. [W/m2]
dhi : numeric
Diffuse horizontal irradiance. [W/m2]
dni_extra : None or numeric, default None
dni_extra : numeric, optional
Extraterrestrial direct normal irradiance. [W/m2]
airmass : None or numeric, default None
airmass : numeric, optional
Relative airmass (not adjusted for pressure). [unitless]
albedo : numeric, default 0.25
Ground surface albedo. [unitless]
surface_type : None or str, default None
surface_type : str, optional
Surface type. See :py:func:`~pvlib.irradiance.get_ground_diffuse` for
the list of accepted values.
model : str, default 'isotropic'
Expand Down Expand Up @@ -421,9 +421,9 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
Global horizontal irradiance. [W/m2]
dhi : numeric
Diffuse horizontal irradiance. [W/m2]
dni_extra : None or numeric, default None
dni_extra : numeric, optional
Extraterrestrial direct normal irradiance. [W/m2]
airmass : None or numeric, default None
airmass : numeric, optional
Relative airmass (not adjusted for pressure). [unitless]
model : str, default 'isotropic'
Irradiance model. Can be one of ``'isotropic'``, ``'klucher'``,
Expand Down Expand Up @@ -574,7 +574,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
the reflection coefficient. Must be >=0 and <=1. Will be
overridden if surface_type is supplied.

surface_type: None or string, default None
surface_type : string, optional
If not None, overrides albedo. String can be one of 'urban',
'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', 'concrete',
'aluminum', 'copper', 'fresh steel', 'dirty steel', 'sea'.
Expand Down Expand Up @@ -790,17 +790,17 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
dni_extra : numeric
Extraterrestrial normal irradiance in W/m^2.

solar_zenith : None or numeric, default None
solar_zenith : numeric, optional
Solar apparent (refraction-corrected) zenith angles in decimal
degrees. Must supply ``solar_zenith`` and ``solar_azimuth`` or
supply ``projection_ratio``.

solar_azimuth : None or numeric, default None
solar_azimuth : numeric, optional
Solar azimuth angles in decimal degrees. Must supply
``solar_zenith`` and ``solar_azimuth`` or supply
``projection_ratio``.

projection_ratio : None or numeric, default None
projection_ratio : numeric, optional
Ratio of angle of incidence projection to solar zenith angle
projection. Must supply ``solar_zenith`` and ``solar_azimuth``
or supply ``projection_ratio``.
Expand Down Expand Up @@ -1081,7 +1081,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
inputs. AM must be >=0 (careful using the 1/sec(z) model of AM
generation)

model : string (optional, default='allsitescomposite1990')
model : string, default 'allsitescomposite1990'
A string which selects the desired set of Perez coefficients. If
model is not provided as an input, the default, '1990' will be
used. All possible model selections are:
Expand All @@ -1099,7 +1099,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
* 'capecanaveral1988'
* 'albany1988'

return_components: bool (optional, default=False)
return_components : bool, default False
Flag used to decide whether to return the calculated diffuse components
or not.

Expand Down Expand Up @@ -1621,7 +1621,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325,
pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex.

pressure : None or numeric, default 101325
Site pressure in Pascal. If None, relative airmass is used
Site pressure in Pascal. If not specified, relative airmass is used
instead of absolute (pressure-corrected) airmass.

min_cos_zenith : numeric, default 0.065
Expand Down Expand Up @@ -1776,7 +1776,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True,
GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
input data must be Series.

temp_dew : None, float, or array-like, default None
temp_dew : None, float, or array-like, optional
Surface dew point temperatures, in degrees C. Values of temp_dew
may be numeric or NaN. Any single time period point with a
temp_dew=NaN does not have dew point improvements applied. If
Expand Down Expand Up @@ -2025,7 +2025,7 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325.,
GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
input data must be Series.

temp_dew : None, float, or array-like, default None
temp_dew : None, float, or array-like, optional
Surface dew point temperatures, in degrees C. Values of temp_dew
may be numeric or NaN. Any single time period point with a
temp_dew=NaN does not have dew point improvements applied. If
Expand Down Expand Up @@ -2133,7 +2133,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times,
GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
input data must be Series.

temp_dew : None, float, or array-like, default None
temp_dew : None, float, or array-like, optional
Surface dew point temperatures, in degrees C. Values of temp_dew
may be numeric or NaN. Any single time period point with a
temp_dew=NaN does not have dew point improvements applied. If
Expand Down Expand Up @@ -2652,7 +2652,7 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None,
datetime_or_doy : int, float, array, pd.DatetimeIndex
Day of year or array of days of year e.g.
pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex.
dni_extra : None or numeric, default None
dni_extra : numeric, optional
Extraterrestrial direct normal irradiance. [W/m2]
min_cos_zenith : numeric, default 0.065
Minimum value of cos(zenith) to allow when calculating global
Expand Down Expand Up @@ -2945,7 +2945,7 @@ def _get_perez_coefficients(perezmodel):
Parameters
----------

perezmodel : string (optional, default='allsitescomposite1990')
perezmodel : string, default 'allsitescomposite1990'

a character string which selects the desired set of Perez
coefficients. If model is not provided as an input, the default,
Expand Down Expand Up @@ -3465,7 +3465,7 @@ def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1,
True (not refraction-corrected) zenith angles in decimal
degrees. Angles must be >=0 and <=180.

clearsky_dni : None or Series, default None
clearsky_dni : Series, optional
Clearsky direct normal irradiance.

clearsky_tolerance : float, default 1.1
Expand Down
6 changes: 3 additions & 3 deletions pvlib/ivtools/sde.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ def fit_sandia_simple(voltage, current, v_oc=None, i_sc=None, v_mp_i_mp=None,
1D array of `float` type containing current at each point on the IV
curve, from ``i_sc`` to 0 inclusive. [A]

v_oc : float, default None
v_oc : float, optional
Open circuit voltage. If not provided, ``v_oc`` is taken as the
last point in the ``voltage`` array. [V]

i_sc : float, default None
i_sc : float, optional
Short circuit current. If not provided, ``i_sc`` is taken as the
first point in the ``current`` array. [A]

v_mp_i_mp : tuple of float, default None
v_mp_i_mp : tuple of float, optional
Voltage, current at maximum power point. If not provided, the maximum
power point is found at the maximum of ``voltage`` \times ``current``.
[V], [A]
Expand Down
2 changes: 1 addition & 1 deletion pvlib/ivtools/sdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
Reference temperature condition [C]
irrad_ref: float, default 1000
Reference irradiance condition [W/m2]
root_kwargs: dictionary, default None
root_kwargs : dictionary, optional
Dictionary of arguments to pass onto scipy.optimize.root()

Returns
Expand Down
6 changes: 3 additions & 3 deletions pvlib/ivtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _numdiff(x, f):
----------
.. [1] M. K. Bowen, R. Smith, "Derivative formulae and errors for
non-uniformly spaced points", Proceedings of the Royal Society A, vol.
461 pp 1975 - 1997, July 2005. DOI: 10.1098/rpsa.2004.1430
461 pp 1975 - 1997, July 2005. :doi:`10.1098/rpsa.2004.1430`
.. [2] PVLib MATLAB https://github.com/sandialabs/MATLAB_PV_LIB
"""

Expand Down Expand Up @@ -136,9 +136,9 @@ def rectify_iv_curve(voltage, current, decimals=None):
----------
voltage : numeric [V]
current : numeric [A]
decimals : int or None, default None
decimals : int, optional
number of decimal places to which voltage is rounded to remove
duplicated points. If None, no rounding is done.
duplicated points. If not specified, no rounding is done.

Returns
-------
Expand Down
18 changes: 9 additions & 9 deletions pvlib/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def from_tmy(cls, tmy_metadata, tmy_data=None, **kwargs):
----------
tmy_metadata : dict
Returned from tmy.readtmy2 or tmy.readtmy3
tmy_data : None or DataFrame, default None
tmy_data : DataFrame, optional
Optionally attach the TMY data to this object.

Returns
Expand Down Expand Up @@ -138,7 +138,7 @@ def from_epw(cls, metadata, data=None, **kwargs):
----------
metadata : dict
Returned from epw.read_epw
data : None or DataFrame, default None
data : DataFrame, optional
Optionally attach the epw data to this object.

Returns
Expand Down Expand Up @@ -173,8 +173,8 @@ def get_solarposition(self, times, pressure=None, temperature=12,
----------
times : pandas.DatetimeIndex
Must be localized or UTC will be assumed.
pressure : None, float, or array-like, default None
If None, pressure will be calculated using
pressure : None, float, or array-like, optional
If not specified, pressure will be calculated using
:py:func:`pvlib.atmosphere.alt2pres` and ``self.altitude``.
temperature : None, float, or array-like, default 12

Expand Down Expand Up @@ -209,11 +209,11 @@ def get_clearsky(self, times, model='ineichen', solar_position=None,
model: str, default 'ineichen'
The clear sky model to use. Must be one of
'ineichen', 'haurwitz', 'simplified_solis'.
solar_position : None or DataFrame, default None
solar_position : DataFrame, optional
DataFrame with columns 'apparent_zenith', 'zenith',
'apparent_elevation'.
dni_extra: None or numeric, default None
If None, will be calculated from times.
dni_extra : numeric, optional
If not specified, will be calculated from times.

kwargs
Extra parameters passed to the relevant functions. Climatological
Expand Down Expand Up @@ -279,9 +279,9 @@ def get_airmass(self, times=None, solar_position=None,

Parameters
----------
times : None or DatetimeIndex, default None
times : DatetimeIndex, optional
Only used if solar_position is not provided.
solar_position : None or DataFrame, default None
solar_position : DataFrame, optional
DataFrame with columns 'apparent_zenith', 'zenith'.
model : str, default 'kastenyoung1989'
Relative airmass model. See
Expand Down
Loading