Skip to content

Commit

Permalink
Merge pull request #534 from gdsfactory/fix_tidy3d_cache
Browse files Browse the repository at this point in the history
fix tidy3d cache
  • Loading branch information
joamatab authored Jan 11, 2025
2 parents 243e30a + 0d2ffec commit f9fef2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ notebooks/luminescent_runs/

# C extensions
*.csv
*.npz
*.xdmf
*.h5
*.html
Expand Down
13 changes: 8 additions & 5 deletions gplugins/tidy3d/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ def write_sparameters(
dirpath.mkdir(parents=True, exist_ok=True)
filepath = filepath or dirpath / f"{modeler._hash_self()}.npz"
filepath = pathlib.Path(filepath)
if filepath.suffix != ".npz":
filepath = filepath.with_suffix(".npz")

if filepath.exists() and not overwrite:
print(f"Simulation loaded from {filepath!r}")
Expand Down Expand Up @@ -703,15 +705,16 @@ def write_sparameters_batch(
# ]
# )
# s_params_list = [sim.result() for sim in sims]
c = gf.components.taper_sc_nc()
c = gf.components.straight(length=1, cross_section="rib")

sp = write_sparameters(
c,
sim_size_z=4,
# sim_size_z=4,
center_z="core",
plot_simulation_x=10,
plot_simulation_layer_name="core",
plot_epsilon=True,
# plot_simulation_x=10,
# plot_simulation_layer_name="core",
# plot_epsilon=True,
filepath="straight2",
# plot_mode_port_name="o1",
# plot_mode_index=1,
# mode_spec=mode_spec,
Expand Down

0 comments on commit f9fef2f

Please sign in to comment.