Skip to content

Commit eef1992

Browse files
birgitswholmgren
authored andcommitted
Add default parameters to doc strings (#336)
* Specify tilt angle in docstring * Add default values to docstrings in modelchain.py * Add missing parameter name to docstring of ModelChain * Change default in docstrings to numpy style * Add default values to atmosphere module * Add default values to clearsky module * Add default values to forecast module * Add default values to irradiance module * Add default values to location module * Add default values to pvsystem module * Add default values to solarposition module * Add default values to spa module * Add default values to tmy module * Add default values to tools module * Add default values to tracking module * Add changes to whats new
1 parent 4239443 commit eef1992

13 files changed

+243
-209
lines changed

docs/sphinx/source/whatsnew/v0.4.6.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Bug fixes
1414

1515
Enhancements
1616
~~~~~~~~~~~~
17-
17+
* Added default values to docstrings of all functions (:issue:`336`)
1818

1919
API Changes
2020
~~~~~~~~~~~
@@ -30,3 +30,4 @@ Contributors
3030
* Will Holmgren
3131
* Uwe Krien
3232
* Alaina Kafkes
33+
* Birgit Schachler

pvlib/atmosphere.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def absoluteairmass(airmass_relative, pressure=101325.):
114114
airmass_relative : numeric
115115
The airmass at sea-level.
116116
117-
pressure : numeric
117+
pressure : numeric, default 101325
118118
The site pressure in Pascal.
119119
120120
Returns
@@ -152,7 +152,7 @@ def relativeairmass(zenith, model='kastenyoung1989'):
152152
model descriptions to determine which type of zenith angle is
153153
required. Apparent zenith angles must be calculated at sea level.
154154
155-
model : string
155+
model : string, default 'kastenyoung1989'
156156
Available models include the following:
157157
158158
* 'simple' - secant(apparent zenith angle) -
@@ -365,7 +365,7 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
365365
airmass_absolute : array-like
366366
absolute (pressure corrected) airmass.
367367
368-
module_type : None or string
368+
module_type : None or string, default None
369369
a string specifying a cell type. Can be lower or upper case
370370
letters. Admits values of 'cdte', 'monosi', 'xsi', 'multisi',
371371
'polysi'. If provided, this input selects coefficients for the
@@ -382,7 +382,7 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
382382
Manufacturer 2 Model C from [3]_. Spectral Response (SR) of CIGS
383383
and a-Si modules used to derive coefficients can be found in [4]_
384384
385-
coefficients : array-like
385+
coefficients : None or array-like, default None
386386
allows for entry of user defined spectral correction
387387
coefficients. Coefficients must be of length 6. Derivation of
388388
coefficients requires use of SMARTS and PV module quantum
@@ -617,8 +617,8 @@ def angstrom_aod_at_lambda(aod0, lambda0, alpha, lambda1=700.0):
617617
wavelength in nanometers corresponding to ``aod0``
618618
alpha : numeric
619619
Angstrom :math:`\alpha` exponent corresponding to ``aod0``
620-
lambda1 : numeric
621-
desired wavelength in nanometers, defaults to 700 nm
620+
lambda1 : numeric, default 700
621+
desired wavelength in nanometers
622622
623623
Returns
624624
-------

pvlib/clearsky.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,
4040
linke_turbidity : numeric
4141
Linke Turbidity.
4242
43-
altitude : numeric
43+
altitude : numeric, default 0
4444
Altitude above sea level in meters.
4545
46-
dni_extra : numeric
46+
dni_extra : numeric, default 1364
4747
Extraterrestrial irradiance. The units of ``dni_extra``
4848
determine the units of the output.
4949
@@ -164,10 +164,10 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None,
164164
165165
longitude : float
166166
167-
filepath : string
167+
filepath : None or string, default None
168168
The path to the ``.mat`` file.
169169
170-
interp_turbidity : bool
170+
interp_turbidity : bool, default True
171171
If ``True``, interpolates the monthly Linke turbidity values
172172
found in ``LinkeTurbidities.mat`` to daily values.
173173
@@ -352,21 +352,21 @@ def simplified_solis(apparent_elevation, aod700=0.1, precipitable_water=1.,
352352
apparent_elevation : numeric
353353
The apparent elevation of the sun above the horizon (deg).
354354
355-
aod700 : numeric
355+
aod700 : numeric, default 0.1
356356
The aerosol optical depth at 700 nm (unitless).
357357
Algorithm derived for values between 0 and 0.45.
358358
359-
precipitable_water : numeric
359+
precipitable_water : numeric, default 1.0
360360
The precipitable water of the atmosphere (cm).
361361
Algorithm derived for values between 0.2 and 10 cm.
362362
Values less than 0.2 will be assumed to be equal to 0.2.
363363
364-
pressure : numeric
364+
pressure : numeric, default 101325.0
365365
The atmospheric pressure (Pascals).
366366
Algorithm derived for altitudes between sea level and 7000 m,
367367
or 101325 and 41000 Pascals.
368368
369-
dni_extra : numeric
369+
dni_extra : numeric, default 1364.0
370370
Extraterrestrial irradiance. The units of ``dni_extra``
371371
determine the units of the output.
372372
@@ -569,29 +569,29 @@ def detect_clearsky(measured, clearsky, times, window_length,
569569
window_length : int
570570
Length of sliding time window in minutes. Must be greater than 2
571571
periods.
572-
mean_diff : float
572+
mean_diff : float, default 75
573573
Threshold value for agreement between mean values of measured
574574
and clearsky in each interval, see Eq. 6 in [1].
575-
max_diff : float
575+
max_diff : float, default 75
576576
Threshold value for agreement between maxima of measured and
577577
clearsky values in each interval, see Eq. 7 in [1].
578-
lower_line_length : float
578+
lower_line_length : float, default -5
579579
Lower limit of line length criterion from Eq. 8 in [1].
580580
Criterion satisfied when
581581
lower_line_length < line length difference < upper_line_length
582-
upper_line_length : float
582+
upper_line_length : float, default 10
583583
Upper limit of line length criterion from Eq. 8 in [1].
584-
var_diff : float
584+
var_diff : float, default 0.005
585585
Threshold value in Hz for the agreement between normalized
586586
standard deviations of rate of change in irradiance, see Eqs. 9
587587
through 11 in [1].
588-
slope_dev : float
588+
slope_dev : float, default 8
589589
Threshold value for agreement between the largest magnitude of
590590
change in successive values, see Eqs. 12 through 14 in [1].
591-
max_iterations : int
591+
max_iterations : int, default 20
592592
Maximum number of times to apply a different scaling factor to
593593
the clearsky and redetermine clear_samples. Must be 1 or larger.
594-
return_components : bool
594+
return_components : bool, default False
595595
Controls if additional output should be returned. See below.
596596
597597
Returns

pvlib/forecast.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ def get_data(self, latitude, longitude, start, end,
216216
The start time.
217217
end: datetime or timestamp
218218
The end time.
219-
vert_level: None, float or integer
219+
vert_level: None, float or integer, default None
220220
Vertical altitude of interest.
221-
variables: None or list
221+
query_variables: None or list, default None
222222
If None, uses self.variables.
223-
close_netcdf_data: bool
223+
close_netcdf_data: bool, default True
224224
Controls if the temporary netcdf data file should be closed.
225225
Set to False to access the raw data.
226226
@@ -309,7 +309,7 @@ def rename(self, data, variables=None):
309309
Parameters
310310
----------
311311
data: DataFrame
312-
variables: None or dict
312+
variables: None or dict, default None
313313
If None, uses self.variables
314314
315315
Returns
@@ -381,7 +381,7 @@ def cloud_cover_to_ghi_linear(self, cloud_cover, ghi_clear, offset=35,
381381
Cloud cover in %.
382382
ghi_clear: numeric
383383
GHI under clear sky conditions.
384-
offset: numeric
384+
offset: numeric, default 35
385385
Determines the minimum GHI.
386386
kwargs
387387
Not used.
@@ -421,7 +421,7 @@ def cloud_cover_to_irradiance_clearsky_scaling(self, cloud_cover,
421421
----------
422422
cloud_cover : Series
423423
Cloud cover in %.
424-
method : str
424+
method : str, default 'linear'
425425
Method for converting cloud cover to GHI.
426426
'linear' is currently the only option.
427427
**kwargs
@@ -463,7 +463,7 @@ def cloud_cover_to_transmittance_linear(self, cloud_cover, offset=0.75,
463463
----------
464464
cloud_cover : numeric
465465
Cloud cover in %.
466-
offset : numeric
466+
offset : numeric, default 0.75
467467
Determines the maximum transmittance.
468468
kwargs
469469
Not used.
@@ -520,7 +520,7 @@ def cloud_cover_to_irradiance(self, cloud_cover, how='clearsky_scaling',
520520
Parameters
521521
----------
522522
cloud_cover : Series
523-
how : str
523+
how : str, default 'clearsky_scaling'
524524
Selects the method for conversion. Can be one of
525525
clearsky_scaling or liujordan.
526526
**kwargs
@@ -633,9 +633,9 @@ class GFS(ForecastModel):
633633
634634
Parameters
635635
----------
636-
resolution: string
636+
resolution: string, default 'half'
637637
Resolution of the model, either 'half' or 'quarter' degree.
638-
set_type: string
638+
set_type: string, default 'best'
639639
Type of model to pull data from.
640640
641641
Attributes
@@ -700,7 +700,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
700700
----------
701701
data: DataFrame
702702
Raw forecast data
703-
cloud_cover: str
703+
cloud_cover: str, default 'total_clouds'
704704
The type of cloud cover used to infer the irradiance.
705705
706706
Returns
@@ -727,7 +727,7 @@ class HRRR_ESRL(ForecastModel):
727727
728728
Parameters
729729
----------
730-
set_type: string
730+
set_type: string, default 'best'
731731
Type of model to pull data from.
732732
733733
Attributes
@@ -785,7 +785,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
785785
----------
786786
data: DataFrame
787787
Raw forecast data
788-
cloud_cover: str
788+
cloud_cover: str, default 'total_clouds'
789789
The type of cloud cover used to infer the irradiance.
790790
791791
Returns
@@ -812,7 +812,7 @@ class NAM(ForecastModel):
812812
813813
Parameters
814814
----------
815-
set_type: string
815+
set_type: string, default 'best'
816816
Type of model to pull data from.
817817
818818
Attributes
@@ -866,7 +866,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
866866
----------
867867
data: DataFrame
868868
Raw forecast data
869-
cloud_cover: str
869+
cloud_cover: str, default 'total_clouds'
870870
The type of cloud cover used to infer the irradiance.
871871
872872
Returns
@@ -893,7 +893,7 @@ class HRRR(ForecastModel):
893893
894894
Parameters
895895
----------
896-
set_type: string
896+
set_type: string, default 'best'
897897
Type of model to pull data from.
898898
899899
Attributes
@@ -949,7 +949,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
949949
----------
950950
data: DataFrame
951951
Raw forecast data
952-
cloud_cover: str
952+
cloud_cover: str, default 'total_clouds'
953953
The type of cloud cover used to infer the irradiance.
954954
955955
Returns
@@ -976,7 +976,7 @@ class NDFD(ForecastModel):
976976
977977
Parameters
978978
----------
979-
set_type: string
979+
set_type: string, default 'best'
980980
Type of model to pull data from.
981981
982982
Attributes
@@ -1045,9 +1045,9 @@ class RAP(ForecastModel):
10451045
10461046
Parameters
10471047
----------
1048-
resolution: string or int
1048+
resolution: string or int, default '20'
10491049
The model resolution, either '20' or '40' (km)
1050-
set_type: string
1050+
set_type: string, default 'best'
10511051
Type of model to pull data from.
10521052
10531053
Attributes
@@ -1104,7 +1104,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
11041104
----------
11051105
data: DataFrame
11061106
Raw forecast data
1107-
cloud_cover: str
1107+
cloud_cover: str, default 'total_clouds'
11081108
The type of cloud cover used to infer the irradiance.
11091109
11101110
Returns

0 commit comments

Comments
 (0)