Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 76b3a01

Browse files
authored
Merge pull request #6 from kanderso-nrel/jb-setup
Add jupyter-book config
2 parents 00bf396 + a160366 commit 76b3a01

12 files changed

+181
-79
lines changed

.github/workflows/build-gh-pages.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: deploy-book
2+
3+
# Only run this when the main branch changes
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
# This job installs dependencies, build the book, and pushes it to `gh-pages`
10+
jobs:
11+
deploy-book:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
# Install dependencies
17+
- name: Set up Python 3.7
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.7
21+
22+
- name: Install dependencies
23+
run: |
24+
pip install -r requirements.txt
25+
pip install jupyter-book
26+
27+
# Build the book
28+
- name: Build the book
29+
run: |
30+
jupyter-book build .
31+
32+
# Push the book's HTML to github-pages
33+
- name: GitHub Pages action
34+
uses: peaceiris/[email protected]
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./_build/html

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.ipynb_checkpoints
22
*.py
33
*.html
4+
5+
_build

Tutorial 0 - Overview.ipynb

+13-13
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"cell_type": "markdown",
3131
"metadata": {},
3232
"source": [
33-
"# More on your teachers:\n",
33+
"## More on your teachers:\n",
3434
"\n",
3535
"The three of us have ample experience in data, coding, and PV field performance modeling, so we look forward to all of your questions.\n",
3636
"\n",
@@ -49,7 +49,7 @@
4949
}
5050
},
5151
"source": [
52-
"### Learning Objectives\n",
52+
"## Learning Objectives\n",
5353
"\n",
5454
"1.\tAccess weather data (TMY3), understand irradiance data, and visualize it monthly.\n",
5555
"2.\tCalculate sun position, plane of array irradiance, and aggregate irradiance data into average daily insolation by month and year.\n",
@@ -91,7 +91,7 @@
9191
}
9292
},
9393
"source": [
94-
"# How to use this tutorial?\n",
94+
"## How to use this tutorial?\n",
9595
"\n",
9696
"This tutorial is a [Jupyter](https://jupyter.org) notebook. Jupyter is a browser based interactive tool that combines text, images, equations, and code that can be shared with others. Please see the setup section in the [README](./README.md) to learn more about how to get started."
9797
]
@@ -151,7 +151,7 @@
151151
}
152152
},
153153
"source": [
154-
"# Exercise: Print Hello, world!\n",
154+
"## Exercise: Print Hello, world!\n",
155155
"\n",
156156
"Each notebook will have exercises for you to solve. You'll be given a blank or\n",
157157
"partially completed cell, followed by a hidden cell with a solution. For\n",
@@ -186,7 +186,7 @@
186186
"cell_type": "markdown",
187187
"metadata": {},
188188
"source": [
189-
"#### Exercise 1: Modify to print something else:"
189+
"## Exercise 1: Modify to print something else:"
190190
]
191191
},
192192
{
@@ -203,12 +203,12 @@
203203
"cell_type": "markdown",
204204
"metadata": {},
205205
"source": [
206-
"# Let's go over some Python Concepts\n",
206+
"## Let's go over some Python Concepts\n",
207207
"\n",
208208
"(A lot of this examples were shamely taken from https://jckantor.github.io/CBE30338/01.01-Getting-Started-with-Python-and-Jupyter-Notebooks.html :$)\n",
209209
"\n",
210210
"\n",
211-
"### Basic Arithmetic Operations\n",
211+
"## Basic Arithmetic Operations\n",
212212
"\n",
213213
"Basic arithmetic operations are built into the Python langauge. Here are some examples. In particular, note that exponentiation is done with the ** operator."
214214
]
@@ -244,7 +244,7 @@
244244
"cell_type": "markdown",
245245
"metadata": {},
246246
"source": [
247-
"### Python Libraries\n",
247+
"## Python Libraries\n",
248248
"\n",
249249
"The Python language has only very basic operations. Most math functions are in various math libraries. The numpy library is convenient library. This next cell shows how to import numpy with the prefix np, then use it to call a common mathematical functions."
250250
]
@@ -312,7 +312,7 @@
312312
"cell_type": "markdown",
313313
"metadata": {},
314314
"source": [
315-
"### Concatenation\n",
315+
"## Concatenation\n",
316316
"\n",
317317
"Concatentation is the operation of joining one list to another."
318318
]
@@ -364,7 +364,7 @@
364364
"cell_type": "markdown",
365365
"metadata": {},
366366
"source": [
367-
"### Loops"
367+
"## Loops"
368368
]
369369
},
370370
{
@@ -392,7 +392,7 @@
392392
"cell_type": "markdown",
393393
"metadata": {},
394394
"source": [
395-
"### Working with Dictionaries\n",
395+
"## Working with Dictionaries\n",
396396
"\n",
397397
"Dictionaries are useful for storing and retrieving data as key-value pairs. For example, here is a short dictionary of molar masses. The keys are molecular formulas, and the values are the corresponding molar masses.\n"
398398
]
@@ -438,7 +438,7 @@
438438
"cell_type": "markdown",
439439
"metadata": {},
440440
"source": [
441-
"### Plotting\n",
441+
"## Plotting\n",
442442
"\n",
443443
"Importing the matplotlib.pyplot library gives IPython notebooks plotting functionality very similar to Matlab's. Here are some examples using functions from the"
444444
]
@@ -487,7 +487,7 @@
487487
}
488488
},
489489
"source": [
490-
"# Going Deeper\n",
490+
"## Going Deeper\n",
491491
"\n",
492492
"We've designed the notebooks above to cover the basics of pvlib from beginning\n",
493493
"to end. To help you go deeper, we've also create a list of notebooks that\n",

Tutorial 1 - TMY Weather Data.ipynb

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@
3535
}
3636
},
3737
"source": [
38-
"### Steps:\n",
38+
"## Steps:\n",
3939
"- [Weather data in PV performance models](#Weather-Data-&-PV)\n",
4040
"- Looking at a sample weather data file\n",
4141
"- Where to get weather data from? \n",
4242
"- Weather data to API\n",
4343
"\n",
44-
"### PV Concepts:\n",
44+
"## PV Concepts:\n",
4545
"- TMY\n",
4646
"- GHI, DNI, DHI\n",
4747
"- DryBulb, Wspd\n",
4848
"- Irradiance vs. Insolation\n",
4949
"\n",
50-
"### Python Concepts:\n",
50+
"## Python Concepts:\n",
5151
"- Exploring a Pandas dataframe (`df`): `len()`, `df.head()`, `df.keys()`\n",
5252
"- [pvlib input-output tools](https://pvlib-python.readthedocs.io/en/stable/api.html#io-tools)\n",
5353
"- Ploting a Pandas dataframe (`df`): `df.plot()`\n",
@@ -63,7 +63,7 @@
6363
}
6464
},
6565
"source": [
66-
"# Weather Data & PV \n",
66+
"## Weather Data & PV \n",
6767
"\n",
6868
"Weather and irradiance data are used as input to PV performance models. \n",
6969
"\n",
@@ -120,7 +120,7 @@
120120
}
121121
},
122122
"source": [
123-
"#### First Step: Import Libraries\n",
123+
"## First Step: Import Libraries\n",
124124
"\n",
125125
"In Python, some functions are builtin like `print()` but others must be imported before they can be used. For this notebook we're going to import three packages:\n",
126126
"* [pvlib](https://pvlib-python.readthedocs.io/en/stable/) - library for simulating performance of photovoltaic energy systems. \n",
@@ -725,7 +725,7 @@
725725
}
726726
},
727727
"source": [
728-
"# Irradiance \n",
728+
"## Irradiance \n",
729729
"\n",
730730
"Irradiance is an instantaneous measurement of solar power over some area. For practical purposes of measurement and interpretation, irradiance is expressed and separated into different components.\n",
731731
"\n",
@@ -742,7 +742,7 @@
742742
}
743743
},
744744
"source": [
745-
"### Wind\n",
745+
"## Wind\n",
746746
"\n",
747747
"Wind speed is measured with an anemometer. The most common type is a the cup-type anemometer, shown on the right side of the picture below. The number of rotations per time interval is used to calculate the wind speed. The vane on the left is used to measure the direction of the wind. Wind direction is reported as the direction from which the wind is blowing.\n",
748748
"\n",
@@ -757,7 +757,7 @@
757757
}
758758
},
759759
"source": [
760-
"### Air temperature \n",
760+
"## Air temperature \n",
761761
"\n",
762762
"Also known as dry-bulb temperature, is the temperature of the ambient air when the measurement device is shielded from radiation and moisture. The most common method of air temperature measurement uses a resistive temperature device (RTD) or thermocouple within a radiation shield. The shield blocks sunlight from reaching the sensor (avoiding radiative heating), yet allows natural air flow around the sensor. More accurate temperature measurement devices utilize a shield which forces air across the sensor.\n",
763763
"\n",
@@ -776,7 +776,7 @@
776776
}
777777
},
778778
"source": [
779-
"#### Downselect columns \n",
779+
"## Downselect columns \n",
780780
"\n",
781781
"There are a lot more weather data in that file that you can access. To investigate all the column headers, we used `.keys()` above. Always read the [Instruction Manual](https://www.nrel.gov/docs/fy08osti/43156.pdf) for the weather files to get more details on how the data is aggregated, units, etc.\n",
782782
"\n",
@@ -1138,7 +1138,7 @@
11381138
"cell_type": "markdown",
11391139
"metadata": {},
11401140
"source": [
1141-
"## Temperature\n",
1141+
"### Temperature\n",
11421142
"\n",
11431143
"Next up is temperature:"
11441144
]
@@ -1299,7 +1299,7 @@
12991299
"cell_type": "markdown",
13001300
"metadata": {},
13011301
"source": [
1302-
"#### Exercise\n",
1302+
"### Exercise\n",
13031303
"\n",
13041304
"Plot the Average DNI per Day"
13051305
]
@@ -1333,7 +1333,7 @@
13331333
}
13341334
},
13351335
"source": [
1336-
"# Where to get Solar Irradiance Data?\n",
1336+
"## Where to get Solar Irradiance Data?\n",
13371337
"\n",
13381338
"There are many different sources of solar irradiance data. For your projects, these are some of the most common:\n",
13391339
"\n",
@@ -1368,7 +1368,7 @@
13681368
}
13691369
},
13701370
"source": [
1371-
"### Fetching TMYs from the NSRDB\n",
1371+
"## Fetching TMYs from the NSRDB\n",
13721372
"\n",
13731373
"The example TMY dataset used here is from an airport in North Carolina, but what if we wanted to model a PV system somewhere else? The NSRDB, one of many sources of weather data intended for PV modeling, is free and easy to access using pvlib. As an example, we'll fetch a TMY dataset for Albuquerque, New Mexico at coordinates [(35.0844, -106.6504)](https://www.google.com/maps/@35.0844,-106.6504,9z). We use [`pvlib.iotools.get_psm3()`](https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.iotools.get_psm3.html) which returns a Python dictionary of metadata and a Pandas dataframe of the timeseries weather data."
13741374
]

Tutorial 2 - POA Irradiance.ipynb

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"![tutorialpromo](images/tutorial_banner.PNG)\n",
8+
"\n",
9+
"\n",
710
"# Tutorial 2 - POA Irradiance\n",
811
"\n",
912
"This notebook shows how to use pvlib to transform the three irradiance components (GHI, DHI, and DNI) into POA irradiance, the main driver of a PV system.\n",
@@ -15,13 +18,13 @@
1518
"cell_type": "markdown",
1619
"metadata": {},
1720
"source": [
18-
"### PV Concepts\n",
21+
"## PV Concepts\n",
1922
"- Plane of Array Irradiance\n",
2023
"- Angle of Incidence\n",
2124
"- Time delta for solar position\n",
2225
"- GHI vs POA for fixed tilt system and tracked systems\n",
2326
"\n",
24-
"### Python Concepts\n",
27+
"## Python Concepts\n",
2528
"- pandas Timedelta\n",
2629
"- making a new dataframe from existing columns\n",
2730
"- resampling\n",
@@ -36,7 +39,7 @@
3639
"\n",
3740
"The amount of sunlight collected by a PV panel depends on how well the panel orientation matches incoming sunlight. For example, a rooftop array facing West will produce hardly any energy in the morning when the sun is in the East because the panel can only \"see\" the dim part of the sky away from the sun. \n",
3841
"\n",
39-
"[Overview](images/t2_solarpanel_directions.PNG)\n",
42+
"![Overview](images/t2_solarpanel_directions.PNG)\n",
4043
"\n",
4144
"\n",
4245
"As the sun comes into view and moves towards the center of the panel's field of view, the panel will collect more and more irradiance. This concept is what defines plane-of-array irradiance -- the amount of sunlight available to be collected at a given panel orientation. Like the three \"basic\" irradiance components, POA irradiance is measured in watts per square meter."
@@ -255,7 +258,7 @@
255258
"cell_type": "markdown",
256259
"metadata": {},
257260
"source": [
258-
"#### Fixed Tilt POA:"
261+
"## Fixed Tilt POA"
259262
]
260263
},
261264
{
@@ -308,7 +311,7 @@
308311
"cell_type": "markdown",
309312
"metadata": {},
310313
"source": [
311-
"### What's angle should you tilt your modules at?"
314+
"### What angle should you tilt your modules at?"
312315
]
313316
},
314317
{
@@ -547,7 +550,7 @@
547550
"name": "python",
548551
"nbconvert_exporter": "python",
549552
"pygments_lexer": "ipython3",
550-
"version": "3.7.10"
553+
"version": "3.7.3"
551554
}
552555
},
553556
"nbformat": 4,

Tutorial 3 - Module Temperature.ipynb

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"![tutorialpromo](images/tutorial_banner.PNG)\n",
8+
"\n",
9+
"\n",
710
"# Tutorial 3 - Module Temperature\n",
811
"\n",
912
"This notebook shows how to use pvlib to estimate PV cell temperature, a secondary driver that affects the PV conversion efficiency.\n",
@@ -16,13 +19,13 @@
1619
"cell_type": "markdown",
1720
"metadata": {},
1821
"source": [
19-
"### PV Concepts in this lesson:\n",
22+
"## PV Concepts in this lesson:\n",
2023
"\n",
2124
"* cell and module temperature\n",
2225
"* NSRDB data\n",
2326
"* TMY files\n",
2427
"\n",
25-
"### Python concepts in this lesson:\n",
28+
"## Python concepts in this lesson:\n",
2629
"\n",
2730
"* file system paths in Python with [`pathlib`](https://docs.python.org/3/library/pathlib.html)\n",
2831
"* parsing NSRDB data with [`pvlib.iotools.read_tmy3`](https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.iotools.read_tmy3.html)\n",
@@ -253,7 +256,7 @@
253256
"cell_type": "markdown",
254257
"metadata": {},
255258
"source": [
256-
"## Pop Quix\n",
259+
"## Pop Quiz\n",
257260
"Now it's your turn. There's another, older TMY3 file in the pvlib data folder: \"703165TY.csv\".\n",
258261
"1. Create a path to the TMY3 file: \"703165TY.csv\" using `DATA_DIR` and the `/` operator\n",
259262
"2. read the timeseries and metadata from the file\n",
@@ -307,7 +310,7 @@
307310
"name": "python",
308311
"nbconvert_exporter": "python",
309312
"pygments_lexer": "ipython3",
310-
"version": "3.7.10"
313+
"version": "3.7.3"
311314
}
312315
},
313316
"nbformat": 4,

0 commit comments

Comments
 (0)