Skip to content
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

Docstring cleanup: "default None", doi #1828

Merged
merged 29 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 24 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
8 changes: 4 additions & 4 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 @@ -703,9 +703,9 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
Time series of measured GHI. [W/m2]
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 : DatetimeIndex, optional
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
12 changes: 6 additions & 6 deletions pvlib/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def physical(aoi, n=1.526, K=4.0, L=0.002, *, n_ar=None):

n_ar : numeric, optional
The effective index of refraction of the anti-reflective (AR) coating
(unitless). If n_ar is None (default), no AR coating is applied.
(unitless). If n_ar is not supplied, no AR coating is applied.
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved
A typical value for the effective index of an AR coating is 1.29.

Returns
Expand Down Expand Up @@ -338,7 +338,7 @@ def martin_ruiz_diffuse(surface_tilt, a_r=0.16, c1=0.4244, c2=None):
c2 : float
Second fitting parameter for the expressions that approximate the
integral of diffuse irradiance coming from different directions.
If c2 is None, it will be calculated according to the linear
If c2 is not specified, it will be calculated according to the linear
relationship given in [3]_.

Returns
Expand Down 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
62 changes: 31 additions & 31 deletions pvlib/iotools/pvgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
In decimal degrees, between -90 and 90, north is positive (ISO 19115)
longitude: float
In decimal degrees, between -180 and 180, east is positive (ISO 19115)
start: int or datetime like, default: None
start : int or datetime like, optional
First year of the radiation time series. Defaults to first year
available.
end: int or datetime like, default: None
end : int or datetime like, optional
Last year of the radiation time series. Defaults to last year
available.
raddatabase: str, default: None
raddatabase : str, optional
Name of radiation database. Options depend on location, see [3]_.
components: bool, default: True
Output solar radiation components (beam, diffuse, and reflected).
Expand All @@ -87,14 +87,14 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
and pvlib<=0.9.5 is offset by 180 degrees.
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
true, if ``usehorizon`` is true but ``userhorizon`` is not specified then
PVGIS will calculate the horizon [4]_
pvcalculation: bool, default: False
Return estimate of hourly PV production.
peakpower: float, default: None
peakpower : float, optional
Nominal power of PV system in kW. Required if pvcalculation=True.
pvtechchoice: {'crystSi', 'CIS', 'CdTe', 'Unknown'}, default: 'crystSi'
PV technology.
Expand Down Expand Up @@ -309,12 +309,12 @@ 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
determine the PVGIS format to parse. If ``filename`` is a buffer, then
``pvgis_format`` is required and must be in ``['csv', 'json']``.
``pvgis_format`` is not specified then the file extension will be used
to determine the PVGIS format to parse. If ``filename`` is a buffer,
then ``pvgis_format`` is required and must be in ``['csv', 'json']``.
map_variables: bool, default True
When true, renames columns of the DataFrame to pvlib variable names
where applicable. See variable :const:`VARIABLE_MAP`.
Expand All @@ -336,11 +336,11 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):
Raises
------
ValueError
if ``pvgis_format`` is ``None`` and the file extension is neither
if ``pvgis_format`` is not specified and the file extension is neither
``.csv`` nor ``.json`` or if ``pvgis_format`` is provided as
input but isn't in ``['csv', 'json']``
TypeError
if ``pvgis_format`` is ``None`` and ``filename`` is a buffer
if ``pvgis_format`` is not specified and ``filename`` is a buffer

See Also
--------
Expand Down Expand Up @@ -409,14 +409,13 @@ 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
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
userhorizon : list of float, optional
Optional user-specified elevation of horizon in degrees, at equally
spaced azimuth clockwise from north. If not specified, PVGIS will
calculate the horizon [3]_. If specified, requires ``usehorizon=True``.
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 All @@ -431,11 +430,11 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
data : pandas.DataFrame
the weather data
months_selected : list
TMY year for each month, ``None`` for basic and EPW
TMY year for each month, do not specify for basic and EPW
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved
inputs : dict
the inputs, ``None`` for basic and EPW
the inputs, do not specify for basic and EPW
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved
metadata : list or dict
file metadata, ``None`` for basic
file metadata, do not specify for basic
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved

Note
----
Expand Down Expand Up @@ -573,12 +572,13 @@ 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
determine the PVGIS format to parse. For PVGIS files from the API with
``outputformat='basic'``, please set ``pvgis_format`` to ``'basic'``.
``pvgis_format`` is not specified then the file extension will be used
to determine the PVGIS format to parse. For PVGIS files from the API
with ``outputformat='basic'``, please set ``pvgis_format`` to
``'basic'``.
If ``filename`` is a buffer, then ``pvgis_format`` is required and must
be in ``['csv', 'epw', 'json', 'basic']``.
map_variables: bool, default True
Expand All @@ -591,20 +591,20 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=True):
data : pandas.DataFrame
the weather data
months_selected : list
TMY year for each month, ``None`` for basic and EPW
TMY year for each month, do not specify for basic and EPW
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved
inputs : dict
the inputs, ``None`` for basic and EPW
the inputs, do not specify for basic and EPW
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved
metadata : list or dict
file metadata, ``None`` for basic
file metadata, do not specify for basic
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved

Raises
------
ValueError
if ``pvgis_format`` is ``None`` and the file extension is neither
if ``pvgis_format`` is not specified and the file extension is neither
``.csv``, ``.json``, nor ``.epw``, or if ``pvgis_format`` is provided
as input but isn't in ``['csv', 'epw', 'json', 'basic']``
TypeError
if ``pvgis_format`` is ``None`` and ``filename`` is a buffer
if ``pvgis_format`` is not specified and ``filename`` is a buffer

See Also
--------
Expand Down
10 changes: 5 additions & 5 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 All @@ -88,7 +88,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
integrated: boolean, default False
Whether to return radiation parameters as integrated values (Wh/m^2)
or as average irradiance values (W/m^2) (pvlib preferred units)
label: {'right', 'left'}, default: None
label : {'right', 'left'}, optional
Which bin edge label to label time-step with. The default is 'left' for
all time steps except for '1M' which has a default of 'right'.
map_variables: bool, default: True
Expand Down Expand Up @@ -241,7 +241,7 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
integrated: boolean, default False
Whether to return radiation parameters as integrated values (Wh/m^2)
or as average irradiance values (W/m^2) (pvlib preferred units)
label: {'right', 'left'}, default: None
label : {'right', 'left'}, optional
Which bin edge label to label time-step with. The default is 'left' for
all time steps except for '1M' which has a default of 'right'.
map_variables: bool, default: True
Expand Down Expand Up @@ -342,7 +342,7 @@ def read_cams(filename, integrated=False, label=None, map_variables=True):
integrated: boolean, default False
Whether to return radiation parameters as integrated values (Wh/m^2)
or as average irradiance values (W/m^2) (pvlib preferred units)
label: {'right', 'left}, default: None
label : {'right', 'left}, optional
Which bin edge label to label time-step with. The default is 'left' for
all time steps except for '1M' which has a default of 'right'.
map_variables: bool, default: True
Expand Down
6 changes: 3 additions & 3 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
If supplied, the year of the index will be set to `coerce_year`, except
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
Loading
Loading