From 64b8e4dec8945eb48be96b1f20d3d781e85fb975 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 7 Jan 2020 22:17:00 -0800 Subject: [PATCH] Fix duplicates in gds with multiple top-level cells Since the different patterns we are handed might reference the same Patterns, we have to deepcopy the entire list at once so that we don't make multiple copies of them. --- masque/file/gdsii.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masque/file/gdsii.py b/masque/file/gdsii.py index f5ecc83..e05b4ff 100644 --- a/masque/file/gdsii.py +++ b/masque/file/gdsii.py @@ -90,7 +90,7 @@ def write(patterns: Pattern or List[Pattern], disambiguate_func = disambiguate_pattern_names if not modify_originals: - patterns = [p.deepcopy().deepunlock() for p in patterns] + patterns = [p.deepunlock() for p in copy.deepcopy(patterns)] # Create library lib = gdsii.library.Library(version=600,