Skip to content

Commit 5f6ddb4

Browse files
Remove gdspy (#2477)
* refactor: remove gdspy * docs: update notebooks and add changelog entry * style: remove unnecessary comment directives * style: remove unnecessary comments * style: remove comments * style: remove comment * docs: update notebooks submodule * docs: update notebooks due to rebase on develop --------- Co-authored-by: Dario Quintero (Flexcompute) <149674618+daquinteroflex@users.noreply.github.com>
1 parent c3ba184 commit 5f6ddb4

File tree

13 files changed

+133
-481
lines changed

13 files changed

+133
-481
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Changed
1515
- Relaxed bounds checking of path integrals during `WavePort` validation.
1616
- Internal adjoint helper methods are now prefixed with an underscore to separate them from the public API.
17+
- Drop the dependency on `gdspy`, which has been unmaintained for over two years. Interfaces previously relying on `gdspy` now use its maintained successor, `gdstk`, with equivalent functionality.
1718
- Small (around 1e-4) numerical precision improvements in EME solver.
1819

1920
## [2.8.4] - 2025-05-15
@@ -33,7 +34,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3334
- Warn if more than 20 frequencies are used in EME, as this may lead to slower or more expensive simulations.
3435
- EME now supports 2D simulations.
3536
- 'EMESimulation' now supports 'PermittivityMonitor'.
36-
- Change `VisualizationSpec` validator for checking validity of user specified colors to only issue a warning if matplotlib is not installed instead of an error.
3737

3838
### Fixed
3939
- Fixed issue with `CustomMedium` gradients where other frequencies would wrongly contribute to the gradient.

docs/development/recommendations.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Managing Optional Dependencies On-The-Fly
8282

8383
If you look within ``pyproject.toml``, it is possible to see that we have different packages relating to different functionalities that are optional.
8484

85-
Some examples from these are ``[vtk, jax, trimesh, gdstk, gdspy]`` etc. What we want to do is improve the import speed of the core-package in order to minimise small core operations. As we scale into a bigger package, decoupling these type of imports from the total pacakge import is essential.
85+
Some examples from these are ``[vtk, jax, trimesh, gdstk]`` etc. What we want to do is improve the import speed of the core-package in order to minimise small core operations. As we scale into a bigger package, decoupling these type of imports from the total pacakge import is essential.
8686

8787

8888
Benchmarking Package Import
@@ -94,4 +94,4 @@ We have a set of utilties to verify this.
9494

9595
.. code::
9696
97-
poetry run tidy3d develop benchmark-timing-operations
97+
poetry run tidy3d develop benchmark-timing-operations

docs/install.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ Tidy3D has several optional dependencies that provide additional functionality.
187187
188188
Where ``dependency_group`` is one of the following:
189189

190-
- ``gdspy``: Adds support for GDS export using `gdspy <https://github.com/heitzmann/gdspy>`_.
191190
- ``gdstk``: Adds support for GDS export using `gdstk <https://github.com/heitzmann/gdstk>`_.
192191
- ``trimesh``: Support for more complex mesh handling and manipulation.
193192
- ``vtk``: Support for working with unstructured data.

poetry.lock

Lines changed: 45 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ pytest-cov = "^6.0.0"
6666
pytest-env = "^1.1.5"
6767
tox = { version = "*", optional = true }
6868

69-
# gdspy
70-
gdspy = { version = "*", optional = true }
71-
7269
# gdstk
7370
gdstk = { version = ">=0.9.49", optional = true }
7471

@@ -132,7 +129,6 @@ dev = [
132129
"coverage",
133130
'dill',
134131
'divparams',
135-
'gdspy',
136132
'gdstk',
137133
'grcwa',
138134
'ipython',
@@ -210,7 +206,6 @@ docs = [
210206
"devsim",
211207
"cma",
212208
]
213-
gdspy = ["gdspy"]
214209
gdstk = ["gdstk"]
215210
scikit-rf = ["scikit-rf"]
216211
trimesh = ["trimesh", "networkx", "rtree"]

tests/test_components/test_geometry.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import math
44
import warnings
55

6-
import gdspy
76
import gdstk
87
import matplotlib.pyplot as plt
98
import numpy as np
@@ -379,14 +378,6 @@ def test_gdstk_cell():
379378
)
380379

381380

382-
def test_gdspy_cell():
383-
gds_cell = gdspy.Cell("name")
384-
gds_cell.add(gdspy.Rectangle((0, 0), (1, 1)))
385-
td.PolySlab.from_gds(gds_cell=gds_cell, axis=2, slab_bounds=(-1, 1), gds_layer=0)
386-
with pytest.raises(Tidy3dKeyError):
387-
td.PolySlab.from_gds(gds_cell=gds_cell, axis=2, slab_bounds=(-1, 1), gds_layer=1)
388-
389-
390381
def make_geo_group():
391382
"""Make a generic Geometry Group."""
392383
boxes = [td.Box(size=(1, 1, 1), center=(i, 0, 0)) for i in range(-5, 5)]

tests/test_plugins/test_adjoint.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,20 +2022,6 @@ def test_to_gds(tmp_path):
20222022
polys = sim.to_gdstk(z=0, permittivity_threshold=6, frequency=200e14)
20232023
assert len(polys) > 0
20242024

2025-
# to_gdspy() does not support custom medium
2026-
sim = make_sim(
2027-
permittivity=EPS,
2028-
size=SIZE,
2029-
vertices=VERTICES,
2030-
base_eps_val=BASE_EPS_VAL,
2031-
custom_medium=False,
2032-
)
2033-
polys = sim.to_gdspy(z=0)
2034-
assert len(polys) > 0
2035-
2036-
polys = sim.to_gdspy(y=0)
2037-
assert len(polys) > 4
2038-
20392025

20402026
@pytest.mark.parametrize(
20412027
"base_vertices",

0 commit comments

Comments
 (0)