From bead31f700f93c8cccda0de0e39755c0657cb01f Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 8 Jun 2017 17:28:43 +0200 Subject: [PATCH 01/16] Specify tilt angle in docstring --- pvlib/pvsystem.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 823fd8b28e..cecec1626e 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -57,8 +57,9 @@ class PVSystem(object): Parameters ---------- surface_tilt: float or array-like - Tilt angle of the module surface. - Up=0, horizon=90. + Surface tilt angles in decimal degrees. + The tilt angle is defined as degrees from horizontal + (e.g. surface facing up = 0, surface facing horizon = 90) surface_azimuth: float or array-like Azimuth angle of the module surface. From c4ab79e79469603adafd4f53d13ae3afce44a8b6 Mon Sep 17 00:00:00 2001 From: birgit Date: Wed, 14 Jun 2017 15:25:00 +0200 Subject: [PATCH 02/16] Add default values to docstrings in modelchain.py --- pvlib/modelchain.py | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index f682c480fa..7bf7b90d82 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -53,45 +53,52 @@ def basic_chain(times, latitude, longitude, irradiance : None or DataFrame If None, calculates clear sky data. Columns must be 'dni', 'ghi', 'dhi'. + (default None) weather : None or DataFrame If None, assumes air temperature is 20 C and wind speed is 0 m/s. Columns must be 'wind_speed', 'temp_air'. + (default None) surface_tilt : float or Series Surface tilt angles in decimal degrees. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) + (default None) surface_azimuth : float or Series Surface azimuth angles in decimal degrees. The azimuth convention is defined as degrees east of north (North=0, South=180, East=90, West=270). + (default None) orientation_strategy : None or str The strategy for aligning the modules. If not None, sets the ``surface_azimuth`` and ``surface_tilt`` properties of the ``system``. Allowed strategies include 'flat', 'south_at_latitude_tilt'. Ignored for SingleAxisTracker systems. + (default None) transposition_model : str - Passed to system.get_irradiance. + Passed to system.get_irradiance. (default 'haydavies') solar_position_method : str - Passed to location.get_solarposition. + Passed to location.get_solarposition. (default 'nrel_numpy') airmass_model : str - Passed to location.get_airmass. + Passed to location.get_airmass. (default 'kastenyoung1989') altitude : None or float If None, computed from pressure. Assumed to be 0 m if pressure is also None. + (default None) pressure : None or float If None, computed from altitude. Assumed to be 101325 Pa if altitude is also None. + (default None) **kwargs Arbitrary keyword arguments. @@ -238,24 +245,26 @@ class ModelChain(object): ``surface_azimuth`` and ``surface_tilt`` properties of the ``system``. Allowed strategies include 'flat', 'south_at_latitude_tilt'. Ignored for SingleAxisTracker systems. + (default 'south_at_latitude_tilt') clearsky_model : str - Passed to location.get_clearsky. + Passed to location.get_clearsky. (default 'ineichen') transposition_model : str - Passed to system.get_irradiance. + Passed to system.get_irradiance. (default 'haydavies') solar_position_method : str - Passed to location.get_solarposition. + Passed to location.get_solarposition. (default 'nrel_numpy') airmass_model : str - Passed to location.get_airmass. + Passed to location.get_airmass. (default 'nrel_numpy') dc_model: None, str, or function If None, the model will be inferred from the contents of system.module_parameters. Valid strings are 'sapm', 'singlediode', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. + (default None) ac_model: None, str, or function If None, the model will be inferred from the contents of @@ -263,12 +272,14 @@ class ModelChain(object): strings are 'snlinverter', 'adrinverter' (not implemented), 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. + (default None) aoi_model: None, str, or function If None, the model will be inferred from the contents of system.module_parameters. Valid strings are 'physical', 'ashrae', 'sapm', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. + (default None) spectral_model: None, str, or function If None, the model will be inferred from the contents of @@ -276,14 +287,18 @@ class ModelChain(object): 'first_solar' (not implemented), 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. + (default None) temp_model: str or function Valid strings are 'sapm'. The ModelChain instance will be passed as the first argument to a user-defined function. + (default 'sapm') losses_model: str or function Valid strings are 'pvwatts', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. + (default 'no_loss') + **kwargs Arbitrary keyword arguments. Included for compatibility, but not @@ -637,11 +652,11 @@ def complete_irradiance(self, times=None, weather=None): ---------- times : DatetimeIndex Times at which to evaluate the model. Can be None if - attribute `times` is already set. + attribute `times` is already set. (default None) weather : pandas.DataFrame Table with at least two columns containing one of the following data sets: dni, dhi, ghi. Can be None if attribute - `weather` is already set. + `weather` is already set. (default None) Returns ------- @@ -708,7 +723,7 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): ---------- times : DatetimeIndex Times at which to evaluate the model. Can be None if - attribute `times` is already set. + attribute `times` is already set. (default None) irradiance : None or DataFrame This parameter is deprecated. Please use `weather` instead. weather : None or DataFrame @@ -720,6 +735,7 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): method :py:meth:`~pvlib.modelchain.ModelChain.complete_irradiance` instead. + (default None) Returns ------- @@ -815,7 +831,7 @@ def run_model(self, times=None, irradiance=None, weather=None): ---------- times : DatetimeIndex Times at which to evaluate the model. Can be None if - attribute `times` is already set. + attribute `times` is already set. (default None) irradiance : None or DataFrame This parameter is deprecated. Please use `weather` instead. weather : None or DataFrame @@ -824,7 +840,7 @@ def run_model(self, times=None, irradiance=None, weather=None): names must be 'wind_speed', 'temp_air', 'dni', 'ghi', 'dhi'. Do not pass incomplete irradiation data. Use method :py:meth:`~pvlib.modelchain.ModelChain.complete_irradiance` - instead. + instead. (default None) Returns ------- From bd51698cf256c5e698068d35709b8c5d8e932afd Mon Sep 17 00:00:00 2001 From: birgit Date: Wed, 14 Jun 2017 15:25:21 +0200 Subject: [PATCH 03/16] Add missing parameter name to docstring of ModelChain --- pvlib/modelchain.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 7bf7b90d82..65bf8d964d 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -299,6 +299,8 @@ class ModelChain(object): will be passed as the first argument to a user-defined function. (default 'no_loss') + name: None or str + Name of ModelChain instance. (default None) **kwargs Arbitrary keyword arguments. Included for compatibility, but not From 56fb1e2101c7fce614b2b099b9aacc9b812a7af5 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 12:08:14 +0200 Subject: [PATCH 04/16] Change default in docstrings to numpy style --- pvlib/modelchain.py | 97 +++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 56 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 65bf8d964d..567a70b6bb 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -50,55 +50,48 @@ def basic_chain(times, latitude, longitude, inverter_parameters : None, dict or Series Inverter parameters as defined by the CEC. - irradiance : None or DataFrame + irradiance : None or DataFrame, default None If None, calculates clear sky data. Columns must be 'dni', 'ghi', 'dhi'. - (default None) - weather : None or DataFrame + weather : None or DataFrame, default None If None, assumes air temperature is 20 C and wind speed is 0 m/s. Columns must be 'wind_speed', 'temp_air'. - (default None) - surface_tilt : float or Series + surface_tilt : None, float or Series, default None Surface tilt angles in decimal degrees. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) - (default None) - surface_azimuth : float or Series + surface_azimuth : None, float or Series, default None Surface azimuth angles in decimal degrees. The azimuth convention is defined as degrees east of north (North=0, South=180, East=90, West=270). - (default None) - orientation_strategy : None or str + orientation_strategy : None or str, default None The strategy for aligning the modules. If not None, sets the ``surface_azimuth`` and ``surface_tilt`` properties of the ``system``. Allowed strategies include 'flat', 'south_at_latitude_tilt'. Ignored for SingleAxisTracker systems. - (default None) - transposition_model : str - Passed to system.get_irradiance. (default 'haydavies') + transposition_model : str, default 'haydavies' + Passed to system.get_irradiance. - solar_position_method : str - Passed to location.get_solarposition. (default 'nrel_numpy') + solar_position_method : str, default 'nrel_numpy' + Passed to location.get_solarposition. - airmass_model : str - Passed to location.get_airmass. (default 'kastenyoung1989') + airmass_model : str, default 'kastenyoung1989' + Passed to location.get_airmass. - altitude : None or float + altitude : None or float, default None If None, computed from pressure. Assumed to be 0 m if pressure is also None. - (default None) - pressure : None or float + pressure : None or float, default None If None, computed from altitude. Assumed to be 101325 Pa if altitude is also None. - (default None) **kwargs Arbitrary keyword arguments. @@ -240,67 +233,60 @@ class ModelChain(object): A :py:class:`~pvlib.location.Location` object that represents the physical location at which to evaluate the model. - orientation_strategy : None or str + orientation_strategy : None or str, default 'south_at_latitude_tilt' The strategy for aligning the modules. If not None, sets the ``surface_azimuth`` and ``surface_tilt`` properties of the ``system``. Allowed strategies include 'flat', 'south_at_latitude_tilt'. Ignored for SingleAxisTracker systems. - (default 'south_at_latitude_tilt') - clearsky_model : str - Passed to location.get_clearsky. (default 'ineichen') + clearsky_model : str, default 'ineichen' + Passed to location.get_clearsky. - transposition_model : str - Passed to system.get_irradiance. (default 'haydavies') + transposition_model : str, default 'haydavies' + Passed to system.get_irradiance. - solar_position_method : str - Passed to location.get_solarposition. (default 'nrel_numpy') + solar_position_method : str, default 'nrel_numpy' + Passed to location.get_solarposition. - airmass_model : str - Passed to location.get_airmass. (default 'nrel_numpy') + airmass_model : str, default 'kastenyoung1989' + Passed to location.get_airmass. - dc_model: None, str, or function + dc_model: None, str, or function, default None If None, the model will be inferred from the contents of system.module_parameters. Valid strings are 'sapm', 'singlediode', 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. - (default None) - ac_model: None, str, or function + ac_model: None, str, or function, default None If None, the model will be inferred from the contents of system.inverter_parameters and system.module_parameters. Valid strings are 'snlinverter', 'adrinverter' (not implemented), 'pvwatts'. The ModelChain instance will be passed as the first argument to a user-defined function. - (default None) - aoi_model: None, str, or function + aoi_model: None, str, or function, default None If None, the model will be inferred from the contents of system.module_parameters. Valid strings are 'physical', 'ashrae', 'sapm', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - (default None) - spectral_model: None, str, or function + spectral_model: None, str, or function, default None If None, the model will be inferred from the contents of system.module_parameters. Valid strings are 'sapm', 'first_solar' (not implemented), 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - (default None) - temp_model: str or function + temp_model: str or function, default 'sapm' Valid strings are 'sapm'. The ModelChain instance will be passed as the first argument to a user-defined function. - (default 'sapm') - losses_model: str or function + losses_model: str or function, default 'no_loss' Valid strings are 'pvwatts', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. - (default 'no_loss') - name: None or str - Name of ModelChain instance. (default None) + name: None or str, default None + Name of ModelChain instance. **kwargs Arbitrary keyword arguments. Included for compatibility, but not @@ -652,13 +638,13 @@ def complete_irradiance(self, times=None, weather=None): Parameters ---------- - times : DatetimeIndex + times : None or DatetimeIndex, default None Times at which to evaluate the model. Can be None if - attribute `times` is already set. (default None) - weather : pandas.DataFrame + attribute `times` is already set. + weather : None or pandas.DataFrame, default None Table with at least two columns containing one of the following data sets: dni, dhi, ghi. Can be None if attribute - `weather` is already set. (default None) + `weather` is already set. Returns ------- @@ -723,12 +709,12 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): Parameters ---------- - times : DatetimeIndex + times : None or DatetimeIndex, default None Times at which to evaluate the model. Can be None if - attribute `times` is already set. (default None) + attribute `times` is already set. irradiance : None or DataFrame This parameter is deprecated. Please use `weather` instead. - weather : None or DataFrame + weather : None or DataFrame, default None If None, the weather attribute is used. If the weather attribute is also None assumes air temperature is 20 C, wind speed is 0 m/s and irradiation calculated from clear sky @@ -737,7 +723,6 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): method :py:meth:`~pvlib.modelchain.ModelChain.complete_irradiance` instead. - (default None) Returns ------- @@ -831,18 +816,18 @@ def run_model(self, times=None, irradiance=None, weather=None): Parameters ---------- - times : DatetimeIndex + times : None or DatetimeIndex, default None Times at which to evaluate the model. Can be None if - attribute `times` is already set. (default None) + attribute `times` is already set. irradiance : None or DataFrame This parameter is deprecated. Please use `weather` instead. - weather : None or DataFrame + weather : None or DataFrame, default None If None, assumes air temperature is 20 C, wind speed is 0 m/s and irradiation calculated from clear sky data. Column names must be 'wind_speed', 'temp_air', 'dni', 'ghi', 'dhi'. Do not pass incomplete irradiation data. Use method :py:meth:`~pvlib.modelchain.ModelChain.complete_irradiance` - instead. (default None) + instead. Returns ------- From 2f9ab5e54ca49767b5fc127085cf4a3e310f731b Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 12:08:34 +0200 Subject: [PATCH 05/16] Add default values to atmosphere module --- pvlib/atmosphere.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/atmosphere.py b/pvlib/atmosphere.py index a61774f1ae..a69541c93a 100644 --- a/pvlib/atmosphere.py +++ b/pvlib/atmosphere.py @@ -114,7 +114,7 @@ def absoluteairmass(airmass_relative, pressure=101325.): airmass_relative : numeric The airmass at sea-level. - pressure : numeric + pressure : numeric, default 101325 The site pressure in Pascal. Returns @@ -152,7 +152,7 @@ def relativeairmass(zenith, model='kastenyoung1989'): model descriptions to determine which type of zenith angle is required. Apparent zenith angles must be calculated at sea level. - model : string + model : string, default 'kastenyoung1989' Available models include the following: * 'simple' - secant(apparent zenith angle) - @@ -365,7 +365,7 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None, airmass_absolute : array-like absolute (pressure corrected) airmass. - module_type : None or string + module_type : None or string, default None a string specifying a cell type. Can be lower or upper case letters. Admits values of 'cdte', 'monosi', 'xsi', 'multisi', 'polysi'. If provided, this input selects coefficients for the @@ -382,7 +382,7 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None, Manufacturer 2 Model C from [3]_. Spectral Response (SR) of CIGS and a-Si modules used to derive coefficients can be found in [4]_ - coefficients : array-like + coefficients : None or array-like, default None allows for entry of user defined spectral correction coefficients. Coefficients must be of length 6. Derivation of coefficients requires use of SMARTS and PV module quantum @@ -617,8 +617,8 @@ def angstrom_aod_at_lambda(aod0, lambda0, alpha, lambda1=700.0): wavelength in nanometers corresponding to ``aod0`` alpha : numeric Angstrom :math:`\alpha` exponent corresponding to ``aod0`` - lambda1 : numeric - desired wavelength in nanometers, defaults to 700 nm + lambda1 : numeric, default 700 + desired wavelength in nanometers Returns ------- From e09669454099d5c63f633b08590643ebfe3a9fa5 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 12:08:43 +0200 Subject: [PATCH 06/16] Add default values to clearsky module --- pvlib/clearsky.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 943fad7850..9a57f7a8dc 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -40,10 +40,10 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity, linke_turbidity : numeric Linke Turbidity. - altitude : numeric + altitude : numeric, default 0 Altitude above sea level in meters. - dni_extra : numeric + dni_extra : numeric, default 1364 Extraterrestrial irradiance. The units of ``dni_extra`` determine the units of the output. @@ -164,10 +164,10 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None, longitude : float - filepath : string + filepath : None or string, default None The path to the ``.mat`` file. - interp_turbidity : bool + interp_turbidity : bool, default True If ``True``, interpolates the monthly Linke turbidity values found in ``LinkeTurbidities.mat`` to daily values. @@ -352,21 +352,21 @@ def simplified_solis(apparent_elevation, aod700=0.1, precipitable_water=1., apparent_elevation : numeric The apparent elevation of the sun above the horizon (deg). - aod700 : numeric + aod700 : numeric, default 0.1 The aerosol optical depth at 700 nm (unitless). Algorithm derived for values between 0 and 0.45. - precipitable_water : numeric + precipitable_water : numeric, default 1.0 The precipitable water of the atmosphere (cm). Algorithm derived for values between 0.2 and 10 cm. Values less than 0.2 will be assumed to be equal to 0.2. - pressure : numeric + pressure : numeric, default 101325.0 The atmospheric pressure (Pascals). Algorithm derived for altitudes between sea level and 7000 m, or 101325 and 41000 Pascals. - dni_extra : numeric + dni_extra : numeric, default 1364.0 Extraterrestrial irradiance. The units of ``dni_extra`` determine the units of the output. @@ -569,29 +569,29 @@ def detect_clearsky(measured, clearsky, times, window_length, window_length : int Length of sliding time window in minutes. Must be greater than 2 periods. - mean_diff : float + mean_diff : float, default 75 Threshold value for agreement between mean values of measured and clearsky in each interval, see Eq. 6 in [1]. - max_diff : float + max_diff : float, default 75 Threshold value for agreement between maxima of measured and clearsky values in each interval, see Eq. 7 in [1]. - lower_line_length : float + lower_line_length : float, default -5 Lower limit of line length criterion from Eq. 8 in [1]. Criterion satisfied when lower_line_length < line length difference < upper_line_length - upper_line_length : float + upper_line_length : float, default 10 Upper limit of line length criterion from Eq. 8 in [1]. - var_diff : float + var_diff : float, default 0.005 Threshold value in Hz for the agreement between normalized standard deviations of rate of change in irradiance, see Eqs. 9 through 11 in [1]. - slope_dev : float + slope_dev : float, default 8 Threshold value for agreement between the largest magnitude of change in successive values, see Eqs. 12 through 14 in [1]. - max_iterations : int + max_iterations : int, default 20 Maximum number of times to apply a different scaling factor to the clearsky and redetermine clear_samples. Must be 1 or larger. - return_components : bool + return_components : bool, default False Controls if additional output should be returned. See below. Returns From cfd64efd43eea025ca4bb5e5220c709901238bfc Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 12:08:51 +0200 Subject: [PATCH 07/16] Add default values to forecast module --- pvlib/forecast.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/pvlib/forecast.py b/pvlib/forecast.py index fd6b1b6db3..b313379be7 100644 --- a/pvlib/forecast.py +++ b/pvlib/forecast.py @@ -216,11 +216,11 @@ def get_data(self, latitude, longitude, start, end, The start time. end: datetime or timestamp The end time. - vert_level: None, float or integer + vert_level: None, float or integer, default None Vertical altitude of interest. - variables: None or list + query_variables: None or list, default None If None, uses self.variables. - close_netcdf_data: bool + close_netcdf_data: bool, default True Controls if the temporary netcdf data file should be closed. Set to False to access the raw data. @@ -309,7 +309,7 @@ def rename(self, data, variables=None): Parameters ---------- data: DataFrame - variables: None or dict + variables: None or dict, default None If None, uses self.variables Returns @@ -381,7 +381,7 @@ def cloud_cover_to_ghi_linear(self, cloud_cover, ghi_clear, offset=35, Cloud cover in %. ghi_clear: numeric GHI under clear sky conditions. - offset: numeric + offset: numeric, default 35 Determines the minimum GHI. kwargs Not used. @@ -421,7 +421,7 @@ def cloud_cover_to_irradiance_clearsky_scaling(self, cloud_cover, ---------- cloud_cover : Series Cloud cover in %. - method : str + method : str, default 'linear' Method for converting cloud cover to GHI. 'linear' is currently the only option. **kwargs @@ -463,7 +463,7 @@ def cloud_cover_to_transmittance_linear(self, cloud_cover, offset=0.75, ---------- cloud_cover : numeric Cloud cover in %. - offset : numeric + offset : numeric, default 0.75 Determines the maximum transmittance. kwargs Not used. @@ -520,7 +520,7 @@ def cloud_cover_to_irradiance(self, cloud_cover, how='clearsky_scaling', Parameters ---------- cloud_cover : Series - how : str + how : str, default 'clearsky_scaling' Selects the method for conversion. Can be one of clearsky_scaling or liujordan. **kwargs @@ -633,9 +633,9 @@ class GFS(ForecastModel): Parameters ---------- - resolution: string + resolution: string, default 'half' Resolution of the model, either 'half' or 'quarter' degree. - set_type: string + set_type: string, default 'best' Type of model to pull data from. Attributes @@ -700,7 +700,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs): ---------- data: DataFrame Raw forecast data - cloud_cover: str + cloud_cover: str, default 'total_clouds' The type of cloud cover used to infer the irradiance. Returns @@ -727,7 +727,7 @@ class HRRR_ESRL(ForecastModel): Parameters ---------- - set_type: string + set_type: string, default 'best' Type of model to pull data from. Attributes @@ -785,7 +785,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs): ---------- data: DataFrame Raw forecast data - cloud_cover: str + cloud_cover: str, default 'total_clouds' The type of cloud cover used to infer the irradiance. Returns @@ -812,7 +812,7 @@ class NAM(ForecastModel): Parameters ---------- - set_type: string + set_type: string, default 'best' Type of model to pull data from. Attributes @@ -866,7 +866,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs): ---------- data: DataFrame Raw forecast data - cloud_cover: str + cloud_cover: str, default 'total_clouds' The type of cloud cover used to infer the irradiance. Returns @@ -893,7 +893,7 @@ class HRRR(ForecastModel): Parameters ---------- - set_type: string + set_type: string, default 'best' Type of model to pull data from. Attributes @@ -949,7 +949,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs): ---------- data: DataFrame Raw forecast data - cloud_cover: str + cloud_cover: str, default 'total_clouds' The type of cloud cover used to infer the irradiance. Returns @@ -976,7 +976,7 @@ class NDFD(ForecastModel): Parameters ---------- - set_type: string + set_type: string, default 'best' Type of model to pull data from. Attributes @@ -1045,9 +1045,9 @@ class RAP(ForecastModel): Parameters ---------- - resolution: string or int + resolution: string or int, default '20' The model resolution, either '20' or '40' (km) - set_type: string + set_type: string, default 'best' Type of model to pull data from. Attributes @@ -1104,7 +1104,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs): ---------- data: DataFrame Raw forecast data - cloud_cover: str + cloud_cover: str, default 'total_clouds' The type of cloud cover used to infer the irradiance. Returns From 5f6c0ba8eaf583947ab77a04f14bc3e68a9b39f7 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 12:09:01 +0200 Subject: [PATCH 08/16] Add default values to irradiance module --- pvlib/irradiance.py | 61 ++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 4a1d4a4f36..af09107372 100755 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -46,14 +46,14 @@ def extraradiation(datetime_or_doy, solar_constant=1366.1, method='spencer', datetime_or_doy : numeric, array, date, datetime, Timestamp, DatetimeIndex Day of year, array of days of year, or datetime-like object - solar_constant : float + solar_constant : float, default 1366.1 The solar constant. - method : string + method : string, default 'spencer' The method by which the ET radiation should be calculated. Options include ``'pyephem', 'spencer', 'asce', 'nrel'``. - epoch_year : int + epoch_year : int, default 2014 The year in which a day of year input will be calculated. Only applies to day of year input used with the pyephem or nrel methods. @@ -318,17 +318,17 @@ def total_irrad(surface_tilt, surface_azimuth, Global horizontal irradiance dhi : numeric Diffuse horizontal irradiance - dni_extra : numeric + dni_extra : None or numeric, default None Extraterrestrial direct normal irradiance - airmass : numeric + airmass : None or numeric, default None Airmass - albedo : numeric + albedo : numeric, default 0.25 Surface albedo - surface_type : String + surface_type : None or String, default None Surface type. See grounddiffuse. - model : String + model : String, default 'isotropic' Irradiance model. - model_perez : String + model_perez : String, default 'allsitescomposite1990' See perez. Returns @@ -460,13 +460,13 @@ def grounddiffuse(surface_tilt, ghi, albedo=.25, surface_type=None): ghi : numeric Global horizontal irradiance in W/m^2. - albedo : numeric + albedo : numeric, default 0.25 Ground reflectance, typically 0.1-0.4 for surfaces on Earth (land), may increase over snow, ice, etc. May also be known as the reflection coefficient. Must be >=0 and <=1. Will be overridden if surface_type is supplied. - surface_type: None or string + surface_type: None or string, default None 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'``. @@ -680,17 +680,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 + solar_zenith : None or numeric, default None 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 + solar_azimuth : None or numeric, default None Solar azimuth angles in decimal degrees. Must supply ``solar_zenith`` and ``solar_azimuth`` or supply ``projection_ratio``. - projection_ratio : None or numeric + projection_ratio : None or numeric, default None Ratio of angle of incidence projection to solar zenith angle projection. Must supply ``solar_zenith`` and ``solar_azimuth`` or supply ``projection_ratio``. @@ -1092,7 +1092,7 @@ def disc(ghi, 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 + pressure : numeric, default 101325 Site pressure in Pascal. Returns @@ -1194,11 +1194,11 @@ def dirint(ghi, zenith, times, pressure=101325., use_delta_kt_prime=True, times : DatetimeIndex - pressure : float or array-like + pressure : float or array-like, default 101325.0 The site pressure in Pascal. Pressure may be measured or an average pressure may be calculated from site altitude. - use_delta_kt_prime : bool + use_delta_kt_prime : bool, default True Indicates if the user would like to utilize the time-series nature of the GHI measurements. A value of ``False`` will not use the time-series improvements, any other numeric value will @@ -1208,7 +1208,7 @@ def dirint(ghi, zenith, times, pressure=101325., use_delta_kt_prime=True, then time-series improvements are not used (because it's not a time-series). If True, input data must be Series. - temp_dew : None, float, or array-like + temp_dew : None, float, or array-like, default None Surface dew point temperatures, in degrees C. Values of temp_dew may be numeric or NaN. Any single time period point with a DewPtTemp=NaN does not have dew point improvements applied. If @@ -1347,11 +1347,11 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., times : DatetimeIndex - pressure : float or array-like + pressure : float or array-like, default 101325.0 The site pressure in Pascal. Pressure may be measured or an average pressure may be calculated from site altitude. - use_delta_kt_prime : bool + use_delta_kt_prime : bool, default True Indicates if the user would like to utilize the time-series nature of the GHI measurements. A value of ``False`` will not use the time-series improvements, any other numeric value will @@ -1361,7 +1361,7 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., then time-series improvements are not used (because it's not a time-series). If True, input data must be Series. - temp_dew : None, float, or array-like + temp_dew : None, float, or array-like, default None Surface dew point temperatures, in degrees C. Values of temp_dew may be numeric or NaN. Any single time period point with a DewPtTemp=NaN does not have dew point improvements applied. If @@ -1509,10 +1509,10 @@ def liujordan(zenith, transmittance, airmass, pressure=101325., transmittance: float Atmospheric transmittance between 0 and 1. - pressure: float + pressure: float, default 101325.0 Air pressure - dni_extra: float + dni_extra: float, default 1367.0 Direct irradiance incident at the top of the atmosphere. Returns @@ -2075,25 +2075,24 @@ 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 - Clearsky direct normal irradiance. Default: None. + clearsky_dni : None or Series, default None + Clearsky direct normal irradiance. - clearsky_tolerance : float + clearsky_tolerance : float, default 1.1 If 'clearsky_dni' is given this parameter can be used to allow a tolerance by how much the calculated DNI value can be greater than the clearsky value before it is identified as an unreasonable value. - Default: 1.1. - zenith_threshold_for_zero_dni : float + zenith_threshold_for_zero_dni : float, default 88.0 Non-zero DNI values for zenith angles greater than or equal to - 'zenith_threshold_for_zero_dni' will be set to NaN. Default: 88. + 'zenith_threshold_for_zero_dni' will be set to NaN. - zenith_threshold_for_clearsky_limit : float + zenith_threshold_for_clearsky_limit : float, default 80.0 DNI values for zenith angles greater than or equal to 'zenith_threshold_for_clearsky_limit' and smaller the 'zenith_threshold_for_zero_dni' that are greater than the clearsky DNI (times allowed tolerance) will be corrected. Only applies if - 'clearsky_dni' is not None. Default: 80. + 'clearsky_dni' is not None. Returns ------- From b5e9eaa2a8f1ae2d292f6db9b5baed61c60d19bd Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 15:33:49 +0200 Subject: [PATCH 09/16] Add default values to location module --- pvlib/location.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pvlib/location.py b/pvlib/location.py index 217667b18f..b846c92577 100644 --- a/pvlib/location.py +++ b/pvlib/location.py @@ -35,17 +35,17 @@ class Location(object): Positive is east of the prime meridian. Use decimal degrees notation. - tz : str, int, float, or pytz.timezone. + tz : str, int, float, or pytz.timezone, default 'UTC'. See http://en.wikipedia.org/wiki/List_of_tz_database_time_zones for a list of valid time zones. pytz.timezone objects will be converted to strings. ints and floats must be in hours from UTC. - alitude : float. + alitude : float, default 0. Altitude from sea level in meters. - name : None or string. + name : None or string, default None. Sets the name attribute of the Location object. **kwargs @@ -98,7 +98,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 + tmy_data : None or DataFrame, default None Optionally attach the TMY data to this object. Returns @@ -141,10 +141,10 @@ def get_solarposition(self, times, pressure=None, temperature=12, Parameters ---------- times : DatetimeIndex - pressure : None, float, or array-like + pressure : None, float, or array-like, default None If None, pressure will be calculated using :py:func:`atmosphere.alt2pres` and ``self.altitude``. - temperature : None, float, or array-like + temperature : None, float, or array-like, default 12 kwargs passed to :py:func:`solarposition.get_solarposition` @@ -173,13 +173,13 @@ def get_clearsky(self, times, model='ineichen', solar_position=None, Parameters ---------- times: DatetimeIndex - model: str + model: str, default 'ineichen' The clear sky model to use. Must be one of 'ineichen', 'haurwitz', 'simplified_solis'. - solar_position : None or DataFrame - DataFrame with with columns 'apparent_zenith', 'zenith', + solar_position : None or DataFrame, default None + DataFrame with columns 'apparent_zenith', 'zenith', 'apparent_elevation'. - dni_extra: None or numeric + dni_extra: None or numeric, default None If None, will be calculated from times. kwargs passed to the relevant functions. Climatological values @@ -246,11 +246,11 @@ def get_airmass(self, times=None, solar_position=None, Parameters ---------- - times : None or DatetimeIndex + times : None or DatetimeIndex, default None Only used if solar_position is not provided. - solar_position : None or DataFrame + solar_position : None or DataFrame, default None DataFrame with with columns 'apparent_zenith', 'zenith'. - model : str + model : str, default 'kastenyoung1989' Relative airmass model Returns From 4acde323c12b25d7b82ce5e611310acfe1a55b0a Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 15:34:00 +0200 Subject: [PATCH 10/16] Add default values to pvsystem module --- pvlib/pvsystem.py | 90 ++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index cecec1626e..f16e8d1c50 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -56,49 +56,51 @@ class PVSystem(object): Parameters ---------- - surface_tilt: float or array-like + surface_tilt: float or array-like, default 0 Surface tilt angles in decimal degrees. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) - surface_azimuth: float or array-like + surface_azimuth: float or array-like, default 180 Azimuth angle of the module surface. North=0, East=90, South=180, West=270. - albedo : None, float + albedo : None or float, default None The ground albedo. If ``None``, will attempt to use ``surface_type`` and ``irradiance.SURFACE_ALBEDOS`` to lookup albedo. - surface_type : None, string + surface_type : None or string, default None The ground surface type. See ``irradiance.SURFACE_ALBEDOS`` for valid values. - module : None, string + module : None or string, default None The model name of the modules. May be used to look up the module_parameters dictionary via some other method. - module_parameters : None, dict or Series + module_parameters : None, dict or Series, default None Module parameters as defined by the SAPM, CEC, or other. - modules_per_string: int or float + modules_per_string: int or float, default 1 See system topology discussion above. - strings_per_inverter: int or float + strings_per_inverter: int or float, default 1 See system topology discussion above. - inverter : None, string + inverter : None or string, default None 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 + inverter_parameters : None, dict or Series, default None Inverter parameters as defined by the SAPM, CEC, or other. - racking_model : None or string + racking_model : None or string, default 'open_rack_cell_glassback' Used for cell and module temperature calculations. + name : None or string, default None + **kwargs Arbitrary keyword arguments. Included for compatibility, but not used. @@ -200,11 +202,11 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi, Global horizontal irradiance dhi : float or Series Diffuse horizontal irradiance - dni_extra : float or Series + dni_extra : None, float or Series, default None Extraterrestrial direct normal irradiance - airmass : float or Series + airmass : None, float or Series, default None Airmass - model : String + model : String, default 'haydavies' Irradiance model. **kwargs @@ -410,7 +412,7 @@ def sapm_effective_irradiance(self, poa_direct, poa_diffuse, aoi : numeric Angle of incidence in degrees. - reference_irradiance : numeric + reference_irradiance : numeric, default 1000 Reference irradiance by which to divide the input irradiance. Returns @@ -541,9 +543,9 @@ def localize(self, location=None, latitude=None, longitude=None, Parameters ---------- - location : None or Location - latitude : None or float - longitude : None or float + location : None or Location, default None + latitude : None or float, default None + longitude : None or float, default None **kwargs : see Location Returns @@ -702,7 +704,7 @@ def ashraeiam(aoi, b=0.05): The angle of incidence between the module normal vector and the sun-beam vector in degrees. - b : float + b : float, default 0.05 A parameter to adjust the modifier as a function of angle of incidence. Typical values are on the order of 0.05 [3]. @@ -766,20 +768,20 @@ def physicaliam(aoi, n=1.526, K=4., L=0.002): The angle of incidence between the module normal vector and the sun-beam vector in degrees. - n : numeric + n : numeric, default 1.526 The effective index of refraction (unitless). Reference [1] indicates that a value of 1.526 is acceptable for glass. n must be a numeric scalar or vector with all values >=0. If n is a vector, it must be the same size as all other input vectors. - K : numeric + K : numeric, default 4.0 The glazing extinction coefficient in units of 1/meters. Reference [1] indicates that a value of 4 is reasonable for "water white" glass. K must be a numeric scalar or vector with all values >=0. If K is a vector, it must be the same size as all other input vectors. - L : numeric + L : numeric, default 0.002 The glazing thickness in units of meters. Reference [1] indicates that 0.002 meters (2 mm) is reasonable for most glass-covered PV panels. L must be a numeric scalar or vector @@ -1072,7 +1074,7 @@ def retrieve_sam(name=None, path=None): Parameters ---------- - name : None or string + name : None or string, default None Name can be one of: * 'CECMod' - returns the CEC module database @@ -1083,7 +1085,7 @@ def retrieve_sam(name=None, path=None): * 'SandiaMod' - returns the Sandia Module database * 'ADRInverter' - returns the ADR Inverter database - path : None or string + path : None or string, default None Path to the SAM file. May also be a URL. If both name and path are None, a dialogue will open allowing the @@ -1346,7 +1348,7 @@ def sapm_celltemp(poa_global, wind_speed, temp_air, temp_air : float or Series Ambient dry bulb temperature in degrees C. - model : string, list, or dict + model : string, list, or dict, default 'open_rack_cell_glassback' Model to be used. If string, can be: @@ -1472,7 +1474,7 @@ def sapm_aoi_loss(aoi, module, upper=None): parameters. See the :py:func:`sapm` notes section for more details. - upper : None or float + upper : None or float, default None Upper limit on the results. Returns @@ -1540,7 +1542,7 @@ def sapm_effective_irradiance(poa_direct, poa_diffuse, airmass_absolute, aoi, parameters. See the :py:func:`sapm` notes section for more details. - reference_irradiance : numeric + reference_irradiance : numeric, default 1000 Reference irradiance by which to divide the input irradiance. Returns @@ -1607,7 +1609,7 @@ def singlediode(photocurrent, saturation_current, resistance_series, temp_cell is the temperature of the p-n junction in Kelvin, and q is the charge of an electron (coulombs). - ivcurve_pnts : None or int + ivcurve_pnts : None or int, default None Number of points in the desired IV curve. If None or 0, no IV curves will be produced. @@ -2083,7 +2085,7 @@ def adrinverter(v_dc, p_dc, inverter, vtol=0.10): supplied data table using retrievesam. See Notes for required keys. - vtol : numeric + vtol : numeric, default 0.1 A unit-less fraction that determines how far the efficiency model is allowed to extrapolate beyond the inverter's normal input voltage operating range. 0.0 <= vtol <= 1.0 @@ -2182,9 +2184,9 @@ def scale_voltage_current_power(data, voltage=1, current=1): data: DataFrame Must contain columns `'v_mp', 'v_oc', 'i_mp' ,'i_x', 'i_xx', 'i_sc', 'p_mp'`. - voltage: numeric + voltage: numeric, default 1 The amount by which to multiply the voltages. - current: numeric + current: numeric, default 1 The amount by which to multiply the currents. Returns @@ -2228,7 +2230,7 @@ def pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.): gamma_pdc: numeric The temperature coefficient in units of 1/C. Typically -0.002 to -0.005 per degree C. - temp_ref: numeric + temp_ref: numeric, default 25.0 Cell reference temperature. PVWatts defines it to be 25 C and is included here for flexibility. @@ -2265,17 +2267,17 @@ def pvwatts_losses(soiling=2, shading=3, snow=0, mismatch=2, wiring=2, Parameters ---------- - soiling: numeric - shading: numeric - snow: numeric - mismatch: numeric - wiring: numeric - connections: numeric - lid: numeric + soiling: numeric, default 2 + shading: numeric, default 3 + snow: numeric, default 0 + mismatch: numeric, default 2 + wiring: numeric, default 2 + connections: numeric, default 0.5 + lid: numeric, default 1.5 Light induced degradation - nameplate_rating: numeric - age: numeric - availability: numeric + nameplate_rating: numeric, default 1 + age: numeric, default 0 + availability: numeric, default 3 Returns ------- @@ -2323,9 +2325,9 @@ def pvwatts_ac(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637): DC power. pdc0: numeric Nameplate DC rating. - eta_inv_nom: numeric + eta_inv_nom: numeric, default 0.96 Nominal inverter efficiency. - eta_inv_ref: numeric + eta_inv_ref: numeric, default 0.9637 Reference inverter efficiency. PVWatts defines it to be 0.9637 and is included here for flexibility. From 791c8a828d8f0aa8150644b47ad52002bc40c087 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 15:34:10 +0200 Subject: [PATCH 11/16] Add default values to solarposition module --- pvlib/solarposition.py | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 7ba6b4a0d2..7b035323e9 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -43,15 +43,15 @@ def get_solarposition(time, latitude, longitude, longitude : float - altitude : None or float + altitude : None or float, default None If None, computed from pressure. Assumed to be 0 m if pressure is also None. - pressure : None or float + pressure : None or float, default None If None, computed from altitude. Assumed to be 101325 Pa if altitude is also None. - method : string + method : string, default 'nrel_numpy' 'nrel_numpy' uses an implementation of the NREL SPA algorithm described in [1] (default, recommended): :py:func:`spa_python` @@ -65,7 +65,7 @@ def get_solarposition(time, latitude, longitude, 'nrel_c' uses the NREL SPA C code [3]: :py:func:`spa_c` - temperature : float + temperature : float, default 12 Degrees C. Other keywords are passed to the underlying solar position function. @@ -136,16 +136,16 @@ def spa_c(time, latitude, longitude, pressure=101325, altitude=0, Localized or UTC. latitude : float longitude : float - pressure : float + pressure : float, default 101325 Pressure in Pascals - altitude : float + altitude : float, default 0 Elevation above sea level. - temperature : float + temperature : float, default 12 Temperature in C - delta_t : float + delta_t : float, default 67.0 Difference between terrestrial time and UT1. USNO has previous values and predictions. - raw_spa_output : bool + raw_spa_output : bool, default False If true, returns the raw SPA output. Returns @@ -268,12 +268,12 @@ def spa_python(time, latitude, longitude, Localized or UTC. latitude : float longitude : float - altitude : float - pressure : int or float, optional + altitude : float, default 0 + pressure : int or float, optional, default 101325 avg. yearly air pressure in Pascals. - temperature : int or float, optional + temperature : int or float, optional, default 12 avg. yearly air temperature in degrees C. - delta_t : float, optional + delta_t : float, optional, default 67.0 If delta_t is None, uses spa.calculate_deltat using time.year and time.month from pandas.DatetimeIndex. For most simulations specifing delta_t is sufficient. @@ -281,14 +281,14 @@ 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 + atmos_refrac : None or float, optional, default None The approximate atmospheric refraction (in degrees) at sunrise and sunset. - how : str, optional + how : str, optional, default 'numpy' Options are 'numpy' or 'numba'. If numba >= 0.17.0 is installed, how='numba' will compile the spa functions to machine code and run them multithreaded. - numthreads : int, optional + numthreads : int, optional, default 4 Number of threads to use if how == 'numba'. Returns @@ -381,11 +381,11 @@ def get_sun_rise_set_transit(time, latitude, longitude, how='numpy', *Note: delta_t = None will break code using nrel_numba, this will be fixed in a future version. By default, use USNO historical data and predictions - how : str, optional + how : str, optional, default 'numpy' Options are 'numpy' or 'numba'. If numba >= 0.17.0 is installed, how='numba' will compile the spa functions to machine code and run them multithreaded. - numthreads : int, optional + numthreads : int, optional, default 4 Number of threads to use if how == 'numba'. Returns @@ -465,11 +465,11 @@ def pyephem(time, latitude, longitude, altitude=0, pressure=101325, Localized or UTC. latitude : float longitude : float - altitude : float + altitude : float, default 0 distance above sea level. - pressure : int or float, optional + pressure : int or float, optional, default 101325 air pressure in Pascals. - temperature : int or float, optional + temperature : int or float, optional, default 12 air temperature in degrees C. Returns @@ -549,9 +549,9 @@ def ephemeris(time, latitude, longitude, pressure=101325, temperature=12): time : pandas.DatetimeIndex latitude : float longitude : float - pressure : float or Series + pressure : float or Series, default 101325 Ambient pressure (Pascals) - temperature : float or Series + temperature : float or Series, default 12 Ambient temperature (C) Returns @@ -731,14 +731,14 @@ def calc_time(lower_bound, upper_bound, latitude, longitude, attribute, value, and 'az' (which must be given in radians). value : int or float The value of the attribute to solve for - altitude : float + altitude : float, default 0 Distance above sea level. - pressure : int or float, optional + pressure : int or float, optional, default 101325 Air pressure in Pascals. Set to 0 for no atmospheric correction. - temperature : int or float, optional + temperature : int or float, optional, default 12 Air temperature in degrees C. - xtol : float, optional + xtol : float, optional, default 1.0e-12 The allowed error in the result from value Returns @@ -810,12 +810,12 @@ def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4): ---------- time : pd.DatetimeIndex - how : str, optional + how : str, optional, default 'numpy' Options are 'numpy' or 'numba'. If numba >= 0.17.0 is installed, how='numba' will compile the spa functions to machine code and run them multithreaded. - delta_t : float, optional + delta_t : float, optional, default 67.0 If delta_t is None, uses spa.calculate_deltat using time.year and time.month from pandas.DatetimeIndex. For most simulations specifing delta_t is sufficient. @@ -824,7 +824,7 @@ def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4): this will be fixed in a future version.* By default, use USNO historical data and predictions - numthreads : int, optional + numthreads : int, optional, default 4 Number of threads to use if how == 'numba'. Returns From 6cb00fd18cd20449b0e9f3330136deae7f765606 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 15:34:20 +0200 Subject: [PATCH 12/16] Add default values to spa module --- pvlib/spa.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/spa.py b/pvlib/spa.py index d2b5ac8e36..e1fa41913b 100644 --- a/pvlib/spa.py +++ b/pvlib/spa.py @@ -1119,13 +1119,13 @@ def solar_position(unixtime, lat, lon, elev, pressure, temp, delta_t, atmos_refrac : float, optional The approximate atmospheric refraction (in degrees) at sunrise and sunset. - numthreads: int, optional + numthreads: int, optional, default 8 Number of threads to use for computation if numba>=0.17 is installed. - sst : bool + sst : bool, default False If True, return only data needed for sunrise, sunset, and transit calculations. - esd : bool + esd : bool, default False If True, return only Earth-Sun distance in AU Returns From 86898e969b24b1210ceab9cfcb7d507ded642cc7 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 15:34:28 +0200 Subject: [PATCH 13/16] Add default values to tmy module --- pvlib/tmy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/tmy.py b/pvlib/tmy.py index 16c69ca9b4..e1b9b78c96 100644 --- a/pvlib/tmy.py +++ b/pvlib/tmy.py @@ -28,14 +28,14 @@ def readtmy3(filename=None, coerce_year=None, recolumn=True): Parameters ---------- - filename : None or string + filename : None or string, default None If None, attempts to use a Tkinter file browser. A string can be a relative file path, absolute file path, or url. - coerce_year : None or int + coerce_year : None or int, default None If supplied, the year of the data will be set to this value. - recolumn : bool + recolumn : bool, default True If True, apply standard names to TMY3 columns. Typically this results in stripping the units from the column name. From 655910880edd834d42970dc1d61b27db0350d500 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 15:34:36 +0200 Subject: [PATCH 14/16] Add default values to tools module --- pvlib/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tools.py b/pvlib/tools.py index 1f9dba4993..a722500f2a 100644 --- a/pvlib/tools.py +++ b/pvlib/tools.py @@ -149,7 +149,7 @@ def djd_to_datetime(djd, tz='UTC'): ---------- djd : float fractional days since 12/31/1899+0000 - tz : str + tz : str, default 'UTC' timezone to localize the result to Returns From 08c8dad31384ff2fe77ab16058bb8e4ed682815e Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Thu, 22 Jun 2017 15:34:46 +0200 Subject: [PATCH 15/16] Add default values to tracking module --- pvlib/tracking.py | 50 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/pvlib/tracking.py b/pvlib/tracking.py index 64988e15c4..a77ee75661 100644 --- a/pvlib/tracking.py +++ b/pvlib/tracking.py @@ -15,6 +15,34 @@ class SingleAxisTracker(PVSystem): """ Inherits all of the PV modeling methods from PVSystem. + + axis_tilt : float, default 0 + The tilt of the axis of rotation (i.e, the y-axis defined by + axis_azimuth) with respect to horizontal, in decimal degrees. + + axis_azimuth : float, default 0 + A value denoting the compass direction along which the axis of + rotation lies. Measured in decimal degrees East of North. + + max_angle : float, default 90 + A value denoting the maximum rotation angle, in decimal degrees, + of the one-axis tracker from its horizontal position (horizontal + if axis_tilt = 0). A max_angle of 90 degrees allows the tracker + to rotate to a vertical position to point the panel towards a + horizon. max_angle of 180 degrees allows for full rotation. + + backtrack : bool, default True + Controls whether the tracker has the capability to "backtrack" + to avoid row-to-row shading. False denotes no backtrack + capability. True denotes backtrack capability. + + gcr : float, default 2.0/7.0 + A value denoting the ground coverage ratio of a tracker system + which utilizes backtracking; i.e. the ratio between the PV array + surface area to total ground area. A tracker system with modules + 2 meters wide, centered on the tracking axis, with 6 meters + between the tracking axes has a gcr of 2/6=0.333. If gcr is not + provided, a gcr of 2/7 is default. gcr must be <=1. """ def __init__(self, axis_tilt=0, axis_azimuth=0, @@ -56,9 +84,9 @@ def localize(self, location=None, latitude=None, longitude=None, Parameters ---------- - location : None or Location - latitude : None or float - longitude : None or float + location : None or Location, default None + latitude : None or float, default None + longitude : None or float, default None **kwargs : see Location Returns @@ -92,11 +120,11 @@ def get_irradiance(self, dni, ghi, dhi, Global horizontal irradiance dhi : float or Series Diffuse horizontal irradiance - dni_extra : float or Series + dni_extra : float or Series, default None Extraterrestrial direct normal irradiance - airmass : float or Series + airmass : float or Series, default None Airmass - model : String + model : String, default 'haydavies' Irradiance model. **kwargs @@ -201,27 +229,27 @@ def singleaxis(apparent_zenith, apparent_azimuth, apparent_azimuth : Series Solar apparent azimuth angles in decimal degrees. - axis_tilt : float + axis_tilt : float, default 0 The tilt of the axis of rotation (i.e, the y-axis defined by axis_azimuth) with respect to horizontal, in decimal degrees. - axis_azimuth : float + axis_azimuth : float, default 0 A value denoting the compass direction along which the axis of rotation lies. Measured in decimal degrees East of North. - max_angle : float + max_angle : float, default 90 A value denoting the maximum rotation angle, in decimal degrees, of the one-axis tracker from its horizontal position (horizontal if axis_tilt = 0). A max_angle of 90 degrees allows the tracker to rotate to a vertical position to point the panel towards a horizon. max_angle of 180 degrees allows for full rotation. - backtrack : bool + backtrack : bool, default True Controls whether the tracker has the capability to "backtrack" to avoid row-to-row shading. False denotes no backtrack capability. True denotes backtrack capability. - gcr : float + gcr : float, default 2.0/7.0 A value denoting the ground coverage ratio of a tracker system which utilizes backtracking; i.e. the ratio between the PV array surface area to total ground area. A tracker system with modules From e469bbd3e07aa2fbd940701f5cfed160cd594dc2 Mon Sep 17 00:00:00 2001 From: Birgit Schachler Date: Mon, 3 Jul 2017 09:07:34 +0200 Subject: [PATCH 16/16] Add changes to whats new --- docs/sphinx/source/whatsnew/v0.4.6.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.4.6.rst b/docs/sphinx/source/whatsnew/v0.4.6.rst index 289f070295..83af2ed916 100644 --- a/docs/sphinx/source/whatsnew/v0.4.6.rst +++ b/docs/sphinx/source/whatsnew/v0.4.6.rst @@ -14,7 +14,7 @@ Bug fixes Enhancements ~~~~~~~~~~~~ - +* Added default values to docstrings of all functions (:issue:`336`) API Changes ~~~~~~~~~~~ @@ -30,3 +30,4 @@ Contributors * Will Holmgren * Uwe Krien * Alaina Kafkes +* Birgit Schachler