Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix basic installer #1714

Merged
merged 1 commit into from May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -35,6 +35,7 @@ gdsfactory/schema.yaml
sim_run.yaml
docs/notebooks/ring.yml
.ruff_cache/
Pipfile

# Packages
*.egg
Expand Down
19 changes: 10 additions & 9 deletions gdsfactory/difftest.py
Expand Up @@ -7,15 +7,6 @@
import gdsfactory as gf
from gdsfactory.config import PATH, logger, GDSDIR_TEMP

try:
from kfactory import KCell, KCLayout, kdb
except ImportError as e:
print(
"You can install `pip install gdsfactory[kfactory]` for using maskprep. "
"And make sure you use python >= 3.10"
)
raise e


class GeometryDifference(Exception):
pass
Expand All @@ -28,6 +19,14 @@ def files_are_different(
ref_file: PathType, run_file: PathType, xor: bool = True, test_name: str = ""
) -> bool:
"""Returns True if files are different"""
try:
from kfactory import KCell, kdb
except ImportError as e:
print(
"You can install `pip install gdsfactory[kfactory]` for using maskprep. "
"And make sure you use python >= 3.10"
)
raise e
ref = read_top_cell(ref_file)
run = read_top_cell(run_file)
ld = kdb.LayoutDiff()
Expand Down Expand Up @@ -194,6 +193,8 @@ def overwrite(ref_file, run_file):


def read_top_cell(arg0):
from kfactory import KCLayout

kcl = KCLayout()
kcl.read(arg0)
return kcl[kcl.top_cell().name]
Expand Down