gdsfactory / gdsfactory-photonics-training

training for gdsfactory
https://gdsfactory.github.io/gdsfactory-photonics-training/
MIT License
14 stars 8 forks source link

Issue on page /notebooks/30_mzi.html #33

Closed Jiajiu-AX closed 3 months ago

Jiajiu-AX commented 3 months ago

Fail to do "import gplugins.sax as gsax". Error is below:


TypeError Traceback (most recent call last) Cell In[22], line 8 5 import sax 7 import gdsfactory as gf ----> 8 import gplugins.sax as gsax

File c:\Program Files\Python312\Lib\site-packages\gplugins\sax__init.py:4 [1](file:///C:/Program%20Files/Python312/Lib/site-packages/gplugins/sax/init.py:1) from future import annotations [3](file:///C:/Program%20Files/Python312/Lib/site-packages/gplugins/sax/init.py:3) from gplugins.sax import models, read ----> [4](file:///C:/Program%20Files/Python312/Lib/site-packages/gplugins/sax/init.py:4) from gplugins.sax.plot_model import plot_model [6](file:///C:/Program%20Files/Python312/Lib/site-packages/gplugins/sax/init.py:6) all__ = ["read", "plot_model", "models"]

File c:\Program Files\Python312\Lib\site-packages\gplugins\sax\plot_model.py:11 7 from pydantic import validate_call 8 from sax.saxtypes import Model ---> 11 @validate_call 12 def plot_model( 13 model: Model, 14 port1: str = "o1", 15 ports2: tuple[str, ...] | None = None, 16 logscale: bool = True, 17 fig=None, 18 wavelength_start: float = 1.5, 19 wavelength_stop: float = 1.6, ... 57 @functools.wraps(function) 58 def wrapper_function(*args, *kwargs): 59 return validate_call_wrapper(args, **kwargs)

TypeError: ValidateCallWrapper.init() missing 1 required positional argument: 'namespace' Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

joamatab commented 3 months ago

Hi Jiajiu,

can you try pip install gplugins[sax] --upgrade?

and also share the output from

import sys
print(sys.version)
print(sys.executable)

import gdsfactory as gf
gf.config.print_version_plugins()
Jiajiu-AX commented 3 months ago

Hi

'pip install gplugins[sax] --upgrade' works. It does not work yesterday.

Modules
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Package ┃ version ┃ Path ┃ ┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ python │ 3.12.5 (tags/v3.12.5:ff3bc82, Aug 6 2024, │ c:\Program Files\Python312\python.exe │ │ │ 20:45:27) [MSC v.1940 64 bit (AMD64)] │ │ │ gdsfactory │ 8.7.2 │ c:\Program │ │ │ │ Files\Python312\Lib\site-packages\gdsfactory │ │ gplugins │ 1.1.2 │ ['c:\Program │ │ │ │ Files\Python312\Lib\site-packages\gplugins… │ │ ray │ not installed │ │ │ femwell │ 0.1.10 │ ['c:\Program │ │ │ │ Files\Python312\Lib\site-packages\femwell'] │ │ devsim │ not installed │ │ │ tidy3d │ 2.7.2 │ ['c:\Program │ │ │ │ Files\Python312\Lib\site-packages\tidy3d'] │ │ meep │ not installed │ │ │ meow │ 0.11.2 │ ['c:\Program │ │ │ │ Files\Python312\Lib\site-packages\meow'] │ │ lumapi │ not installed │ │ │ sax │ 0.13.3 │ ['c:\Program │ │ │ │ Files\Python312\Lib\site-packages\sax'] │ └────────────┴──────────────────────────────────────────────────┴─────────────────────────────────────────────────┘

Thanks! Jiajiu

joamatab commented 3 months ago

Did the issue get resolved after updating the plugins?

Jiajiu-AX commented 3 months ago

yes!