From 29b3aa8842745d603a76272824e085251fd2a4af Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:39:06 +0200 Subject: [PATCH 01/27] Align reference --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 10f8db3564..e51cdf8625 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -115,7 +115,7 @@ def get_am15g(wavelength=None): References ---------- .. [1] ASTM "G173-03 Standard Tables for Reference Solar Spectral - Irradiances: Direct Normal and Hemispherical on 37° Tilted Surface." + Irradiances: Direct Normal and Hemispherical on 37° Tilted Surface." ''' # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Aug. 2022 From 15d81076567485026afc189b00f080ed35c008a7 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:53:36 +0200 Subject: [PATCH 02/27] Update irradiance.py Exclude .*=| from negative lookahead ^(\s{8}|\s{4})(?!try|else|doi|DOI|Warning|Access|Requests|Note)(\w*): (?!.*:)(.+)$ Reason: just this line :full_moon_with_face: Remaining matches are type annotations in modelchain.py and pvsystem.py --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index beec6dd0b2..c37ffc4045 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1086,7 +1086,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, * 'capecanaveral1988' * 'albany1988' - return_components: bool (optional, default=False) + return_components : bool (optional, default=False) Flag used to decide whether to return the calculated diffuse components or not. From 9c5f6b29a9964586edec3f42701f3f9c7fed3a0d Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 6 Aug 2023 18:48:39 +0200 Subject: [PATCH 03/27] Remove parenthesis in types F: (?\s{8}|\s{4})(?\w*)\s?: (?.*) \(optional, default=(?.*)\)$ R: --- pvlib/irradiance.py | 6 +++--- pvlib/pvsystem.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index c37ffc4045..423952e589 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1068,7 +1068,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: @@ -1086,7 +1086,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. @@ -2578,7 +2578,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, diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 4fb0dc5772..2e4c740f8c 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -1525,10 +1525,10 @@ def calcparams_desoto(effective_irradiance, temp_cell, the SAM CEC module database, dEgdT=-0.0002677 is implicit for all cell types in the parameter estimation algorithm used by NREL. - irrad_ref : float (optional, default=1000) + irrad_ref : float, default 1000 Reference irradiance in W/m^2. - temp_ref : float (optional, default=25) + temp_ref : float, default 25 Reference cell temperature in C. Returns @@ -1741,10 +1741,10 @@ def calcparams_cec(effective_irradiance, temp_cell, the SAM CEC module database, dEgdT=-0.0002677 is implicit for all cell types in the parameter estimation algorithm used by NREL. - irrad_ref : float (optional, default=1000) + irrad_ref : float, default 1000 Reference irradiance in W/m^2. - temp_ref : float (optional, default=25) + temp_ref : float, default 25 Reference cell temperature in C. Returns @@ -1858,10 +1858,10 @@ def calcparams_pvsyst(effective_irradiance, temp_cell, The energy bandgap at reference temperature in units of eV. 1.121 eV for crystalline silicon. EgRef must be >0. - irrad_ref : float (optional, default=1000) + irrad_ref : float, default 1000 Reference irradiance in W/m^2. - temp_ref : float (optional, default=25) + temp_ref : float, default 25 Reference cell temperature in C. Returns From 059f32cb55cb2a7c57dcec031562d5488c0069aa Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 6 Aug 2023 18:53:32 +0200 Subject: [PATCH 04/27] Remove none in type definition #1574 1st-F: (? {8}| {4})(?\w*) : (?.*), default None$ 2nd-F: (? {8}| {4})(?\w*) : [Nn}one or (?.*), optional$ 3rd-F: (? {8}| {4})(?\w*) : (?.*) or [nN]one, optional$ R: $1$2 : $3, optional --- pvlib/clearsky.py | 2 +- pvlib/iam.py | 2 +- pvlib/iotools/epw.py | 4 ++-- pvlib/iotools/pvgis.py | 10 +++++----- pvlib/iotools/tmy.py | 4 ++-- pvlib/irradiance.py | 28 +++++++++++++-------------- pvlib/ivtools/sde.py | 6 +++--- pvlib/ivtools/sdm.py | 2 +- pvlib/ivtools/utils.py | 2 +- pvlib/location.py | 14 +++++++------- pvlib/modelchain.py | 24 +++++++++++------------ pvlib/pvsystem.py | 44 +++++++++++++++++++++--------------------- pvlib/scaling.py | 4 ++-- pvlib/soiling.py | 2 +- pvlib/solarposition.py | 6 +++--- 15 files changed, 77 insertions(+), 77 deletions(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 62318942da..1759673dc3 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -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 diff --git a/pvlib/iam.py b/pvlib/iam.py index ca8f89468e..0068674d41 100644 --- a/pvlib/iam.py +++ b/pvlib/iam.py @@ -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 diff --git a/pvlib/iotools/epw.py b/pvlib/iotools/epw.py index 249dd76056..a777b69911 100644 --- a/pvlib/iotools/epw.py +++ b/pvlib/iotools/epw.py @@ -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. @@ -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. diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index ca1371d4a1..349da90f9f 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -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 @@ -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 @@ -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 diff --git a/pvlib/iotools/tmy.py b/pvlib/iotools/tmy.py index 90358ed105..d54f96a86c 100644 --- a/pvlib/iotools/tmy.py +++ b/pvlib/iotools/tmy.py @@ -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) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 423952e589..48a9abb9e2 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -340,13 +340,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' @@ -417,9 +417,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'``, @@ -564,7 +564,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'. @@ -777,17 +777,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``. @@ -1541,7 +1541,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 @@ -1790,7 +1790,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 @@ -1898,7 +1898,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 @@ -2285,7 +2285,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 @@ -3098,7 +3098,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 diff --git a/pvlib/ivtools/sde.py b/pvlib/ivtools/sde.py index 786a777210..236e91e390 100644 --- a/pvlib/ivtools/sde.py +++ b/pvlib/ivtools/sde.py @@ -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] diff --git a/pvlib/ivtools/sdm.py b/pvlib/ivtools/sdm.py index a695e740e7..0eb492e968 100644 --- a/pvlib/ivtools/sdm.py +++ b/pvlib/ivtools/sdm.py @@ -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 diff --git a/pvlib/ivtools/utils.py b/pvlib/ivtools/utils.py index bdbc42da6c..8f97b0ecb1 100644 --- a/pvlib/ivtools/utils.py +++ b/pvlib/ivtools/utils.py @@ -136,7 +136,7 @@ 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. diff --git a/pvlib/location.py b/pvlib/location.py index 50f98d375d..fd7caf6bdf 100644 --- a/pvlib/location.py +++ b/pvlib/location.py @@ -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 @@ -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 @@ -173,7 +173,7 @@ 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 + pressure : None, float, or array-like, optional If None, pressure will be calculated using :py:func:`pvlib.atmosphere.alt2pres` and ``self.altitude``. temperature : None, float, or array-like, default 12 @@ -209,10 +209,10 @@ 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 + dni_extra : numeric, optional If None, will be calculated from times. kwargs @@ -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 with columns 'apparent_zenith', 'zenith'. model : str, default 'kastenyoung1989' Relative airmass model. See diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 3d2404689f..f9e9d356f5 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -121,11 +121,11 @@ def basic_chain(times, latitude, longitude, Inverter parameters as defined by the CEC. See :py:func:`inverter.sandia` for details. - irradiance : None or DataFrame, default None + irradiance : DataFrame, optional If None, calculates clear sky data. Columns must be 'dni', 'ghi', 'dhi'. - weather : None or DataFrame, default None + weather : DataFrame, optional If None, assumes air temperature is 20 C and wind speed is 0 m/s. Columns must be 'wind_speed', 'temp_air'. @@ -139,11 +139,11 @@ def basic_chain(times, latitude, longitude, airmass_model : str, default 'kastenyoung1989' Passed to atmosphere.relativeairmass. - altitude : None or float, default None + altitude : float, optional If None, computed from pressure. Assumed to be 0 m if pressure is also None. - pressure : None or float, default None + pressure : float, optional If None, computed from altitude. Assumed to be 101325 Pa if altitude is also None. @@ -472,35 +472,35 @@ class ModelChain: airmass_model : str, default 'kastenyoung1989' Passed to location.get_airmass. - dc_model: None, str, or function, default None + dc_model : None, str, or function, optional If None, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'sapm', 'desoto', 'cec', 'pvsyst', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. - ac_model: None, str, or function, default None + ac_model : None, str, or function, optional If None, the model will be inferred from the parameters that are common to all of system.inverter_parameters. Valid strings are 'sandia', 'adr', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. - aoi_model: None, str, or function, default None + aoi_model : None, str, or function, optional If None, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'physical', 'ashrae', 'sapm', 'martin_ruiz', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - spectral_model: None, str, or function, default None + spectral_model : None, str, or function, optional If None, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'sapm', 'first_solar', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - temperature_model: None, str or function, default None + temperature_model : None, str or function, optional Valid strings are: 'sapm', 'pvsyst', 'faiman', 'fuentes', 'noct_sam'. The ModelChain instance will be passed as the first argument to a user-defined function. @@ -514,7 +514,7 @@ class ModelChain: Valid strings are 'pvwatts', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - name: None or str, default None + name : str, optional Name of ModelChain instance. """ @@ -575,7 +575,7 @@ def with_pvwatts(cls, system, location, airmass_model : str, default 'kastenyoung1989' Passed to location.get_airmass. - name: None or str, default None + name : str, optional Name of ModelChain instance. **kwargs @@ -651,7 +651,7 @@ def with_sapm(cls, system, location, airmass_model : str, default 'kastenyoung1989' Passed to location.get_airmass. - name: None or str, default None + name : str, optional Name of ModelChain instance. **kwargs diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 2e4c740f8c..6d8c671dc0 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -127,17 +127,17 @@ class PVSystem: Azimuth angle of the module surface. North=0, East=90, South=180, West=270. - albedo : None or float, default None + albedo : float, optional Ground surface albedo. If ``None``, then ``surface_type`` is used to look up a value in ``irradiance.SURFACE_ALBEDOS``. If ``surface_type`` is also None then a ground surface albedo of 0.25 is used. - surface_type : None or string, default None + surface_type : string, optional The ground surface type. See ``irradiance.SURFACE_ALBEDOS`` for valid values. - module : None or string, default None + module : string, optional The model name of the modules. May be used to look up the module_parameters dictionary via some other method. @@ -146,7 +146,7 @@ class PVSystem: Describes the module's construction. Valid strings are 'glass_polymer' and 'glass_glass'. Used for cell and module temperature calculations. - module_parameters : None, dict or Series, default None + module_parameters : None, dict or Series, optional Module parameters as defined by the SAPM, CEC, or other. temperature_model_parameters : None, dict or Series, default None. @@ -159,22 +159,22 @@ class PVSystem: strings_per_inverter: int or float, default 1 See system topology discussion above. - inverter : None or string, default None + inverter : string, optional The model name of the inverters. May be used to look up the inverter_parameters dictionary via some other method. - inverter_parameters : None, dict or Series, default None + inverter_parameters : None, dict or Series, optional Inverter parameters as defined by the SAPM, CEC, or other. racking_model : None or string, default 'open_rack' Valid strings are 'open_rack', 'close_mount', and 'insulated_back'. Used to identify a parameter set for the SAPM cell temperature model. - losses_parameters : None, dict or Series, default None + losses_parameters : None, dict or Series, optional Losses parameters as defined by PVWatts or other. - name : None or string, default None + name : string, optional **kwargs Arbitrary keyword arguments. @@ -327,9 +327,9 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi, dni_extra : None, float, Series or tuple of float or Series,\ default None Extraterrestrial direct normal irradiance. [W/m2] - airmass : None, float or Series, default None + airmass : None, float or Series, optional Airmass. [unitless] - albedo : None, float or Series, default None + albedo : None, float or Series, optional Ground surface albedo. [unitless] model : String, default 'haydavies' Irradiance model. @@ -902,26 +902,26 @@ class Array: single axis tracker. Mounting is used to determine module orientation. If not provided, a FixedMount with zero tilt is used. - albedo : None or float, default None + albedo : float, optional Ground surface albedo. If ``None``, then ``surface_type`` is used to look up a value in ``irradiance.SURFACE_ALBEDOS``. If ``surface_type`` is also None then a ground surface albedo of 0.25 is used. - surface_type : None or string, default None + surface_type : string, optional The ground surface type. See ``irradiance.SURFACE_ALBEDOS`` for valid values. - module : None or string, default None + module : string, optional The model name of the modules. May be used to look up the module_parameters dictionary via some other method. - module_type : None or string, default None + module_type : string, optional Describes the module's construction. Valid strings are 'glass_polymer' and 'glass_glass'. Used for cell and module temperature calculations. - module_parameters : None, dict or Series, default None + module_parameters : None, dict or Series, optional Parameters for the module model, e.g., SAPM, CEC, or other. temperature_model_parameters : None, dict or Series, default None. @@ -937,7 +937,7 @@ class Array: array_losses_parameters: None, dict or Series, default None. Supported keys are 'dc_ohmic_percent'. - name: None or str, default None + name : str, optional Name of Array instance. """ @@ -1091,11 +1091,11 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi, Global horizontal irradiance dhi : float or Series Diffuse horizontal irradiance. [W/m2] - dni_extra : None, float or Series, default None + dni_extra : None, float or Series, optional Extraterrestrial direct normal irradiance. [W/m2] - airmass : None, float or Series, default None + airmass : None, float or Series, optional Airmass. [unitless] - albedo : None, float or Series, default None + albedo : None, float or Series, optional Ground surface albedo. [unitless] model : String, default 'haydavies' Irradiance model. @@ -1963,7 +1963,7 @@ def retrieve_sam(name=None, path=None): Parameters ---------- - name : None or string, default None + name : string, optional Name can be one of: * 'CECMod' - returns the CEC module database @@ -1974,7 +1974,7 @@ def retrieve_sam(name=None, path=None): * 'SandiaMod' - returns the Sandia Module database * 'ADRInverter' - returns the ADR Inverter database - path : None or string, default None + path : string, optional Path to the SAM file. May also be a URL. Returns @@ -2382,7 +2382,7 @@ def singlediode(photocurrent, saturation_current, resistance_series, junction in Kelvin, and :math:`q` is the charge of an electron (coulombs). ``0 < nNsVth``. [V] - ivcurve_pnts : None or int, default None + ivcurve_pnts : int, optional Number of points in the desired IV curve. If None or 0, no points on the IV curves will be produced. diff --git a/pvlib/scaling.py b/pvlib/scaling.py index dca2ca4935..7fbc0a46d1 100644 --- a/pvlib/scaling.py +++ b/pvlib/scaling.py @@ -30,7 +30,7 @@ def wvm(clearsky_index, positions, cloud_speed, dt=None): cloud_speed : numeric Speed of cloud movement in meters per second [m/s]. - dt : float, default None + dt : float, optional The time series time delta. By default, is inferred from the clearsky_index. Must be specified for a time series that doesn't include an index. Units of seconds [s]. @@ -216,7 +216,7 @@ def _compute_wavelet(clearsky_index, dt=None): clearsky_index : numeric or pandas.Series Clear Sky Index time series that will be smoothed. - dt : float, default None + dt : float, optional The time series time delta. By default, is inferred from the clearsky_index. Must be specified for a time series that doesn't include an index. Units of seconds [s]. diff --git a/pvlib/soiling.py b/pvlib/soiling.py index bbad4862f4..79db3afe37 100644 --- a/pvlib/soiling.py +++ b/pvlib/soiling.py @@ -128,7 +128,7 @@ def kimber(rainfall, cleaning_threshold=6, soiling_loss_rate=0.0015, max_soiling : float, default 0.3 Maximum fraction of energy lost due to soiling. Soiling will build up until this value. [unitless] - manual_wash_dates : sequence or None, default None + manual_wash_dates : sequence, optional List or tuple of dates as Python ``datetime.date`` when the panels were washed manually. Note there is no grace period after a manual wash, so soiling begins to build up immediately. diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index cdcacd7ec6..6bdd89eb03 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -51,11 +51,11 @@ def get_solarposition(time, latitude, longitude, Longitude in decimal degrees. Positive east of prime meridian, negative to west. - altitude : None or float, default None + altitude : float, optional If None, computed from pressure. Assumed to be 0 m if pressure is also None. - pressure : None or float, default None + pressure : float, optional If None, computed from altitude. Assumed to be 101325 Pa if altitude is also None. @@ -312,7 +312,7 @@ def spa_python(time, latitude, longitude, *Note: delta_t = None will break code using nrel_numba, this will be fixed in a future version.* The USNO has historical and forecasted delta_t [3]_. - atmos_refrac : None or float, optional, default None + atmos_refrac : float, optional, optional The approximate atmospheric refraction (in degrees) at sunrise and sunset. how : str, optional, default 'numpy' From 96a4f58f80baa499460ebf59e41a89270df35473 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 6 Aug 2023 18:58:00 +0200 Subject: [PATCH 05/27] Change if none ocurrences (I) F: If None, R: If not specified, --- pvlib/iotools/sodapro.py | 2 +- pvlib/irradiance.py | 2 +- pvlib/ivtools/utils.py | 2 +- pvlib/location.py | 4 ++-- pvlib/modelchain.py | 16 ++++++++-------- pvlib/solarposition.py | 4 ++-- pvlib/temperature.py | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pvlib/iotools/sodapro.py b/pvlib/iotools/sodapro.py index 95d6ffd866..1faa7c817c 100644 --- a/pvlib/iotools/sodapro.py +++ b/pvlib/iotools/sodapro.py @@ -75,7 +75,7 @@ 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 + 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, diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 48a9abb9e2..a7a4758ffb 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1386,7 +1386,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 diff --git a/pvlib/ivtools/utils.py b/pvlib/ivtools/utils.py index 8f97b0ecb1..e7827d8d9a 100644 --- a/pvlib/ivtools/utils.py +++ b/pvlib/ivtools/utils.py @@ -138,7 +138,7 @@ def rectify_iv_curve(voltage, current, decimals=None): current : numeric [A] 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 ------- diff --git a/pvlib/location.py b/pvlib/location.py index fd7caf6bdf..b1e65028cb 100644 --- a/pvlib/location.py +++ b/pvlib/location.py @@ -174,7 +174,7 @@ 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, optional - If None, pressure will be calculated using + If not specified, pressure will be calculated using :py:func:`pvlib.atmosphere.alt2pres` and ``self.altitude``. temperature : None, float, or array-like, default 12 @@ -213,7 +213,7 @@ def get_clearsky(self, times, model='ineichen', solar_position=None, DataFrame with columns 'apparent_zenith', 'zenith', 'apparent_elevation'. dni_extra : numeric, optional - If None, will be calculated from times. + If not specified, will be calculated from times. kwargs Extra parameters passed to the relevant functions. Climatological diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index f9e9d356f5..e9dc3f4f0b 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -122,11 +122,11 @@ def basic_chain(times, latitude, longitude, :py:func:`inverter.sandia` for details. irradiance : DataFrame, optional - If None, calculates clear sky data. + If not specified, calculates clear sky data. Columns must be 'dni', 'ghi', 'dhi'. weather : DataFrame, optional - If None, assumes air temperature is 20 C and + If not specified, assumes air temperature is 20 C and wind speed is 0 m/s. Columns must be 'wind_speed', 'temp_air'. @@ -140,11 +140,11 @@ def basic_chain(times, latitude, longitude, Passed to atmosphere.relativeairmass. altitude : float, optional - If None, computed from pressure. Assumed to be 0 m + If not specified, computed from pressure. Assumed to be 0 m if pressure is also None. pressure : float, optional - If None, computed from altitude. Assumed to be 101325 Pa + If not specified, computed from altitude. Assumed to be 101325 Pa if altitude is also None. **kwargs @@ -473,28 +473,28 @@ class ModelChain: Passed to location.get_airmass. dc_model : None, str, or function, optional - If None, the model will be inferred from the parameters that + If not specified, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'sapm', 'desoto', 'cec', 'pvsyst', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. ac_model : None, str, or function, optional - If None, the model will be inferred from the parameters that + If not specified, the model will be inferred from the parameters that are common to all of system.inverter_parameters. Valid strings are 'sandia', 'adr', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. aoi_model : None, str, or function, optional - If None, the model will be inferred from the parameters that + If not specified, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'physical', 'ashrae', 'sapm', 'martin_ruiz', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. spectral_model : None, str, or function, optional - If None, the model will be inferred from the parameters that + If not specified, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'sapm', 'first_solar', 'no_loss'. The ModelChain instance will be passed as the first argument to diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 6bdd89eb03..142fdd01ec 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -52,11 +52,11 @@ def get_solarposition(time, latitude, longitude, negative to west. altitude : float, optional - If None, computed from pressure. Assumed to be 0 m + If not specified, computed from pressure. Assumed to be 0 m if pressure is also None. pressure : float, optional - If None, computed from altitude. Assumed to be 101325 Pa + If not specified, computed from altitude. Assumed to be 101325 Pa if altitude is also None. method : string, default 'nrel_numpy' diff --git a/pvlib/temperature.py b/pvlib/temperature.py index 70692d2cd2..d58a78bf02 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -873,7 +873,7 @@ def noct_sam(poa_global, temp_air, wind_speed, noct, module_efficiency, where A is module area [m^2]. effective_irradiance : numeric, default None. - The irradiance that is converted to photocurrent. If None, + The irradiance that is converted to photocurrent. If not specified, assumed equal to poa_global. [W/m^2] transmittance_absorptance : numeric, default 0.9 From a89addbbcb3fe1b0663ddbe1a9c5e71a1ffb436d Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 6 Aug 2023 18:59:31 +0200 Subject: [PATCH 06/27] Change if none ocurrences (II) F: If None R: If not specified, --- pvlib/clearsky.py | 2 +- pvlib/pvsystem.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 1759673dc3..571a27da50 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -704,7 +704,7 @@ 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 + 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 diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 6d8c671dc0..8afae5ea3f 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -2383,8 +2383,8 @@ def singlediode(photocurrent, saturation_current, resistance_series, (coulombs). ``0 < nNsVth``. [V] ivcurve_pnts : int, optional - Number of points in the desired IV curve. If None or 0, no points on - the IV curves will be produced. + Number of points in the desired IV curve. If not specified or 0, no + points on the IV curves will be produced. .. deprecated:: 0.10.0 Use :py:func:`pvlib.pvsystem.v_from_i` and From e931a5dce4eebbcbc7a64fdce524bd060b71ab28 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 6 Aug 2023 19:07:06 +0200 Subject: [PATCH 07/27] Too long line --- pvlib/clearsky.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 571a27da50..8d67e3a3e6 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -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 not specified, 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]_. From e9495e050c70b556661267d04216680def79d51b Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 6 Aug 2023 19:08:58 +0200 Subject: [PATCH 08/27] Too long line --- pvlib/iotools/sodapro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/iotools/sodapro.py b/pvlib/iotools/sodapro.py index 1faa7c817c..9b9b4101ba 100644 --- a/pvlib/iotools/sodapro.py +++ b/pvlib/iotools/sodapro.py @@ -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 not specified, 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. From 469edc23cf6e8e08897505819324a917d3fc4925 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sat, 28 Oct 2023 21:04:33 +0200 Subject: [PATCH 09/27] fix doi external links Regex find: (?:doi|DOI):(?!`)\s?(.*?)(\.\n|\n) Replace: :doi:`$1`$2 --- pvlib/bifacial/utils.py | 2 +- pvlib/iam.py | 6 +++--- pvlib/ivtools/utils.py | 2 +- pvlib/shading.py | 6 +++--- pvlib/soiling.py | 2 +- pvlib/spectrum/spectrl2.py | 2 +- pvlib/temperature.py | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pvlib/bifacial/utils.py b/pvlib/bifacial/utils.py index 8d7f5d5a71..9e6e0bcd60 100644 --- a/pvlib/bifacial/utils.py +++ b/pvlib/bifacial/utils.py @@ -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) diff --git a/pvlib/iam.py b/pvlib/iam.py index 0068674d41..d4625b4656 100644 --- a/pvlib/iam.py +++ b/pvlib/iam.py @@ -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 -------- @@ -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 -------- @@ -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 -------- diff --git a/pvlib/ivtools/utils.py b/pvlib/ivtools/utils.py index e7827d8d9a..cde50655dc 100644 --- a/pvlib/ivtools/utils.py +++ b/pvlib/ivtools/utils.py @@ -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 """ diff --git a/pvlib/shading.py b/pvlib/shading.py index 1533d2a013..c0a7a91f18 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -85,7 +85,7 @@ def masking_angle(surface_tilt, gcr, slant_height): ---------- .. [1] D. Passias and B. Källbäck, "Shading effects in rows of solar cell panels", Solar Cells, Volume 11, Pages 281-291. 1984. - DOI: 10.1016/0379-6787(84)90017-6 + :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical Reference Update", NREL Technical Report NREL/TP-6A20-67399. Available at https://www.nrel.gov/docs/fy18osti/67399.pdf @@ -167,7 +167,7 @@ def masking_angle_passias(surface_tilt, gcr): ---------- .. [1] D. Passias and B. Källbäck, "Shading effects in rows of solar cell panels", Solar Cells, Volume 11, Pages 281-291. 1984. - DOI: 10.1016/0379-6787(84)90017-6 + :doi:`10.1016/0379-6787(84)90017-6` """ # wrap it in an array so that division by zero is handled well beta = np.radians(np.array(surface_tilt)) @@ -226,7 +226,7 @@ def sky_diffuse_passias(masking_angle): ---------- .. [1] D. Passias and B. Källbäck, "Shading effects in rows of solar cell panels", Solar Cells, Volume 11, Pages 281-291. 1984. - DOI: 10.1016/0379-6787(84)90017-6 + :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical Reference Update", NREL Technical Report NREL/TP-6A20-67399. Available at https://www.nrel.gov/docs/fy18osti/67399.pdf diff --git a/pvlib/soiling.py b/pvlib/soiling.py index 79db3afe37..bcdaf97b58 100644 --- a/pvlib/soiling.py +++ b/pvlib/soiling.py @@ -58,7 +58,7 @@ def hsu(rainfall, cleaning_threshold, surface_tilt, pm2_5, pm10, ----------- .. [1] M. Coello and L. Boyle, "Simple Model For Predicting Time Series Soiling of Photovoltaic Panels," in IEEE Journal of Photovoltaics. - doi: 10.1109/JPHOTOV.2019.2919628 + :doi:`10.1109/JPHOTOV.2019.2919628` .. [2] Atmospheric Chemistry and Physics: From Air Pollution to Climate Change. J. Seinfeld and S. Pandis. Wiley and Sons 2001. diff --git a/pvlib/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py index f679825014..1c1f102fec 100644 --- a/pvlib/spectrum/spectrl2.py +++ b/pvlib/spectrum/spectrl2.py @@ -270,7 +270,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, .. [1] Bird, R, and Riordan, C., 1984, "Simple solar spectral model for direct and diffuse irradiance on horizontal and tilted planes at the earth's surface for cloudless atmospheres", NREL Technical Report - TR-215-2436 doi:10.2172/5986936. + TR-215-2436 :doi:`10.2172/5986936`. .. [2] Bird Simple Spectral Model: spectrl2_2.c. https://www.nrel.gov/grid/solar-resource/spectral.html """ diff --git a/pvlib/temperature.py b/pvlib/temperature.py index d58a78bf02..a9f7e81b03 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -721,7 +721,7 @@ def fuentes(poa_global, temp_air, wind_speed, noct_installed, module_height=5, http://prod.sandia.gov/techlib/access-control.cgi/1985/850330.pdf .. [2] Dobos, A. P., 2014, "PVWatts Version 5 Manual", NREL/TP-6A20-62641, National Renewable Energy Laboratory, Golden CO. - doi:10.2172/1158421. + :doi:`10.2172/1158421`. """ # ported from the FORTRAN77 code provided in Appendix A of Fuentes 1987; # nearly all variable names are kept the same for ease of comparison. From 1bc3b124f9b57c018c1f2b3d84c6042ab0493e25 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:27:11 +0100 Subject: [PATCH 10/27] Apply cwhanse suggestion Co-authored-by: Cliff Hansen --- pvlib/clearsky.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 8d67e3a3e6..f168f6a696 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -705,7 +705,7 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False, Time series of the expected clearsky GHI. [W/m2] times : DatetimeIndex or None, default None. Times of measured and clearsky values. If not specified, the index of - measured will be used. + ``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]_. From 57f67bb24cc2ca65a28db6a9ecc1fa950ab9ae6e Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:27:47 +0100 Subject: [PATCH 11/27] Apply cwhanse suggestion Co-authored-by: Cliff Hansen --- pvlib/iotools/pvgis.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index b578811989..f97174c6b9 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -410,10 +410,9 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True, usehorizon : bool, default True include effects of horizon 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]_ + 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, optional From 8794a2e43eba9ab9f3943de1e8dc86d9ea273e43 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:28:07 +0100 Subject: [PATCH 12/27] Apply cwhanse suggestion Co-authored-by: Cliff Hansen --- pvlib/iotools/tmy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/iotools/tmy.py b/pvlib/iotools/tmy.py index d54f96a86c..fde96ee679 100644 --- a/pvlib/iotools/tmy.py +++ b/pvlib/iotools/tmy.py @@ -41,7 +41,7 @@ def read_tmy3(filename, coerce_year=None, map_variables=None, recolumn=None, filename : str A relative file path or absolute file path. coerce_year : int, optional - If supplied, the year of the index will be set to `coerce_year`, except + 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, optional From 2378db1334eaeaed111ee1bc624b19b0bf076c56 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:28:59 +0100 Subject: [PATCH 13/27] Apply cwhanse suggestion Co-authored-by: Cliff Hansen --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index c6f88ad62c..8e3405e85c 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -575,7 +575,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): overridden if surface_type is supplied. surface_type : string, optional - If not None, overrides albedo. String can be one of 'urban', + If supplied, overrides ``albedo``. String can be one of 'urban', 'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', 'concrete', 'aluminum', 'copper', 'fresh steel', 'dirty steel', 'sea'. From 6171e77f3831fe0184e375ee45188ebf644018dd Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:34:14 +0100 Subject: [PATCH 14/27] Modified cwhanse suggestion Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> --- pvlib/modelchain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index ee5da9dc7c..56ca8684c5 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -140,11 +140,11 @@ def basic_chain(times, latitude, longitude, altitude : float, optional If not specified, computed from pressure. Assumed to be 0 m - if pressure is also None. + if ``pressure`` is also unspecified. pressure : float, optional If not specified, computed from altitude. Assumed to be 101325 Pa - if altitude is also None. + if ``altitude`` is also unspecified. **kwargs Arbitrary keyword arguments. From c75a662d93ae84e3c4682ce50c71cf7185aacb45 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:36:03 +0100 Subject: [PATCH 15/27] Update modelchain.py Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> --- pvlib/modelchain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 56ca8684c5..e28933d16a 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -139,11 +139,11 @@ def basic_chain(times, latitude, longitude, Passed to atmosphere.relativeairmass. altitude : float, optional - If not specified, computed from pressure. Assumed to be 0 m + If not specified, computed from ``pressure``. Assumed to be 0 m if ``pressure`` is also unspecified. pressure : float, optional - If not specified, computed from altitude. Assumed to be 101325 Pa + If not specified, computed from ``altitude``. Assumed to be 101325 Pa if ``altitude`` is also unspecified. **kwargs From 9c52070857dc436f12b8c858416a824e0ca9c6ac Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:43:34 +0100 Subject: [PATCH 16/27] Some None's missed F: (? {8}| {4})(?\w*) : [Nn]one[ ,]*(?.*), optional$ R: $1$2 : $3, optional Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> --- pvlib/irradiance.py | 6 +++--- pvlib/location.py | 2 +- pvlib/modelchain.py | 10 +++++----- pvlib/pvsystem.py | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 8e3405e85c..836757fada 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -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, optional + temp_dew : 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 @@ -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, optional + temp_dew : 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 @@ -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, optional + temp_dew : 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 diff --git a/pvlib/location.py b/pvlib/location.py index 5677ec4ceb..c0d5419de5 100644 --- a/pvlib/location.py +++ b/pvlib/location.py @@ -173,7 +173,7 @@ 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, optional + pressure : 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 diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index e28933d16a..fc7094779b 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -471,35 +471,35 @@ class ModelChain: airmass_model : str, default 'kastenyoung1989' Passed to location.get_airmass. - dc_model : None, str, or function, optional + dc_model : str, or function, optional If not specified, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'sapm', 'desoto', 'cec', 'pvsyst', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. - ac_model : None, str, or function, optional + ac_model : str, or function, optional If not specified, the model will be inferred from the parameters that are common to all of system.inverter_parameters. Valid strings are 'sandia', 'adr', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. - aoi_model : None, str, or function, optional + aoi_model : str, or function, optional If not specified, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'physical', 'ashrae', 'sapm', 'martin_ruiz', 'interp' and 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - spectral_model : None, str, or function, optional + spectral_model : str, or function, optional If not specified, the model will be inferred from the parameters that are common to all of system.arrays[i].module_parameters. Valid strings are 'sapm', 'first_solar', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - temperature_model : None, str or function, optional + temperature_model : str or function, optional Valid strings are: 'sapm', 'pvsyst', 'faiman', 'fuentes', 'noct_sam'. The ModelChain instance will be passed as the first argument to a user-defined function. diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 2625b34812..075081bcc4 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -148,7 +148,7 @@ class PVSystem: Describes the module's construction. Valid strings are 'glass_polymer' and 'glass_glass'. Used for cell and module temperature calculations. - module_parameters : None, dict or Series, optional + module_parameters : dict or Series, optional Module parameters as defined by the SAPM, CEC, or other. temperature_model_parameters : None, dict or Series, default None. @@ -166,14 +166,14 @@ class PVSystem: May be used to look up the inverter_parameters dictionary via some other method. - inverter_parameters : None, dict or Series, optional + inverter_parameters : dict or Series, optional Inverter parameters as defined by the SAPM, CEC, or other. racking_model : None or string, default 'open_rack' Valid strings are 'open_rack', 'close_mount', and 'insulated_back'. Used to identify a parameter set for the SAPM cell temperature model. - losses_parameters : None, dict or Series, optional + losses_parameters : dict or Series, optional Losses parameters as defined by PVWatts or other. name : string, optional @@ -331,9 +331,9 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi, dni_extra : None, float, Series or tuple of float or Series,\ default None Extraterrestrial direct normal irradiance. [W/m2] - airmass : None, float or Series, optional + airmass : float or Series, optional Airmass. [unitless] - albedo : None, float or Series, optional + albedo : float or Series, optional Ground surface albedo. [unitless] model : String, default 'haydavies' Irradiance model. @@ -925,7 +925,7 @@ class Array: Describes the module's construction. Valid strings are 'glass_polymer' and 'glass_glass'. Used for cell and module temperature calculations. - module_parameters : None, dict or Series, optional + module_parameters : dict or Series, optional Parameters for the module model, e.g., SAPM, CEC, or other. temperature_model_parameters : None, dict or Series, default None. @@ -1095,11 +1095,11 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi, Global horizontal irradiance dhi : float or Series Diffuse horizontal irradiance. [W/m2] - dni_extra : None, float or Series, optional + dni_extra : float or Series, optional Extraterrestrial direct normal irradiance. [W/m2] - airmass : None, float or Series, optional + airmass : float or Series, optional Airmass. [unitless] - albedo : None, float or Series, optional + albedo : float or Series, optional Ground surface albedo. [unitless] model : String, default 'haydavies' Irradiance model. From 232156c3672b51ebbe4df15c566b78dee900a7fd Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:00:55 +0100 Subject: [PATCH 17/27] ``none``'s, some more ``'s to variables and some other nones Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> --- pvlib/iam.py | 4 ++-- pvlib/iotools/pvgis.py | 14 +++++++------- pvlib/irradiance.py | 2 +- pvlib/pvsystem.py | 8 ++++---- pvlib/solarposition.py | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pvlib/iam.py b/pvlib/iam.py index e21c1fad68..b994c0a362 100644 --- a/pvlib/iam.py +++ b/pvlib/iam.py @@ -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. A typical value for the effective index of an AR coating is 1.29. Returns @@ -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 diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index f97174c6b9..cb86073d37 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -90,7 +90,7 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None, 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 + 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. @@ -312,7 +312,7 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True): 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 + ``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 @@ -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 -------- @@ -575,7 +575,7 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=True): 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 + ``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 @@ -599,11 +599,11 @@ def read_pvgis_tmy(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``, ``.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 -------- diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 836757fada..743c4b5fdb 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -441,7 +441,7 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, ------ ValueError If model is one of ``'haydavies'``, ``'reindl'``, or ``'perez'`` and - ``dni_extra`` is ``None``. + ``dni_extra`` is not specified. Notes ----- diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 075081bcc4..0d5fb23bc8 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -130,9 +130,9 @@ class PVSystem: North=0, East=90, South=180, West=270. albedo : float, optional - Ground surface albedo. If ``None``, then ``surface_type`` is used + Ground surface albedo. If not supplied, then ``surface_type`` is used to look up a value in ``irradiance.SURFACE_ALBEDOS``. - If ``surface_type`` is also None then a ground surface albedo + If ``surface_type`` is also not supplied then a ground surface albedo of 0.25 is used. surface_type : string, optional @@ -907,9 +907,9 @@ class Array: If not provided, a FixedMount with zero tilt is used. albedo : float, optional - Ground surface albedo. If ``None``, then ``surface_type`` is used + Ground surface albedo. If not supplied, then ``surface_type`` is used to look up a value in ``irradiance.SURFACE_ALBEDOS``. - If ``surface_type`` is also None then a ground surface albedo + If ``surface_type`` is also not supplied then a ground surface albedo of 0.25 is used. surface_type : string, optional diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 142fdd01ec..e5fbd442cd 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -52,12 +52,12 @@ def get_solarposition(time, latitude, longitude, negative to west. altitude : float, optional - If not specified, computed from pressure. Assumed to be 0 m - if pressure is also None. + If not specified, computed from ``pressure``. Assumed to be 0 m + if ``pressure`` is not supplied. pressure : float, optional - If not specified, computed from altitude. Assumed to be 101325 Pa - if altitude is also None. + If not specified, computed from ``altitude``. Assumed to be 101325 Pa + if ``altitude`` is not supplied. method : string, default 'nrel_numpy' 'nrel_numpy' uses an implementation of the NREL SPA algorithm From b8f942bb4396829986158d3995277c42f418e478 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:03:18 +0100 Subject: [PATCH 18/27] Special ``none`` cases (please review) Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> --- pvlib/iotools/pvgis.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index cb86073d37..72c62c333b 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -430,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 inputs : dict - the inputs, ``None`` for basic and EPW + the inputs, do not specify for basic and EPW metadata : list or dict - file metadata, ``None`` for basic + file metadata, do not specify for basic Note ---- @@ -590,11 +590,11 @@ 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 inputs : dict - the inputs, ``None`` for basic and EPW + the inputs, do not specify for basic and EPW metadata : list or dict - file metadata, ``None`` for basic + file metadata, do not specify for basic Raises ------ From f7c6c7c68fa56269579214977470b571b24792be Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:05:29 +0100 Subject: [PATCH 19/27] Linter Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> --- pvlib/iotools/pvgis.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index 72c62c333b..467cea6964 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -312,9 +312,9 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True): 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 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']``. + ``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`. @@ -575,9 +575,10 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=True): 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 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'``. + ``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 From ec2b176189934b06e87f66bfe834bc852ee73651 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:13:50 +0100 Subject: [PATCH 20/27] Run more regexes F1: (? {8}| {4})(?\w*) ?: (?.*), default: None F2: (? {8}| {4})(?\w*) ?: (?.*), default None$ F3: (? {8}| {4})(?\w*) ?: [Nn]one or (?.*), optional$ zero results F4: (? {8}| {4})(?\w*) ?: (?.*) or [nN]one, optional$ zero results R: $1$2 : $3, optional --- pvlib/iotools/pvgis.py | 10 +++++----- pvlib/iotools/sodapro.py | 6 +++--- pvlib/irradiance.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index 467cea6964..3b137a8e9b 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -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). @@ -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 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. diff --git a/pvlib/iotools/sodapro.py b/pvlib/iotools/sodapro.py index 9b9b4101ba..a6c43ad341 100644 --- a/pvlib/iotools/sodapro.py +++ b/pvlib/iotools/sodapro.py @@ -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 @@ -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 @@ -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 diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 743c4b5fdb..ae10ef3b96 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -2529,11 +2529,11 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, Global horizontal irradiance in W/m^2. zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. - datetime_or_doy : int, float, array, pd.DatetimeIndex, default None + datetime_or_doy : int, float, array or pd.DatetimeIndex, optional Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. Either datetime_or_doy or dni_extra must be provided. - dni_extra : numeric, default None + dni_extra : numeric, optional Extraterrestrial normal irradiance. dni_extra can be provided if available to avoid recalculating it inside this function. In this case datetime_or_doy is not required. From daa5e6587ea6edc827d5975ed415962093c21300 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:03:09 +0100 Subject: [PATCH 21/27] More Nones F: (? {8}| {4})(?\w*) ?: (?.*), default:? None\.? R: $1$2 : $3, optional F: (? {8}| {4})(?\w*) ?: [Nn]one, (?.*), default:? (?.*)\.? R: $1$2 : $3, default $4 F: (? {8}| {4})(?\w*) ?: [Nn]one or (?.*) R: $1$2 : $3 F: (? {8}| {4})(?\w*) ?: (?.*) or [Nn]one(?.*) R: $1$2 : $3$4 F: (? {8}| {4})(?\w*) ?: [Nn]one(?:,|or) (?.*) R: $1$2 : $3 --- pvlib/clearsky.py | 2 +- pvlib/irradiance.py | 2 +- pvlib/location.py | 4 ++-- pvlib/modelchain.py | 6 +++--- pvlib/pvsystem.py | 13 ++++++------- pvlib/temperature.py | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index f168f6a696..ad779182eb 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -703,7 +703,7 @@ 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 : DatetimeIndex, optional Times of measured and clearsky values. If not specified, the index of ``measured`` will be used. infer_limits : bool, default False diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index ae10ef3b96..da427fa310 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1620,7 +1620,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. - pressure : None or numeric, default 101325 + pressure : numeric, default 101325 Site pressure in Pascal. If not specified, relative airmass is used instead of absolute (pressure-corrected) airmass. diff --git a/pvlib/location.py b/pvlib/location.py index c0d5419de5..131be4831b 100644 --- a/pvlib/location.py +++ b/pvlib/location.py @@ -47,7 +47,7 @@ class Location: altitude : float, default 0. Altitude from sea level in meters. - name : None or string, default None. + name : string, optional Sets the name attribute of the Location object. See also @@ -176,7 +176,7 @@ def get_solarposition(self, times, pressure=None, temperature=12, pressure : 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 + temperature : float or array-like, default 12 kwargs passed to :py:func:`pvlib.solarposition.get_solarposition` diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index fc7094779b..cc42d59077 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -108,15 +108,15 @@ def basic_chain(times, latitude, longitude, as degrees east of north (North=0, South=180, East=90, West=270). - module_parameters : None, dict or Series + module_parameters : dict or Series Module parameters as defined by the SAPM. See pvsystem.sapm for details. - temperature_model_parameters : None, dict or Series. + temperature_model_parameters : dict or Series Temperature model parameters as defined by the SAPM. See temperature.sapm_cell for details. - inverter_parameters : None, dict or Series + inverter_parameters : dict or Series Inverter parameters as defined by the CEC. See :py:func:`inverter.sandia` for details. diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 0d5fb23bc8..7b2f662b13 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -144,14 +144,14 @@ class PVSystem: May be used to look up the module_parameters dictionary via some other method. - module_type : None or string, default 'glass_polymer' + module_type : string, default 'glass_polymer' Describes the module's construction. Valid strings are 'glass_polymer' and 'glass_glass'. Used for cell and module temperature calculations. module_parameters : dict or Series, optional Module parameters as defined by the SAPM, CEC, or other. - temperature_model_parameters : None, dict or Series, default None. + temperature_model_parameters : dict or Series, optional Temperature model parameters as required by one of the models in pvlib.temperature (excluding poa_global, temp_air and wind_speed). @@ -169,7 +169,7 @@ class PVSystem: inverter_parameters : dict or Series, optional Inverter parameters as defined by the SAPM, CEC, or other. - racking_model : None or string, default 'open_rack' + racking_model : string, default 'open_rack' Valid strings are 'open_rack', 'close_mount', and 'insulated_back'. Used to identify a parameter set for the SAPM cell temperature model. @@ -328,8 +328,7 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi, Global horizontal irradiance. [W/m2] dhi : float or Series or tuple of float or Series Diffuse horizontal irradiance. [W/m2] - dni_extra : None, float, Series or tuple of float or Series,\ - default None + dni_extra : float, Series or tuple of float or Series, optional Extraterrestrial direct normal irradiance. [W/m2] airmass : float or Series, optional Airmass. [unitless] @@ -928,7 +927,7 @@ class Array: module_parameters : dict or Series, optional Parameters for the module model, e.g., SAPM, CEC, or other. - temperature_model_parameters : None, dict or Series, default None. + temperature_model_parameters : dict or Series, optional Parameters for the module temperature model, e.g., SAPM, Pvsyst, or other. @@ -938,7 +937,7 @@ class Array: strings: int, default 1 Number of parallel strings in the array. - array_losses_parameters: None, dict or Series, default None. + array_losses_parameters : dict or Series, optional Supported keys are 'dc_ohmic_percent'. name : str, optional diff --git a/pvlib/temperature.py b/pvlib/temperature.py index 9e38b85865..6901b4e5e0 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -872,7 +872,7 @@ def noct_sam(poa_global, temp_air, wind_speed, noct, module_efficiency, :math:`\eta_{m} = \frac{V_{mp} I_{mp}}{A \times 1000 W/m^2}` where A is module area [m^2]. - effective_irradiance : numeric, default None. + effective_irradiance : numeric, optional The irradiance that is converted to photocurrent. If not specified, assumed equal to poa_global. [W/m^2] From 8ddcd7e246e995bdf92562537641a8b8ffee703c Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:07:17 +0100 Subject: [PATCH 22/27] Update irradiance.py --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index da427fa310..d9e070ec64 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1341,7 +1341,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, and <=360. The azimuth convention is defined as degrees east of north (e.g. North = 0, East = 90, West = 270). - airmass : numeric (optional, default None) + airmass : numeric, optional Relative (not pressure-corrected) airmass values. If airmass is a DataFrame it must be of the same size as all other DataFrame inputs. The kastenyoung1989 airmass calculation is used internally From 1a391195025fd76798ac954767cedfa4d8f74f94 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:19:17 +0100 Subject: [PATCH 23/27] Revert "Special ``none`` cases (please review)" This reverts commit b8f942bb4396829986158d3995277c42f418e478. --- pvlib/iotools/pvgis.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index 3b137a8e9b..06986bf2e5 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -430,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, do not specify for basic and EPW + TMY year for each month, ``None`` for basic and EPW inputs : dict - the inputs, do not specify for basic and EPW + the inputs, ``None`` for basic and EPW metadata : list or dict - file metadata, do not specify for basic + file metadata, ``None`` for basic Note ---- @@ -591,11 +591,11 @@ 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, do not specify for basic and EPW + TMY year for each month, ``None`` for basic and EPW inputs : dict - the inputs, do not specify for basic and EPW + the inputs, ``None`` for basic and EPW metadata : list or dict - file metadata, do not specify for basic + file metadata, ``None`` for basic Raises ------ From eb0806d4287c00508664aef65273ad37215358cc Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:23:53 +0100 Subject: [PATCH 24/27] Apply suggestions from code review Co-authored-by: Cliff Hansen --- pvlib/iam.py | 2 +- pvlib/irradiance.py | 11 ++++++----- pvlib/location.py | 2 +- pvlib/solarposition.py | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pvlib/iam.py b/pvlib/iam.py index b994c0a362..4f32d352ee 100644 --- a/pvlib/iam.py +++ b/pvlib/iam.py @@ -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 not supplied, no AR coating is applied. + (unitless). If ``n_ar`` is not supplied, no AR coating is applied. A typical value for the effective index of an AR coating is 1.29. Returns diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index d9e070ec64..606c79c7a9 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -575,9 +575,10 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): overridden if surface_type is supplied. surface_type : string, optional - If supplied, overrides ``albedo``. String can be one of 'urban', - 'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', 'concrete', - 'aluminum', 'copper', 'fresh steel', 'dirty steel', 'sea'. + If supplied, overrides ``albedo``. `surface_type` can be one of + 'urban', 'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', + 'concrete', 'aluminum', 'copper', 'fresh steel', 'dirty steel', + 'sea'. Returns ------- @@ -1342,7 +1343,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, north (e.g. North = 0, East = 90, West = 270). airmass : numeric, optional - Relative (not pressure-corrected) airmass values. If airmass is a + Relative (not pressure-corrected) airmass values. If ``airmass`` is a DataFrame it must be of the same size as all other DataFrame inputs. The kastenyoung1989 airmass calculation is used internally and is also recommended when pre-calculating airmass because @@ -1621,7 +1622,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. pressure : numeric, default 101325 - Site pressure in Pascal. If not specified, 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 diff --git a/pvlib/location.py b/pvlib/location.py index 131be4831b..0a1f56c6ba 100644 --- a/pvlib/location.py +++ b/pvlib/location.py @@ -174,7 +174,7 @@ def get_solarposition(self, times, pressure=None, temperature=12, times : pandas.DatetimeIndex Must be localized or UTC will be assumed. pressure : float, or array-like, optional - If not specified, pressure will be calculated using + If not specified, ``pressure`` is calculated using :py:func:`pvlib.atmosphere.alt2pres` and ``self.altitude``. temperature : float or array-like, default 12 diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index e5fbd442cd..38ffa9e51c 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -312,7 +312,7 @@ def spa_python(time, latitude, longitude, *Note: delta_t = None will break code using nrel_numba, this will be fixed in a future version.* The USNO has historical and forecasted delta_t [3]_. - atmos_refrac : float, optional, optional + atmos_refrac : float, optional The approximate atmospheric refraction (in degrees) at sunrise and sunset. how : str, optional, default 'numpy' From 57d61af5aba87e7089a78cfae0b26d153a130fc7 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:27:25 +0100 Subject: [PATCH 25/27] Update irradiance.py --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 606c79c7a9..01368d6b50 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -575,7 +575,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): overridden if surface_type is supplied. surface_type : string, optional - If supplied, overrides ``albedo``. `surface_type` can be one of + If supplied, overrides ``albedo``. `surface_type` can be one of 'urban', 'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', 'concrete', 'aluminum', 'copper', 'fresh steel', 'dirty steel', 'sea'. From 69c83215b3ad761da7fff64ed514b92ee94c551f Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 2 Nov 2023 23:17:35 +0100 Subject: [PATCH 26/27] Update pvlib/irradiance.py Co-authored-by: Cliff Hansen --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 01368d6b50..b401a5e3dc 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -575,7 +575,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): overridden if surface_type is supplied. surface_type : string, optional - If supplied, overrides ``albedo``. `surface_type` can be one of + If supplied, overrides ``albedo``. ``surface_type`` can be one of 'urban', 'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', 'concrete', 'aluminum', 'copper', 'fresh steel', 'dirty steel', 'sea'. From 1f24c92c19a315a90e67b043333f96f73a2c9027 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 3 Nov 2023 22:28:11 +0100 Subject: [PATCH 27/27] Update irradiance.py --- pvlib/irradiance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index b401a5e3dc..acccf97ba5 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1621,9 +1621,9 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. - pressure : numeric, default 101325 - Site pressure in Pascal. If not specified, relative airmass is used. - instead of absolute (pressure-corrected) airmass. + pressure : numeric or None, default 101325 + Site pressure in Pascal. Uses absolute (pressure-corrected) airmass + by default. Set to ``None`` to use relative airmass. min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global