Skip to content

Commit 907d217

Browse files
daquinterodaquinteroflex
authored andcommitted
FEAT: The big documentation upgrade 🚀
1 parent 49d740e commit 907d217

File tree

151 files changed

+14728
-648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+14728
-648
lines changed

.binder/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
tidy3d
2+
tmm
3+
nlopt
4+
tqdm
5+
gdspy

.gitattributes

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1+
# Linguist-vendored files
12
docs/* linguist-vendored
23
notebooks/* linguist-vendored
34
tests/* linguist-vendored
45

6+
# Disable linguist detection for IPython notebooks
57
*.ipynb linguist-detectable=false
8+
9+
# Mark IPython notebooks as generated files
610
*.ipynb linguist-generated=true
711

8-
CHANGELOG.md merge=union
12+
# Specify merge attributes for CHANGELOG.md
13+
CHANGELOG.md merge=union
14+
15+
# Specify diff and merge attributes for IPython notebooks
16+
*.ipynb diff=jupyternotebook
17+
*.ipynb merge=jupyternotebook

.gitconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[diff "jupyternotebook"]
2+
command = git-nbdiffdriver diff
3+
[merge "jupyternotebook"]
4+
driver = git-nbmergedriver merge %O %A %B %L %P
5+
name = jupyter notebook merge driver
6+
[difftool "nbdime"]
7+
cmd = git-nbdifftool diff \"$LOCAL\" \"$REMOTE\" \"$BASE\"
8+
[difftool]
9+
prompt = false
10+
[mergetool "nbdime"]
11+
cmd = git-nbmergetool merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
12+
[mergetool]
13+
prompt = false

.github/workflows/run_tests.yml

+47-8
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Tidy3dTests
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ develop ]
6+
branches: [ development ]
77
pull_request:
88
branches:
9-
- develop
9+
- development
1010
- 'pre/*'
1111

1212
jobs:
@@ -15,18 +15,57 @@ jobs:
1515
runs-on: ${{ matrix.platform }}
1616
strategy:
1717
matrix:
18-
python-version: ['3.8', '3.9', '3.10', '3.11']
18+
python-version: ['3.9', '3.10', '3.11']
1919
platform: [ubuntu-latest, macos-latest, windows-latest]
20+
defaults:
21+
run:
22+
shell: bash
23+
env: # Set environment variables for the whole job
24+
PIP_FIND_LINKS: https://whls.blob.core.windows.net/unstable/index.html
25+
PIP_ONLY_BINARY: gdstk
26+
MPLBACKEND: agg
2027
steps:
2128
- uses: actions/checkout@v1
2229
- name: Set up Python ${{ matrix.python-version }}
2330
uses: actions/setup-python@v2
2431
with:
2532
python-version: ${{ matrix.python-version }}
33+
#----------------------------------------------
34+
# ----- install & configure poetry -----
35+
#----------------------------------------------
36+
- name: Install Poetry
37+
uses: snok/install-poetry@v1
38+
with:
39+
version: 1.6.1
40+
virtualenvs-create: true
41+
virtualenvs-in-project: true
42+
#----------------------------------------------
43+
# load cached venv if cache exists
44+
#----------------------------------------------
45+
- name: Load cached venv
46+
id: cached-poetry-dependencies
47+
uses: actions/cache@v3
48+
with:
49+
path: .venv
50+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
51+
#----------------------------------------------
52+
# install dependencies if cache does not exist
53+
#----------------------------------------------
2654
- name: Install dependencies
55+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
56+
run: poetry install --no-interaction --no-root -E dev
57+
#----------------------------------------------
58+
# install your root project, if required
59+
#----------------------------------------------
60+
- name: Install library
61+
run: poetry install --no-interaction -E dev
62+
#----------------------------------------------
63+
# add matrix specifics and run test suite
64+
#----------------------------------------------
65+
- name: Run tests
2766
run: |
28-
python -m pip install --upgrade pip
29-
pip install tox-gh-actions
30-
pip install tox
31-
- name: Test with tox
32-
run: tox
67+
source $VENV
68+
black . --check --diff
69+
ruff check tidy3d --fix --exit-non-zero-on-fix
70+
pytest -rA tests
71+
pytest -rA tests/test_data/_test_datasets_no_vtk.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: sync-to-readthedocs-repo
2+
permissions:
3+
contents: write
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- latest
9+
- repo_merge_no_history
10+
workflow_dispatch:
11+
inputs:
12+
env:
13+
description: environment
14+
default: dev
15+
required: true
16+
jobs:
17+
set_env:
18+
outputs:
19+
env: ${{ steps.setenv.outputs.env }}
20+
dest-branch: ${{ steps.dest-branch.outputs.branch }}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- id: setenv
24+
run: |
25+
if test -n "${{ github.event.inputs.env }}"
26+
then
27+
echo "::set-output name=env::${{ github.event.inputs.env }}"
28+
echo "ENV=${{ github.event.inputs.env }}" >> $GITHUB_ENV
29+
elif test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/latest'
30+
then
31+
echo "::set-output name=env::dev"
32+
echo "ENV=dev" >> $GITHUB_ENV
33+
elif test "${{ github.event_name }}" = 'push' -a "${{ github.ref }}" = 'refs/heads/main'
34+
then
35+
echo "::set-output name=env::prod"
36+
echo "ENV=prod" >> $GITHUB_ENV
37+
else
38+
echo "::set-output name=env::dev"
39+
echo "ENV=dev" >> $GITHUB_ENV
40+
fi
41+
- id: dest-branch
42+
run: |
43+
case ${{ env.ENV }} in
44+
dev)
45+
echo "::set-output name=branch::repo_merge_no_history"
46+
;;
47+
prod)
48+
echo "::set-output name=branch::main"
49+
;;
50+
esac
51+
build-and-deploy:
52+
needs: set_env
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v3
57+
- uses: JamesIves/github-pages-deploy-action@v4
58+
with:
59+
folder: .
60+
token: ${{ secrets.GH_PAT }}
61+
repository-name: flexcompute-readthedocs/tidy3d-docs
62+
target-folder: .
63+
branch: ${{ needs.set_env.outputs.dest-branch }}

0 commit comments

Comments
 (0)