From 59cae607fcf68a5a13726bf6b59029cbdb5b8950 Mon Sep 17 00:00:00 2001 From: Joaquin Matres <4514346+joamatab@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:21:10 -0800 Subject: [PATCH] update tidy3d and unpin numpy --- gplugins/tidy3d/component.py | 9 ++++----- pyproject.toml | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gplugins/tidy3d/component.py b/gplugins/tidy3d/component.py index 02ada295..6371118b 100644 --- a/gplugins/tidy3d/component.py +++ b/gplugins/tidy3d/component.py @@ -1,4 +1,5 @@ """This module contains the Tidy3DComponent class which is used to model 3D components in the Tidy3D simulation environment. + It extends the LayeredComponentBase class and adds additional properties and methods specific to the Tidy3D environment. Classes: @@ -207,7 +208,7 @@ def get_simulation( """ sim_center = (*self.center[:2], center_z) sim_size = (*self.size[:2], sim_size_z) - sim = td.Simulation( + return td.Simulation( size=sim_size, center=sim_center, structures=self.structures, @@ -219,7 +220,6 @@ def get_simulation( symmetry=symmetry, **kwargs, ) - return sim def get_component_modeler( self, @@ -308,7 +308,7 @@ def get_component_modeler( ports = self.get_ports(mode_spec, port_size_mult, grid_eps=grid_eps) - modeler = ComponentModeler( + return ComponentModeler( simulation=sim, ports=ports, freqs=tuple(freqs), @@ -319,8 +319,6 @@ def get_component_modeler( verbose=verbose, ) - return modeler - @td.components.viz.add_ax_if_none def plot_slice( self, @@ -495,6 +493,7 @@ def write_sparameters( plot_simulation_x: which x coordinate to plot. Defaults to None. plot_mode_index: which mode index to plot. Defaults to 0. plot_mode_port_name: which port name to plot. Defaults to None. + plot_epsilon: whether to plot epsilon. Defaults to False. filepath: Optional file path for the S-parameters. If None, uses hash of simulation. overwrite: Whether to overwrite existing S-parameters. Defaults to False. kwargs: Additional keyword arguments for the tidy3d Simulation constructor. diff --git a/pyproject.toml b/pyproject.toml index 74680a22..b709315b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "pint", "gdstk", "tqdm", - "numpy<2" + "numpy" ] description = "gdsfactory plugins" keywords = ["python"] @@ -53,7 +53,7 @@ dev = [ devsim = [ "devsim", "pyvista<=0.43.8", - "tidy3d>=2.5.2,<2.8" + "tidy3d>=2.7.8,<2.8" ] docs = [ "jupytext", @@ -93,7 +93,7 @@ meow = [ "jaxlib>=0.4.26", "flax>=0.8.2", "meow-sim~=0.11.0", - "tidy3d>=2.5.2,<2.8" + "tidy3d>=2.7.8,<2.8" ] sax = [ "jax>=0.4.26", @@ -109,9 +109,9 @@ schematic = [ "natsort" ] tidy3d = [ - "tidy3d>=2.5.2,<2.8", + "tidy3d>=2.7.8,<2.8", "meshio", - "numpy<2", + "numpy", "meshwell~=1.0.7" ] vlsir = [