mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
fix: lazy imports for matplotlib & gdstk (#161)
only require matplotlib & gdstk for functionality where we actually use them contributed by @gerardvt
This commit is contained in:
+2
-1
@@ -5,7 +5,6 @@ import subprocess
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import chevron
|
import chevron
|
||||||
import matplotlib as mpl
|
|
||||||
|
|
||||||
from config import Config, DatasheetConfig
|
from config import Config, DatasheetConfig
|
||||||
|
|
||||||
@@ -29,6 +28,8 @@ class DocsHelper:
|
|||||||
"""
|
"""
|
||||||
Format the clock with engineering notation
|
Format the clock with engineering notation
|
||||||
"""
|
"""
|
||||||
|
import matplotlib as mpl
|
||||||
|
|
||||||
if clock == 0:
|
if clock == 0:
|
||||||
return "No Clock"
|
return "No Clock"
|
||||||
else:
|
else:
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,6 @@ import re
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import cairosvg # type: ignore
|
import cairosvg # type: ignore
|
||||||
import gdstk # type: ignore
|
|
||||||
|
|
||||||
|
|
||||||
# Custom exception for convert_svg_to_png()
|
# Custom exception for convert_svg_to_png()
|
||||||
@@ -35,6 +34,8 @@ def render_svg(
|
|||||||
filter_layers=None,
|
filter_layers=None,
|
||||||
scramble_cells=None,
|
scramble_cells=None,
|
||||||
):
|
):
|
||||||
|
import gdstk # type: ignore
|
||||||
|
|
||||||
library = gdstk.read_gds(gds)
|
library = gdstk.read_gds(gds)
|
||||||
top_cells = library.top_level()
|
top_cells = library.top_level()
|
||||||
assert len(top_cells) == 1
|
assert len(top_cells) == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user