Skip to content

Commit

Permalink
Merge pull request gdsfactory#1064 from gdsfactory/update_tidy3d
Browse files Browse the repository at this point in the history
update tidy3d

Former-commit-id: 8668ee8 [formerly 4c3b62a]
Former-commit-id: ae2e8187d80e49d3a10e30a5400535a78b4b77db
  • Loading branch information
joamatab committed Jan 2, 2023
2 parents 4bce004 + 9e209da commit 1f07441
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/notebooks/09_pdk_import.ipynb
Expand Up @@ -113,7 +113,7 @@
"source": [
"gf.clear_cache()\n",
"\n",
"c = gf.import_gds(gdspath)\n",
"c = gf.import_gds(gdspath, read_metadata=True)\n",
"c"
]
},
Expand All @@ -126,7 +126,7 @@
"source": [
"import gdsfactory as gf\n",
"\n",
"c2 = gf.import_gds(gdspath, name=\"mzi_sample\")\n",
"c2 = gf.import_gds(gdspath, name=\"mzi_sample\", read_metadata=True)\n",
"c2"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/plugins/meep/001_meep_sparameters.ipynb
Expand Up @@ -1253,7 +1253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.6"
},
"vscode": {
"interpreter": {
Expand Down
19 changes: 16 additions & 3 deletions gdsfactory/simulation/gmeep/test_write_sparameters_meep.py
Expand Up @@ -69,6 +69,7 @@ def test_sparameters_straight_mpi() -> None:
c, ymargin=0, overwrite=True, **simulation_settings
)
sp = np.load(filepath)
sp = dict(sp)

# Check reasonable reflection/transmission
assert np.allclose(np.abs(sp["o1@0,o2@0"]), 1, atol=1e-02), np.abs(sp["o1@0,o2@0"])
Expand Down Expand Up @@ -96,6 +97,7 @@ def test_sparameters_straight_batch() -> None:

filepath = filepaths[0]
sp = np.load(filepath)
sp = dict(sp)

# Check reasonable reflection/transmission
assert np.allclose(np.abs(sp["o1@0,o2@0"]), 1, atol=1e-02), np.abs(sp["o1@0,o2@0"])
Expand Down Expand Up @@ -131,7 +133,7 @@ def test_sparameters_lazy_parallelism() -> None:
filepath_serial = gm.write_sparameters_meep_mpi(
c, ymargin=0, overwrite=True, lazy_parallelism=False, **simulation_settings
)
sp_serial = np.load(filepath_serial)
sp_serial = dict(np.load(filepath_serial))

# Check matching reflection/transmission
assert np.allclose(sp_parallel["o1@0,o1@0"], sp_serial["o1@0,o1@0"], atol=1e-2)
Expand All @@ -141,11 +143,22 @@ def test_sparameters_lazy_parallelism() -> None:


if __name__ == "__main__":
test_sparameters_straight()
# test_sparameters_straight()
# test_sparameters_straight_mpi(None)
# test_sparameters_crossing_symmetric(False)
# test_sparameterslazy_parallelism()
# test_sparameters_straight_symmetric()
# test_sparameters_straight_batch()
# test_sparameters_straight_mpi()
test_sparameters_straight_mpi()
# test_sparameters_crossing_symmetric()

# c = gf.components.straight(length=2)
# p = 3
# c = gf.add_padding_container(c, default=0, top=p, bottom=p)
# filepath = gm.write_sparameters_meep_mpi(
# c, ymargin=0, overwrite=True, **simulation_settings
# )
# sp = dict(np.load(filepath))

# # Check reasonable reflection/transmission
# assert np.allclose(np.abs(sp["o1@0,o2@0"]), 1, atol=1e-02), np.abs(sp["o1@0,o2@0"])
2 changes: 1 addition & 1 deletion gdsfactory/simulation/gmeep/write_sparameters_meep_mpi.py
Expand Up @@ -180,7 +180,7 @@ def write_sparameters_meep_mpi(
"from gdsfactory.simulation.gmeep import write_sparameters_meep\n\n",
"from gdsfactory.read import import_gds\n",
'if __name__ == "__main__":\n\n',
f'\tcomponent = import_gds("{component_file}")\n',
f'\tcomponent = import_gds("{component_file}", read_metadata=True)\n',
f"\twith open(\"{parameters_file}\", 'rb') as inp:\n",
"\t\tparameters_dict = pickle.load(inp)\n\n" "\twrite_sparameters_meep(\n",
"\t\tcomponent = component,\n",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -84,12 +84,12 @@ gmsh = [
"shapely",
]
sipann = ["SIPANN==2.0.0", "simphony==0.6.1"]
tidy3d = ["tidy3d-beta==1.8.0"]
tidy3d = ["tidy3d-beta==1.8.1"]
devsim = [
"devsim",
"mkl",
"pyvista",
"tidy3d-beta==1.8.0",
"tidy3d-beta==1.8.1",
]
meow = [
"meow-sim",
Expand Down

0 comments on commit 1f07441

Please sign in to comment.