Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .github/workflows/tidy3d-python-client-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,27 @@ jobs:
run: |
mypy --config-file=pyproject.toml

ensure-common-imports:
name: ensure-common-imports
needs: determine-test-scope
if: needs.determine-test-scope.outputs.code_quality_tests == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false
persist-credentials: false

- name: set-python-3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Run tidy3d._common import check
run: |
python scripts/ensure_imports_from_common.py

zizmor:
name: Run zizmor 🌈
runs-on: ubuntu-latest
Expand Down Expand Up @@ -983,6 +1004,7 @@ jobs:
- remote-tests
- lint
- mypy
- ensure-common-imports
- verify-schema-change
- lint-commit-messages
- lint-branch-name
Expand All @@ -1004,6 +1026,12 @@ jobs:
run: |
echo "❌ Mypy type checking failed."
exit 1

- name: check-common-imports-result
if: ${{ needs.determine-test-scope.outputs.code_quality_tests == 'true' && needs.ensure-common-imports.result != 'success' && needs.ensure-common-imports.result != 'skipped' }}
run: |
echo "❌ tidy3d._common import check failed."
exit 1

- name: check-schema-change-verification
if: ${{ needs.determine-test-scope.outputs.code_quality_tests == 'true' && needs.verify-schema-change.result != 'success' && needs.verify-schema-change.result != 'skipped' }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Batch JSON files
batch*.json
*.vtu
simulation.json

# Byte-compiled / optimized / DLL files
*$py.class
Expand Down
5 changes: 5 additions & 0 deletions docs/api/plugins/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Plugins
=======

.. warning::

|:warning:| The 'adjoint' plugin (legacy JAX-based adjoint plugin)
was deprecated in Tidy3D 'v2.7.0' and is disabled as of 'v2.9.0'.

.. toctree::
:maxdepth: 1

Expand Down
53 changes: 46 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 10 additions & 61 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ numpy = "<2.4.0"
matplotlib = "*"
shapely = "^2.0"
pandas = "*"
pydantic = "^2.0"
pydantic = ">=2.9,<3"
pydantic-settings = "^2.10.0"
PyYAML = "*"
dask = "*"
toml = "*"
Expand Down Expand Up @@ -309,7 +310,13 @@ banned-module-level-imports = ["scipy", "matplotlib"]

[tool.pytest.ini_options]
# TODO: remove --assert=plain when https://github.com/scipy/scipy/issues/22236 is resolved
addopts = "--cov=tidy3d --doctest-modules -n auto --dist worksteal --assert=plain -m 'not numerical'"
# TODO(yaugenst-flex): Revisit adjoint plugin for pydantic v2
addopts = """
--doctest-modules -n auto --dist worksteal --assert=plain -m 'not numerical' \
--ignore=tests/test_plugins/test_adjoint.py \
--ignore=tidy3d/plugins/adjoint/
--ignore=tests/test_plugins/test_adjoint.py
"""
markers = [
"numerical: marks numerical tests for adjoint gradients that require running simulations (deselect with '-m \"not numerical\"')",
]
Expand All @@ -332,82 +339,24 @@ python_files = "*.py"
[tool.mypy]
python_version = "3.10"
files = [
"tidy3d/web",
"tidy3d/config",
"tidy3d/material_library",
"tidy3d/components/geometry"
"tidy3d",
]
ignore_missing_imports = true
follow_imports = "skip"
disallow_untyped_defs = true
disable_error_code = [
"abstract",
"annotation-unchecked",
"arg-type",
"assert-type",
"assignment",
"attr-defined",
"await-not-async",
"call-arg",
"call-overload",
"comparison-overlap",
"dict-item",
"empty-body",
"exit-return",
"explicit-override",
"func-returns-value",
"has-type",
"ignore-without-code",
"import",
"import-not-found",
"import-untyped",
"index",
"list-item",
"literal-required",
"method-assign",
"misc",
"mutable-override",
"name-defined",
"name-match",
"narrowed-type-not-subtype",
"no-any-return",
"no-any-unimported",
"no-overload-impl",
"no-redef",
"no-untyped-call",
"operator",
"overload-cannot-match",
"overload-overlap",
"override",
"possibly-undefined",
"prop-decorator",
"redundant-cast",
"redundant-expr",
"redundant-self",
"return",
"return-value",
"safe-super",
"str-bytes-safe",
"str-format",
"syntax",
"top-level-await",
"truthy-bool",
"truthy-function",
"truthy-iterable",
"type-abstract",
"type-arg",
"type-var",
"typeddict-item",
"typeddict-readonly-mutated",
"typeddict-unknown-key",
"unimported-reveal",
"union-attr",
"unreachable",
"unused-awaitable",
"unused-coroutine",
"unused-ignore",
"used-before-def",
"valid-newtype",
"valid-type",
"var-annotated",
]
Expand Down
Loading