Skip to content

Commit

Permalink
Merge pull request #88 from NREL/development
Browse files Browse the repository at this point in the history
Automate jupyter-books
  • Loading branch information
martin-springer authored May 6, 2024
2 parents def3a3f + bb1fa74 commit f770097
Show file tree
Hide file tree
Showing 221 changed files with 49,235 additions and 6,362 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/deploy-books.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: deploy-book

# Run this when the master or main branch changes
on:
push:
branches:
- main
# If your git repository has the Jupyter Book within some-subfolder next to
# unrelated files, you can make this run only if a file within that specific
# folder has been modified.
#
# paths:
# - some-subfolder/**

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v3

# Install dependencies
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies
run: |
pip install .[books]
# (optional) Cache your executed notebooks between runs
# if you have config:
# execute:
# execute_notebooks: cache
- name: cache executed notebooks
uses: actions/cache@v3
with:
path: _build/.jupyter_cache
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}

# Build the book
- name: Build the book
run: |
jupyter-book build tutorials_and_tools
# Upload the book's HTML as an artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "tutorials_and_tools/_build/html"

# Deploy the book's HTML to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=2000"]
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions docs/source/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ What's New
==========
PVDegradationTools (pvdeg) change log:

.. include:: releases/v0.3.2.rst
.. include:: releases/v0.3.1.rst
.. include:: releases/v0.3.0.rst
.. include:: releases/v0.2.3.rst
Expand Down
14 changes: 14 additions & 0 deletions docs/source/whatsnew/releases/v0.3.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
v0.3.1 (2024-05-06)
=======================

Enhancements
------------
* Added workflow for automated deployment of jupyter-books

Bug Fixes
---------
* Re-run notebooks and fixed minor bugs

Contributors
~~~~~~~~~~~~
* Martin Springer (:ghuser:`martin-springer`)
2 changes: 1 addition & 1 deletion pvdeg/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def read(file_in, file_type, map_variables=True, **kwargs):
[psm3, tmy3, epw, h5, csv]
"""

META_MAP = {"elevation": "altitude", "Local Time Zone": "timezone"}
META_MAP = {"elevation": "altitude", "Local Time Zone": "tz"}

supported = ["psm3", "tmy3", "epw", "h5", "csv"]
file_type = file_type.upper()
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies = [
"python-dateutil",
"pytz",
"scipy",
"seaborn",
"tables",
"tqdm",
"xarray",
Expand All @@ -68,8 +69,11 @@ test = [
"pytest",
"pytest-cov",
]
books = [
"jupyter-book",
]
all = [
"pvdeg[docs,test]",
"pvdeg[docs,test,books]",
]

[project.entry-points.pvdeg]
Expand Down
Binary file modified tutorials_and_tools/_build/.doctrees/README.doctree
Binary file not shown.
Binary file modified tutorials_and_tools/_build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified tutorials_and_tools/_build/.doctrees/intro.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion tutorials_and_tools/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 86a80142bb0890d5262a8dbd1c319561
config: 99ea9d5a0b679785d9fb1ec934454af7
tags: 645f666f9bcd5a90fca523b33c5a78b7
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions tutorials_and_tools/_build/html/_sources/intro.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Welcome to the PVDEG Tutorials
# Welcome to the PVDEG Tutorials and Tools

Here is a collection of Jupyter Journals ready to read, or run in your browser
through Google Collab.
Clicking on the rocket-icon on the top allows you to launch the journals on
Here is a collection of Jupyter Journals that include tutorials and tools.
These are ready to read, install and use, or run in your browser through Google Collab.
Clicking on the rocket-icon on the top allows you to launch the journals on
[Google Colaboratory](https://colab.research.google.com/) for interactive mode.
As per the instructions on each journal, you should uncomment the first line
As per the instructions on each journal, you should uncomment the first line
that reads `pip install ...` to install the environment if you follow this mode.

You can also clone the repository and run them locally, following the
You can also clone the repository and run them locally, following the
instructions on the [PVDegTools Github page](https://github.com/NREL/PVDegradationTools)

```{tableofcontents}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# !pip install pvdeg==0.3.2"
]
},
{
Expand Down
Loading

0 comments on commit f770097

Please sign in to comment.