Skip to content

Commit 1441d51

Browse files
kandersolarcwhanse
authored andcommitted
Add Contributing section about gallery examples (pvlib#905)
* add section about gallery examples to contributing guide * whatsnew * whatsnew cleanup * add review suggestion
1 parent 4104062 commit 1441d51

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

docs/sphinx/source/contributing.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,40 @@ To build the docs locally, install the ``doc`` dependencies specified in the
254254
`setup.py <https://github.com/pvlib/pvlib-python/blob/master/setup.py>`_
255255
file. See :ref:`installation` instructions for more information.
256256

257+
Example Gallery
258+
---------------
259+
260+
The example gallery uses `sphinx-gallery <https://sphinx-gallery.github.io/>`_
261+
and is generated from script files in the
262+
`docs/examples <https://github.com/pvlib/pvlib-python/tree/master/docs/examples>`_
263+
directory. sphinx-gallery will execute example files that start with
264+
``plot_`` and capture the output.
265+
266+
Here is a starter template for new examples:
267+
268+
.. code-block:: python
269+
270+
"""
271+
Page Title
272+
==========
273+
274+
A sentence describing the example.
275+
"""
276+
277+
# %%
278+
# Explanatory text about the example, what it does, why it does it, etc.
279+
# Text in the comment block before the first line of code `import pvlib`
280+
# will be printed to the example's webpage.
281+
282+
import pvlib
283+
import matplotlib.pyplot as plt
284+
285+
plt.scatter([1, 2, 3], [4, 5, 6])
286+
plt.show()
287+
288+
For more details, see the sphinx-gallery
289+
`docs <https://sphinx-gallery.github.io/stable/syntax.html#embedding-rst>`_.
290+
257291
.. _testing:
258292

259293
Testing

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ Bug fixes
4242

4343
Documentation
4444
~~~~~~~~~~~~~
45-
* Add NumFOCUS affiliation to Sphinx documentation :pull:`862`
46-
* Add example of IV curve generation :pull:`872`
45+
* Add NumFOCUS affiliation to Sphinx documentation (:pull:`862`)
46+
* Add example of IV curve generation (:pull:`872`)
47+
* Add section about gallery examples to Contributing guide (:pull:`905`)
4748

4849
Requirements
4950
~~~~~~~~~~~~

0 commit comments

Comments
 (0)