Matthew Guthaus
12/19/2024, 11:32 PMTim Edwards
12/21/2024, 4:33 PMJoaquin Matres Abril
12/21/2024, 5:08 PMMatthew Guthaus
12/21/2024, 6:28 PMimport gdsfactory as gf
# Create a blank Component
p = gf.Component()
# Add a polygon
xpts = [0, 0, 5, 6, 9, 12]
ypts = [0, 1, 1, 2, 2, 0]
p.add_polygon(list(zip(xpts, ypts)), layer=(2, 0))
p.plot()
It returns this error:
Qt: Session management error: None of the authentication protocols specified are supported
I get the same error when doing this with matplotlib, but it properly displays, so I'm not sure that is actually the issue:
import matplotlib.pyplot as plt
plt.plot([i for i in range(10)])
plt.show()
Maybe it is an issue since I have Python3.8?Joaquin Matres Abril
12/21/2024, 6:29 PMMatthew Guthaus
12/21/2024, 6:36 PMMatthew Guthaus
12/21/2024, 6:37 PMJoaquin Matres Abril
12/21/2024, 6:39 PMimport sys
print(sys.version)
print(sys.executable)
import gdsfactory as gf
gf.config.print_version_plugins()
Tim Edwards
12/21/2024, 6:39 PMJoaquin Matres Abril
12/21/2024, 6:41 PMTim Edwards
12/21/2024, 6:42 PMThe error message "Qt: Session management error: None of the authentication protocols specified are supported" typically occurs when using Matplotlib in environments that rely on Wayland, like certain Linux distributions with GNOME.
So it could be distribution-dependent; I'm using Fedora.Joaquin Matres Abril
12/21/2024, 6:42 PMTim Edwards
12/21/2024, 6:43 PMMatthew Guthaus
12/21/2024, 6:44 PMTim Edwards
12/21/2024, 6:45 PMMatthew Guthaus
12/21/2024, 6:45 PMJoaquin Matres Abril
12/21/2024, 6:48 PMimport sys
import importlib
print(sys.version)
print(sys.executable)
import gdsfactory as gf
def print_version_plugins(packages:list[str]|None) -> None:
"""Print gdsfactory plugin versions and paths."""
packages = packages or []
for plugin in packages:
m = importlib.import_module(plugin)
print(plugin, str(m.__version__), str(m.__path__))
print_version_plugins(["gdsfactory", "matplotlib"])
Joaquin Matres Abril
12/21/2024, 6:50 PMpip list
Matthew Guthaus
12/21/2024, 6:57 PM3.10.16 (main, Dec 4 2024, 08:53:37) [GCC 9.4.0]
/home/mrg/class/cse122-222a-w25-admin/hw1/gdsfactory/env/bin/python3
Modules
ββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββ³βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Package β version β Path β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β python β 3.10.16 (main, Dec 4 2024, 08:53:37) [GCC 9.4.0] β /home/mrg/class/cse122-222a-w25-admin/hw1/gdsfactory/env/bin/python3 β
β gdsfactory β 8.26.2 β /home/mrg/class/cse122-222a-w25-admin/hw1/gdsfactory/env/lib/python3.10/site-packages/gdsfactory β
β gplugins β not installed β β
β ray β not installed β β
β femwell β not installed β β
β devsim β not installed β β
β tidy3d β not installed β β
β meep β not installed β β
β meow β not installed β β
β lumapi β not installed β β
β sax β not installed β β
ββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Matthew Guthaus
12/21/2024, 6:57 PMTim Edwards
12/21/2024, 6:59 PMMatthew Guthaus
12/21/2024, 6:59 PMTim Edwards
12/21/2024, 7:00 PMMatthew Guthaus
12/21/2024, 7:02 PMTim Edwards
12/21/2024, 7:03 PM>>> p.show()
2024-12-21 14:01:25.569 | WARNING | kfactory.kcell:show:8797 - Could not connect to klive server
Matthew Guthaus
12/21/2024, 7:05 PMpip install PyQt5
Then matplotlib works, and gdsfactory now returns:
Matthew Guthaus
12/21/2024, 7:08 PMvirtualenv -p `which python3.10` env
source env/bin/activate
pip install gdsfactory
Then run:
import gdsfactory as gf
# Create a blank Component
p = gf.Component()
# Add a polygon
xpts = [0, 0, 5, 6, 9, 12]
ypts = [0, 1, 1, 2, 2, 0]
p.add_polygon(list(zip(xpts, ypts)), layer=(2, 0))
p.plot()
Tim Edwards
12/21/2024, 7:14 PMplot()
is supposed to plot "using klayout"---I'm guessing that means that the code has to be run from inside klayout? show()
draws the result using klive, which may also require running the code from inside klayout.Tim Edwards
12/21/2024, 7:21 PMComponent.plot()
invoked matplotlib. Now it doesn't.Matthew Guthaus
12/21/2024, 7:22 PMMatthew Guthaus
12/21/2024, 8:05 PM## 6.29.0
- add plot_klayout, plot_holoviews, plot_matplotlib. plot defaults to plot_klayout [PR](<https://github.com/gdsfactory/gdsfactory/pull/1216>)
Matthew Guthaus
12/21/2024, 8:07 PMcommit 0565916e1c137d689f4aaef924a8d00532d39c27
Author: Joaquin Matres <4514346+joamatab@users.noreply.github.com>
Date: Wed Jan 3 10:34:48 2024 +0900
deprecate plot_kweb and plot_matplotlib
Matthew Guthaus
12/21/2024, 8:12 PMMatthew Guthaus
12/21/2024, 8:14 PMMatthew Guthaus
12/21/2024, 8:18 PMMatthew Guthaus
12/21/2024, 8:18 PM