Skip to content

Commit b7f4d6a

Browse files
committed
try adding a simple plot with ipython directives
1 parent 34cd7bb commit b7f4d6a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ dependencies:
1010
- ipython
1111
- sphinx
1212
- numpydoc
13+
- matplotlib
1314
- seaborn

pvlib/irradiance.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ def extraradiation(datetime_or_doy, solar_constant=1366.1, method='spencer'):
8787
See Also
8888
--------
8989
pvlib.clearsky.disc
90+
91+
Examples
92+
--------
93+
.. ipython::
94+
In [1]: times = pd.date_range('2014-01-01', '2015-01-01', freq='1D')
95+
In [2]: spencer = pd.Series(pvlib.irradiance.extraradiation(times, method='spencer'), times)
96+
asce = pd.Series(pvlib.irradiance.extraradiation(times, method='asce'), times)
97+
ephem = pvlib.irradiance.extraradiation(times, method='pyephem') # approx 100x slower than the above.
98+
In [3]: spencer.plot(label='spencer')
99+
asce.plot(label='asce')
100+
ephem.plot(label='pyephem')
101+
plt.legend()
102+
plt.ylabel('Extraterrestrial radiation (W/m^2)')
90103
"""
91104

92105
pvl_logger.debug('irradiance.extraradiation()')

0 commit comments

Comments
 (0)