Skip to content

Commit c07963d

Browse files
committed
Jax plugin deprecation
1 parent cbb1fc4 commit c07963d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tidy3d/plugins/adjoint/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
"""Imports for adjoint plugin."""
2+
# ruff: noqa: E402
23

34
# import the jax version of tidy3d components
45
from __future__ import annotations
56

7+
from textwrap import dedent
8+
9+
from tidy3d.log import log
10+
11+
_DOC_URL = "https://github.com/flexcompute/tidy3d/blob/develop/tidy3d/plugins/autograd/README.md"
12+
13+
_MSG = dedent(
14+
f"""
15+
The 'adjoint' plugin (legacy JAX-based adjoint plugin) was deprecated in Tidy3D '2.7.0' and will be disabled as of '2.9.0'.
16+
17+
➤ Migrate to the native autograd workflow:
18+
import tidy3d as td
19+
import autograd.numpy as np
20+
from autograd import grad
21+
22+
It uses standard 'td.' objects, has fewer dependencies, and offers a smoother optimization experience.
23+
Full guide ↗ {_DOC_URL}
24+
"""
25+
).strip()
26+
27+
log.warning(_MSG)
28+
629
try:
730
import jax
831

0 commit comments

Comments
 (0)