-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from gdsfactory/test_docs
add docs
- Loading branch information
Showing
18 changed files
with
369 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if __name__ == "__main__": | ||
from gdsfactory.config import PATH | ||
|
||
dirpath = PATH.repo / "docs" / "build" / "_html" / "reports" | ||
error_files = list(dirpath.glob("*err.log")) | ||
|
||
if error_files: | ||
for error_file in error_files: | ||
error = error_file.read_text() | ||
print(error) | ||
raise ValueError(f"{len(error_files)} errors in notebooks") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Sphinx docs to gh-pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
name: Sphinx docs to gh-pages | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
cache-dependency-path: pyproject.toml | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gdsfactory/ | ||
key: 0.0.1 | ||
restore-keys: 0.0.1 | ||
- name: Installing the library | ||
env: | ||
TIDY3D_USER: ${{ secrets.TIDY3D_EMAIL }} | ||
TIDY3D_PASS: ${{ secrets.TIDY3D_PASSWORD }} | ||
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }} | ||
DISPLAY: 1.0 | ||
DOCS: True | ||
GDSFACTORY_DISPLAY_TYPE: klayout | ||
shell: bash -l {0} | ||
run: | | ||
make dev | ||
make docs | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: "./docs/_build/html/" | ||
|
||
deploy-docs: | ||
needs: build-docs | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Test pre-commit, code and docs | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- uses: pre-commit/[email protected] | ||
test_docs: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
max-parallel: 12 | ||
matrix: | ||
python-version: [3.11] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
cache-dependency-path: pyproject.toml | ||
- name: Install dependencies | ||
run: | | ||
make dev | ||
pip freeze > requirements.txt | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: requirements | ||
path: requirements.txt | ||
- name: Test documentation | ||
env: | ||
TIDY3D_USER: ${{ secrets.TIDY3D_EMAIL }} | ||
TIDY3D_PASS: ${{ secrets.TIDY3D_PASSWORD }} | ||
DISPLAY: 1.0 | ||
DOCS: True | ||
GDSFACTORY_DISPLAY_TYPE: klayout | ||
run: | | ||
mkdir -p $HOME/.tidy3d | ||
make docs | ||
python .github/test_doc_errors.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,12 @@ __pycache__/ | |
# C extensions | ||
*.so | ||
|
||
|
||
# Sims | ||
*.fsp | ||
*.csv | ||
*.msh | ||
*.gds | ||
*.yml | ||
notebooks/*.yml | ||
*.stl | ||
*.oas | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
install: | ||
pip install -e .[dev,docs] | ||
pip install pre-commit | ||
pre-commit install | ||
|
||
dev: install | ||
|
||
update-pre: | ||
pre-commit autoupdate | ||
|
||
git-rm-merged: | ||
git branch -D `git branch --merged | grep -v \* | xargs` | ||
|
||
docs: | ||
jb build docs |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Book settings | ||
# Learn more at https://jupyterbook.org/customize/config.html | ||
|
||
title: pictraining | ||
author: gdsfactory | ||
|
||
# Force re-execution of notebooks on each build. | ||
# See https://jupyterbook.org/content/execute.html | ||
execute: | ||
execute_notebooks: cache | ||
timeout: -1 | ||
allow_errors: true | ||
# timeout: -1 | ||
# execute_notebooks: force | ||
# execute_notebooks: "off" | ||
# exclude_patterns: | ||
# - '*notebooks/devsim/01_pin_waveguide*' | ||
|
||
latex: | ||
latex_engine: pdflatex # one of 'pdflatex', 'xelatex' (recommended for unicode), 'luatex', 'platex', 'uplatex' | ||
use_jupyterbook_latex: true # use sphinx-jupyterbook-latex for pdf builds as default | ||
|
||
# Add a bibtex file so that we can create citations | ||
|
||
html: | ||
home_page_in_navbar: true | ||
use_edit_page_button: true | ||
use_repository_button: true | ||
use_issues_button: true | ||
baseurl: https://github.com/gdsfactory/gdsfactory-photonics-training | ||
|
||
# Information about where the book exists on the web | ||
repository: | ||
url: https://github.com/gdsfactory/gdsfactory-photonics-training | ||
path_to_book: docs # Optional path to your book, relative to the repository root | ||
branch: main # Which branch of the repository should be used when creating links (optional) | ||
|
||
# launch_buttons: | ||
# notebook_interface: jupyterlab | ||
# colab_url: "https://colab.research.google.com" | ||
|
||
sphinx: | ||
extra_extensions: | ||
- "sphinx.ext.autodoc" | ||
- "sphinx.ext.autodoc.typehints" | ||
- "sphinx.ext.autosummary" | ||
- "sphinx.ext.napoleon" | ||
- "sphinx.ext.viewcode" | ||
- "matplotlib.sphinxext.plot_directive" | ||
config: | ||
#autodoc_typehints: description | ||
html_js_files: | ||
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js | ||
autodoc_type_aliases: | ||
"ComponentSpec": "ComponentSpec" | ||
nb_execution_show_tb: True | ||
nb_execution_raise_on_error: true | ||
nb_custom_formats: | ||
.py: | ||
- jupytext.reads | ||
- fmt: py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Table of contents | ||
# Learn more at https://jterbook.org/customize/toc.html | ||
|
||
format: jb-book | ||
root: index | ||
chapters: | ||
- file: layout | ||
sections: | ||
- file: notebooks/10_layout.ipynb | ||
- file: notebooks/11_drc.ipynb | ||
- file: notebooks/20_modesolver_fem.ipynb | ||
- file: notebooks/21_modesolver_fdfd.ipynb | ||
- file: notebooks/22_heater_fem.ipynb | ||
- file: notebooks/30_mzi.ipynb | ||
- file: notebooks/31_ring.ipynb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
```{include} ../README.md | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Tutorial | ||
|
||
```{tableofcontents} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../notebooks |
Oops, something went wrong.