feat(precheck): oas file support #134

replace legacy .gds.br support with .oas file support
This commit is contained in:
Uri Shaked
2025-11-16 10:04:22 +02:00
parent f5d9968a40
commit 5c4503072e
3 changed files with 8 additions and 13 deletions
+7 -9
View File
@@ -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:
-1
View File
@@ -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 -3
View File
@@ -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