Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port notebooks to a gallery #1818

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
101ea18
atmosphere.ipynb
echedey-ls Jul 31, 2023
ee4b30e
List fix
echedey-ls Jul 31, 2023
accf4c2
Irradiance tuto, missing TODOs
echedey-ls Jul 31, 2023
34033ef
rename folder
echedey-ls Jul 31, 2023
14b32e4
move folder to docs
echedey-ls Jul 31, 2023
4885742
bring atmosphere.ipynb back to life
echedey-ls Jul 31, 2023
90bda69
Make tutorials a gallery (see description TODO)
echedey-ls Jul 31, 2023
4f04b1a
I hope this was left commented because of unnecessary and not because…
echedey-ls Jul 31, 2023
244dafd
Btw, this would make it match files ending in .py, and not something …
echedey-ls Jul 31, 2023
52adb89
Rename dirs
echedey-ls Jul 31, 2023
6866c40
Formatted with black
echedey-ls Jul 31, 2023
ea1aba0
Revert "Btw, this would make it match files ending in .py, and not so…
echedey-ls Jul 31, 2023
275056d
Found it, now it does the reverted change thing
echedey-ls Jul 31, 2023
5c4bcf3
Hmmm
echedey-ls Jul 31, 2023
d13cd8a
Andddd this
echedey-ls Jul 31, 2023
f136a27
require ephem to build docs
echedey-ls Jul 31, 2023
804d503
Solve timeit problem (hopefully)
echedey-ls Jul 31, 2023
e197228
I don't know how to make this work
echedey-ls Aug 1, 2023
3c54c9c
(This was left uncommented but relates to previous commit)
echedey-ls Aug 1, 2023
71b4aac
Create solarposition.py with jupyter nbconvert
echedey-ls Aug 2, 2023
bd832e7
Edit solarposition.py
echedey-ls Aug 2, 2023
7b55aae
Update irradiance.py
echedey-ls Aug 2, 2023
0abeade
Update atmosphere.py
echedey-ls Aug 2, 2023
d28eae6
Manually transcript pvsystem.ipynb (last one)
echedey-ls Aug 2, 2023
d33ecb0
Special thanks to black and my patience
echedey-ls Aug 2, 2023
e43f931
Rename to 'Tutorials'
echedey-ls Aug 3, 2023
b427746
Create tmy_and_diffuse_irrad_models.py
echedey-ls Aug 3, 2023
77cbd41
Create tmy_to_power.py
echedey-ls Aug 3, 2023
13b44a3
Create tmy.py
echedey-ls Aug 3, 2023
782af2f
Create tracking.py
echedey-ls Aug 3, 2023
b26229e
Fix atmosphere.py
echedey-ls Aug 3, 2023
0808d61
Remove dependency inside tracking.py
echedey-ls Aug 3, 2023
5e4700c
Update unordered lists
echedey-ls Aug 3, 2023
e57dbc2
Rendering updates
echedey-ls Aug 3, 2023
7cbb9cb
Fix irradiance?
echedey-ls Aug 4, 2023
b36ed64
Add print statements to raw timeits
echedey-ls Aug 6, 2023
048b2cd
Remove some kind of TODO...
echedey-ls Aug 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Example Gallery
===============

This gallery shows examples of pvlib functionality. Community contributions are welcome!
This gallery shows examples of pvlib functionality. Community contributions are welcome!
10 changes: 7 additions & 3 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,14 @@ def setup(app):

# settings for sphinx-gallery
sphinx_gallery_conf = {
'examples_dirs': ['../../examples'], # location of gallery scripts
'gallery_dirs': ['gallery'], # location of generated output
'examples_dirs': [ # location of gallery scripts
'../../examples',
'../../tutorials'],
'gallery_dirs': [ # location of generated output
'gallery_examples',
'gallery_tutorials'],
# sphinx-gallery only shows plots from plot_*.py files by default:
# 'filename_pattern': '*.py',
'filename_pattern': r'.*\.py',

# directory where function/class granular galleries are stored
'backreferences_dir': 'reference/generated/gallery_backreferences',
Expand Down
3 changes: 2 additions & 1 deletion docs/sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ Contents
:maxdepth: 1

user_guide/index
gallery/index
gallery_examples/index
gallery_tutorials/index
reference/index
whatsnew
contributing
Expand Down
8 changes: 8 additions & 0 deletions docs/tutorials/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. _tutorials_gallery:

Tutorials
=========

This gallery shows tutorials about pvlib.

Community contributions are welcome!
208 changes: 0 additions & 208 deletions docs/tutorials/atmosphere.ipynb

This file was deleted.

64 changes: 64 additions & 0 deletions docs/tutorials/atmosphere.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""
``atmosphere.py`` tutorial
==========================
"""

# %%
# This tutorial needs your help to make it better!
#
# This tutorial requires pvlib > 0.6.0.
#
# Authors:
#
# - Will Holmgren (@wholmgren), University of Arizona. 2015, March 2016,
# August 2018.


import datetime

import matplotlib.pyplot as plt
import pandas as pd

from pvlib import solarposition, atmosphere
from pvlib.location import Location

# %%

tus = Location(32.2, -111, 'US/Arizona', 700, 'Tucson')
print(tus)

times = pd.date_range(start=datetime.datetime(2014, 6, 24),
end=datetime.datetime(2014, 6, 25),
freq='1Min', tz=tus.tz)

solpos = solarposition.get_solarposition(times, tus.latitude, tus.longitude)
print(solpos.head())
solpos.plot()

# %%

atmosphere.get_relative_airmass(solpos['zenith']) \
.plot(label='kastenyoung1989, zenith')
atmosphere.get_relative_airmass(solpos['apparent_zenith']) \
.plot(label='kastenyoung1989, app. zenith')
atmosphere.get_relative_airmass(solpos['zenith'], model='young1994') \
.plot(label='young1994, zenith')
atmosphere.get_relative_airmass(solpos['zenith'], model='simple') \
.plot(label='simple, zenith')
plt.legend()
plt.ylabel('Airmass')
plt.ylim(0, 100)

# %%

plt.plot(solpos['zenith'],
atmosphere.get_relative_airmass(solpos['zenith'], model='simple'),
label='simple')
plt.plot(solpos['zenith'],
atmosphere.get_relative_airmass(solpos['apparent_zenith']),
label='default')
plt.xlim(0, 100)
plt.ylim(0, 100)
plt.xlabel('Zenith angle (deg)')
plt.ylabel('Airmass')
plt.legend()
1,981 changes: 0 additions & 1,981 deletions docs/tutorials/irradiance.ipynb

This file was deleted.

Loading