From 0d2ffecd8ac1388ff2cbbc44b41d6c954b19a62c Mon Sep 17 00:00:00 2001 From: Joaquin Matres <4514346+joamatab@users.noreply.github.com> Date: Sat, 11 Jan 2025 10:52:25 -0800 Subject: [PATCH] fix tidy3d cache --- .gitignore | 1 + gplugins/tidy3d/component.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 6f44da5b..d46d24b2 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ notebooks/luminescent_runs/ # C extensions *.csv +*.npz *.xdmf *.h5 *.html diff --git a/gplugins/tidy3d/component.py b/gplugins/tidy3d/component.py index 6371118b..4238fd37 100644 --- a/gplugins/tidy3d/component.py +++ b/gplugins/tidy3d/component.py @@ -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}") @@ -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,