Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: ref() is deprecated. Use add_ref() instead #3190

Closed
tzarz opened this issue Sep 7, 2024 · 2 comments
Closed

ValueError: ref() is deprecated. Use add_ref() instead #3190

tzarz opened this issue Sep 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tzarz
Copy link

tzarz commented Sep 7, 2024

Hi All,

I am new to gdsfactory and I've been trying to follow the instruction guide and I am receiving errors. I've struggled considerably installing the correct packages and making everything jive together, but now I think I am getting to the end. My current struggle is the error:

ValueError: ref() is deprecated. Use add_ref() instead

It seems as it calls out specifically the line get_sparameters_fdtdz. there is no 'ref' in the below code, so it must be coming from an issue upstream.

I have successfully installed fdtz, maybe there is a compatibility issue? I'm using gds 8.8.7, gplugins 1.1.2, the CUDA version of JAX, and tried to update all other packages to newest. Also using Python 3.11.0rc1

I am trying to follow guide here: https://gdsfactory.github.io/gplugins/notebooks/fdtdz_01.html
here is the code which I was trying to execute

import gdsfactory as gf
gf.config.print_version_plugins()
from gdsfactory.cross_section import rib
from gdsfactory.generic_tech import LAYER, LAYER_STACK
from gdsfactory.technology import LayerStack

from gplugins.fdtdz.get_sparameters_fdtdz import get_sparameters_fdtdz

length = 10

c = gf.Component()
waveguide_rib = c << gf.components.straight(length=length, cross_section=rib)
nitride_feature = c << gf.components.circle(radius=2, layer=LAYER.WGN)
nitride_feature.dx= 5
padding = c << gf.components.bbox(
waveguide_rib, top=2, bottom=2, layer=LAYER.WAFER
)
c.add_ports(gf.components.straight(length=length).ports)

c.plot()

filtered_layer_stack = LayerStack(
layers={
k: LAYER_STACK.layers[k] for k in ["clad", "box", "core", "slab90", "nitride"]
}
)
filtered_layer_stack

material_name_to_fdtdz = {
"si": 3.45,
"sio2": 1.44,
"sin": 2.0,
}

out = get_sparameters_fdtdz(
component=c,
layer_stack=filtered_layer_stack,
nm_per_pixel=20,
extend_ports_length=0.0,
zmin=-0.5,
zz=96,
tt=10000,
wavelength=1.55,
port_margin=1,
material_name_to_fdtdz=material_name_to_fdtdz,
default_index=1.44,
)

out

@tzarz tzarz added the bug Something isn't working label Sep 7, 2024
@tzarz
Copy link
Author

tzarz commented Sep 7, 2024

It seems similar to this case with meep:
#2886

as of July 19th this is the progress, but fdtdz/jax is not listed:
gdsfactory/gplugins#437

Could someone provide a current work around with some sort of compatibility list until the above work is completed? If I install directly gplugins, it installs the latest 8.8.3+ gdsfactory.

@joamatab
Copy link
Contributor

closing this issue as we are already tracking this here

gdsfactory/gplugins#437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants