Skip to content

Commit c456401

Browse files
daquinteroflexmomchil-flex
authored andcommitted
FEAT: Final touches for pre-release 🔎
1 parent 7d2c9a2 commit c456401

File tree

93 files changed

+818
-659
lines changed

Some content is hidden

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

93 files changed

+818
-659
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tidy3d Release
1+
name: "tidy3d-release"
22

33
on:
44
push:

.github/workflows/run_tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tidy3dTests
1+
name: "tidy3d-frontend-tests"
22

33
on:
44
workflow_dispatch:
@@ -28,8 +28,11 @@ jobs:
2828
runs-on: ${{ matrix.platform }}
2929
strategy:
3030
matrix:
31-
python-version: ['3.9', '3.10', '3.11']
31+
python-version: ['3.8', '3.9', '3.10', '3.11']
3232
platform: [ubuntu-latest, macos-latest, windows-latest]
33+
exclude:
34+
- python-version: '3.8'
35+
platform: 'windows-latest'
3336
defaults:
3437
run:
3538
shell: bash

.github/workflows/sync-to-readthedocs-repo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: sync-to-readthedocs-repo
1+
name: "sync-to-readthedocs-repo"
22
permissions:
33
contents: write
44
on:

.github/workflows/update_coverage.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: "tidy3d-coverage"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop, main ]
7+
pull_request:
8+
branches:
9+
- develop
10+
- 'pre/*'
11+
12+
defaults:
13+
run:
14+
shell: bash
15+
16+
env:
17+
PIP_DISABLE_PIP_VERSION_CHECK: 1
18+
FORCE_COLOR: 1 # Get colored pytest output
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
pre-commit:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: "3.10"
32+
- name: Test pre-commit hooks
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install pre-commit
36+
pre-commit run
37+
build:
38+
name: Coverage Test
39+
runs-on: ubuntu-latest
40+
defaults:
41+
run:
42+
shell: bash
43+
env: # Set environment variables for the whole job
44+
PIP_ONLY_BINARY: gdstk
45+
MPLBACKEND: agg
46+
steps:
47+
- uses: actions/checkout@v1
48+
- name: Set up Python 3.10
49+
uses: actions/setup-python@v2
50+
with:
51+
python-version: "3.10"
52+
#----------------------------------------------
53+
# ----- install & configure poetry -----
54+
#----------------------------------------------
55+
- name: Install Poetry
56+
uses: snok/install-poetry@v1
57+
with:
58+
version: 1.6.1
59+
virtualenvs-create: true
60+
virtualenvs-in-project: true
61+
#----------------------------------------------
62+
# load cached venv if cache exists
63+
#----------------------------------------------
64+
- name: Load cached venv
65+
id: cached-poetry-dependencies
66+
uses: actions/cache@v3
67+
with:
68+
path: .venv
69+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
70+
#----------------------------------------------
71+
# install dependencies if cache does not exist
72+
#----------------------------------------------
73+
- name: Install dependencies
74+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
75+
run: poetry install --no-interaction --no-root -E dev
76+
#----------------------------------------------
77+
# install your root project, if required
78+
#----------------------------------------------
79+
- name: Install library
80+
run: poetry install --no-interaction -E dev
81+
#----------------------------------------------
82+
# add matrix specifics and run test suite
83+
#----------------------------------------------
84+
- name: Run tests
85+
run: |
86+
source $VENV
87+
black . --check --diff
88+
ruff check tidy3d --fix --exit-non-zero-on-fix
89+
coverage run -m pytest -rA tests
90+
coverage report -m
91+
echo "total=$(coverage report --format=total)" >> $GITHUB_ENV
92+
echo '### Total coverage: ${{ env.total }}%'
93+
94+
- name: "Create badge"
95+
# if: ${{ github.ref == 'refs/heads/latest' }}
96+
# https://gist.githubusercontent.com/nedbat/8c6980f77988a327348f9b02bbaf67f5
97+
uses: schneegans/[email protected]
98+
with:
99+
auth: ${{ secrets.GH_TIDY3D_COVERAGE_GIST }}
100+
gistID: 4702549574741e87deaadba436218ebd
101+
filename: tidy3d_extension.json
102+
label: Coverage
103+
message: ${{ env.total }}%
104+
minColorRange: 60
105+
maxColorRange: 95
106+
valColorRange: ${{ env.total }}
107+
style: "for-the-badge"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 22.12.0
3+
rev: 23.12.1
44
hooks:
55
- id: black
66
name: black <<< NOTE:, if you get a message stating that "All done! n file(s) reformatted", you must git add and commit the changes again to complete the commit. >>>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name](https://img.shields.io/badge/pypi-tidy3d-blue?style=for-the-badge)](https:
66
![Tests](https://img.shields.io/github/actions/workflow/status/flexcompute/tidy3d/run_tests.yml?style=for-the-badge)
77
![License](https://img.shields.io/github/license/flexcompute/tidy3d?style=for-the-badge)
88
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)
9-
[//]: # (TODO add coverage label)
9+
![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/daquinteroflex/4702549574741e87deaadba436218ebd/raw/tidy3d_extension.json)
1010

1111
[![Notebooks](https://img.shields.io/badge/Demo-Live%20notebooks-8A2BE2?style=for-the-badge)](https://github.com/flexcompute/tidy3d-notebooks)
1212

docs/api/plugins/adjoint.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Adjoint
44
-------
55

6+
.. toctree::
7+
8+
adjoint_readme
9+
610
.. autosummary::
711
:toctree: ../_autosummary/
812
:template: module.rst

docs/api/plugins/adjoint_readme.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. mdinclude:: ../../../tidy3d/plugins/adjoint/README.md

docs/api/plugins/design.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
Design Space Exploration
44
------------------------
55

6-
.. mdinclude:: ../../tidy3d/plugins/design/README.md
6+
.. toctree::
7+
8+
design_readme
79

810
.. autosummary::
911
:toctree: ../_autosummary/

docs/api/plugins/design_readme.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. mdinclude:: ../../../tidy3d/plugins/design/README.md

0 commit comments

Comments
 (0)