mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat(precheck): oas file support #134
replace legacy .gds.br support with .oas file support
This commit is contained in:
@@ -9,7 +9,6 @@ import time
|
||||
import traceback
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
import brotli
|
||||
import gdstk
|
||||
import klayout.db as pya
|
||||
import klayout.rdb as rdb
|
||||
@@ -282,17 +281,16 @@ def main():
|
||||
gds_stem = args.gds.removesuffix(".gds")
|
||||
gds_temp = None
|
||||
gds_file = args.gds
|
||||
elif args.gds.endswith(".gds.br"):
|
||||
gds_stem = args.gds.removesuffix(".gds.br")
|
||||
elif args.gds.endswith(".oas"):
|
||||
gds_stem = args.gds.removesuffix(".oas")
|
||||
gds_temp = tempfile.NamedTemporaryFile(suffix=".gds", delete=False)
|
||||
gds_file = gds_temp.name
|
||||
logging.info(f"decompressing {args.gds} to {gds_file}")
|
||||
with open(args.gds, "rb") as f:
|
||||
data = f.read()
|
||||
with open(gds_file, "wb") as f:
|
||||
f.write(brotli.decompress(data))
|
||||
logging.info(f"Converting {args.gds} to {gds_file}")
|
||||
layout = pya.Layout()
|
||||
layout.read(args.gds)
|
||||
layout.write(gds_file)
|
||||
else:
|
||||
raise PrecheckFailure("Layout file extension is neither .gds nor .gds.br")
|
||||
raise PrecheckFailure("Layout file extension is neither .gds nor .oas")
|
||||
|
||||
tech = args.tech
|
||||
if tech not in tech_names:
|
||||
|
||||
@@ -3,7 +3,6 @@ name = "tt-precheck"
|
||||
requires-python = ">=3.11"
|
||||
dynamic = ["version"]
|
||||
dependencies = [
|
||||
"brotli",
|
||||
"gdstk",
|
||||
"klayout>=0.28.17.post1,<0.29.0",
|
||||
"numpy<2",
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#
|
||||
# This file is autogenerated by pip-compile with Python 3.13
|
||||
# This file is autogenerated by pip-compile with Python 3.12
|
||||
# by the following command:
|
||||
#
|
||||
# pip-compile
|
||||
#
|
||||
brotli==1.1.0
|
||||
# via tt-precheck (pyproject.toml)
|
||||
gdstk==0.9.52
|
||||
# via tt-precheck (pyproject.toml)
|
||||
iniconfig==2.0.0
|
||||
|
||||
Reference in New Issue
Block a user