Skip to content

Commit 9cc946f

Browse files
authored
fix and update documentation (#446)
* fix cs docs, update env * remove seaborn * minor updates to text
1 parent 1c0c3e7 commit 9cc946f

File tree

5 files changed

+27
-50
lines changed

5 files changed

+27
-50
lines changed

docs/environment.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- python=3.5
6+
- python=3.6
77
- mock # needed for local python 2.7 builds
8-
- numpy=1.11.2
8+
- numpy=1.14.2
99
- scipy
10-
- tables
11-
- pandas=0.19.1
10+
- pytables
11+
- pandas=0.22.0
1212
- pytz
1313
- ephem
1414
- numba
15-
- ipython=5.2.2
15+
- ipython=6.3
1616
- ipywidgets
1717
- numpydoc
18-
- matplotlib=2.0.0
19-
- seaborn=0.7.1
20-
- siphon=0.4.0
21-
- sphinx=1.5
22-
- netCDF4=1.2.5
18+
- matplotlib=2.2.2
19+
- siphon=0.7.0
20+
- sphinx=1.7.2
21+
- netCDF4=1.3.1
2322
- hdf4=4.2.12
2423
- sphinx_rtd_theme
2524
- docutils

docs/sphinx/source/clearsky.rst

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ We'll need these imports for the examples below.
4040

4141
In [1]: import pandas as pd
4242

43-
# seaborn makes the plots look nicer
44-
In [1]: import seaborn as sns
45-
46-
In [1]: sns.set_color_codes()
47-
4843
In [1]: import pvlib
4944

5045
In [1]: from pvlib import clearsky, atmosphere
@@ -142,18 +137,16 @@ the year. You could run it in a loop to create plots for all months.
142137

143138
In [1]: filepath = os.path.join(pvlib_path, 'data', 'LinkeTurbidities.h5')
144139

145-
# data is in units of 20 x turbidity
146-
In [1]: lt_h5_file = tables.open_file(filepath)
147-
148140
In [1]: def plot_turbidity_map(month, vmin=1, vmax=100):
149141
...: plt.figure();
150-
...: plt.imshow(lt_h5_file.root.LinkeTurbidity[:, :, month-1], vmin=vmin, vmax=vmax);
142+
...: with tables.open_file(filepath) as lt_h5_file:
143+
...: ltdata = lt_h5_file.root.LinkeTurbidity[:, :, month-1]
144+
...: plt.imshow(ltdata, vmin=vmin, vmax=vmax);
145+
...: # data is in units of 20 x turbidity
151146
...: plt.title('Linke turbidity x 20, ' + calendar.month_name[month]);
152147
...: plt.colorbar(shrink=0.5);
153148
...: plt.tight_layout();
154149

155-
In [1]: lt_h5_file.close()
156-
157150
@savefig turbidity-1.png width=10in
158151
In [1]: plot_turbidity_map(1)
159152

@@ -228,7 +221,7 @@ A clear sky time series using only basic pvlib functions.
228221

229222
In [1]: linke_turbidity = pvlib.clearsky.lookup_linke_turbidity(times, latitude, longitude)
230223

231-
In [1]: dni_extra = pvlib.irradiance.extraradiation(times.dayofyear)
224+
In [1]: dni_extra = pvlib.irradiance.extraradiation(times)
232225

233226
# an input is a pandas Series, so solis is a DataFrame
234227
In [1]: ineichen = clearsky.ineichen(apparent_zenith, airmass, linke_turbidity, altitude, dni_extra)
@@ -270,7 +263,7 @@ Grid with a clear sky irradiance for a few turbidity values.
270263

271264
In [1]: print('climatological linke_turbidity = {}'.format(linke_turbidity.mean()))
272265

273-
In [1]: dni_extra = pvlib.irradiance.extraradiation(times.dayofyear)
266+
In [1]: dni_extra = pvlib.irradiance.extraradiation(times)
274267

275268
In [1]: linke_turbidities = [linke_turbidity.mean(), 2, 4]
276269

@@ -357,7 +350,7 @@ A clear sky time series using only basic pvlib functions.
357350

358351
In [1]: pressure = pvlib.atmosphere.alt2pres(altitude)
359352

360-
In [1]: dni_extra = pvlib.irradiance.extraradiation(times.dayofyear)
353+
In [1]: dni_extra = pvlib.irradiance.extraradiation(times)
361354

362355
# an input is a Series, so solis is a DataFrame
363356
In [1]: solis = clearsky.simplified_solis(apparent_elevation, aod700, precipitable_water,
@@ -419,7 +412,7 @@ Grid with a clear sky irradiance for a few PW and AOD values.
419412

420413
In [1]: pressure = pvlib.atmosphere.alt2pres(altitude)
421414

422-
In [1]: dni_extra = pvlib.irradiance.extraradiation(times.dayofyear)
415+
In [1]: dni_extra = pvlib.irradiance.extraradiation(times)
423416

424417
In [1]: aod700 = [0.01, 0.1]
425418

@@ -457,8 +450,6 @@ Contour plots of irradiance as a function of both PW and AOD.
457450
...: precipitable_water, pressure,
458451
...: dni_extra)
459452

460-
In [1]: cmap = plt.get_cmap('viridis')
461-
462453
In [1]: n = 15
463454

464455
In [1]: vmin = None
@@ -468,8 +459,8 @@ Contour plots of irradiance as a function of both PW and AOD.
468459
In [1]: def plot_solis(key):
469460
...: irrad = solis[key]
470461
...: fig, ax = plt.subplots()
471-
...: im = ax.contour(aod700, precipitable_water, irrad[:, :], n, cmap=cmap, vmin=vmin, vmax=vmax)
472-
...: imf = ax.contourf(aod700, precipitable_water, irrad[:, :], n, cmap=cmap, vmin=vmin, vmax=vmax)
462+
...: im = ax.contour(aod700, precipitable_water, irrad[:, :], n, vmin=vmin, vmax=vmax)
463+
...: imf = ax.contourf(aod700, precipitable_water, irrad[:, :], n, vmin=vmin, vmax=vmax)
473464
...: ax.set_xlabel('AOD')
474465
...: ax.set_ylabel('Precipitable water (cm)')
475466
...: ax.clabel(im, colors='k', fmt='%.0f')
@@ -566,7 +557,7 @@ Now we run the synthetic data and clear sky estimate through the
566557
567558
fig, ax = plt.subplots()
568559
569-
clear_samples.plot();
560+
clear_samples.astype(int).plot();
570561
571562
@savefig detect-clear-detected.png width=10in
572563
ax.set_ylabel('Clear (1) or Cloudy (0)');

docs/sphinx/source/forecasts.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ state-of-the-art of solar power forecasting.
1616

1717
pvlib-python uses Unidata's `Siphon
1818
<http://siphon.readthedocs.org/en/latest/>`_ library to simplify access
19-
to forecast data hosted on the Unidata `THREDDS catalog
19+
to real-time forecast data hosted on the Unidata `THREDDS catalog
2020
<http://thredds.ucar.edu/thredds/catalog.html>`_. Siphon is great for
2121
programatic access of THREDDS data, but we also recommend using tools
2222
such as `Panoply <http://www.giss.nasa.gov/tools/panoply/>`_
2323
to easily browse the catalog and become more familiar with its contents.
2424

25+
We do not know of a similarly easy way to access archives of forecast data.
26+
2527
This document demonstrates how to use pvlib-python to create a PV power
2628
forecast using these tools. The `forecast
2729
<http://nbviewer.jupyter.org/github/pvlib/pvlib-python/blob/
@@ -84,9 +86,6 @@ then set the location and time range data.
8486
import matplotlib.pyplot as plt
8587
import datetime
8688
87-
# seaborn makes the plots look nicer
88-
import seaborn as sns; sns.set_color_codes()
89-
9089
# import pvlib forecast models
9190
from pvlib.forecast import GFS, NAM, NDFD, HRRR, RAP
9291
@@ -329,8 +328,7 @@ HRRR
329328
The High Resolution Rapid Refresh (HRRR) model is perhaps the most
330329
accurate model, however, it is only available for ~15 hours. It is
331330
updated every hour and runs at 3 km resolution. The HRRR excels in
332-
severe weather situations. A major upgrade to the HRRR model is expected
333-
in Spring, 2016. See the `NOAA ESRL HRRR page
331+
severe weather situations. See the `NOAA ESRL HRRR page
334332
<http://rapidrefresh.noaa.gov/hrrr/>`_ for more information. Use the
335333
HRRR, among others, if you want forecasts for less than 24 hours.
336334
The HRRR model covers the continental United States.
@@ -354,8 +352,7 @@ RAP
354352
The Rapid Refresh (RAP) model is the parent model for the HRRR. It is
355353
updated every hour and runs at 40, 20, and 13 km resolutions. Only the
356354
20 and 40 km resolutions are currently available in pvlib. It is also
357-
excels in severe weather situations. A major upgrade to the RAP model is
358-
expected in Spring, 2016. See the `NOAA ESRL HRRR page
355+
excels in severe weather situations. See the `NOAA ESRL HRRR page
359356
<http://rapidrefresh.noaa.gov/hrrr/>`_ for more information. Use the
360357
RAP, among others, if you want forecasts for less than 24 hours.
361358
The RAP model covers most of North America.
@@ -471,7 +468,7 @@ Here's the forecast plane of array irradiance...
471468

472469
.. ipython:: python
473470
474-
mc.ac.plot();
471+
mc.ac.fillna(0).plot();
475472
plt.ylim(0, None);
476473
@savefig ac_power.png width=6in
477474
plt.ylabel('AC Power (W)');

docs/sphinx/source/package_overview.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ configuration at a handful of sites listed below.
3939
import pandas as pd
4040
import matplotlib.pyplot as plt
4141
42-
# seaborn makes the plots look nicer
43-
import seaborn as sns
44-
sns.set_color_codes()
45-
4642
naive_times = pd.DatetimeIndex(start='2015', end='2016', freq='1h')
4743
4844
# very approximate
@@ -298,7 +294,7 @@ The pvlib-python community thanks Sandia National Lab
298294
for developing PVLIB Matlab and for supporting
299295
Rob Andrews of Calama Consulting to port the library to Python.
300296
Will Holmgren thanks the DOE EERE Postdoctoral Fellowship program
301-
for support.
297+
for support from 2014-2016.
302298
The pvlib-python maintainers thank all of pvlib's contributors of issues
303299
and especially pull requests.
304300
The pvlib-python community thanks all of the

docs/sphinx/source/timetimezones.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,6 @@ Solar position
297297
The correct solar position can be immediately calculated from the
298298
DataFrame's index since the index has been localized.
299299

300-
.. ipython:: python
301-
:suppress:
302-
303-
import seaborn as sns
304-
sns.set_color_codes()
305-
306300
.. ipython:: python
307301
308302
solar_position = pvlib.solarposition.get_solarposition(tmy3_data.index,

0 commit comments

Comments
 (0)