Skip to content

Commit 5b2ea6d

Browse files
committed
remove workaround for oasis-files
1 parent 36b6ded commit 5b2ea6d

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

gdshelpers/geometry/chip.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ def save(self, name=None, library=None, grid_steps_per_micron=1000, parallel=Fal
319319
elif name.endswith('.gds'):
320320
name = name[:-4]
321321
library = library or 'gdshelpers'
322-
elif name.endswith('.oasis'):
323-
name = name[:-6]
322+
elif name.endswith('.oas'):
323+
name = name[:-4]
324324
library = library or 'fatamorgana'
325325
elif name.endswith('.dxf'):
326326
name = name[:-4]
@@ -370,24 +370,6 @@ def save(self, name=None, library=None, grid_steps_per_micron=1000, parallel=Fal
370370

371371
layout.cells = [cells[0]] + list(set(cells[1:]))
372372

373-
# noinspection PyUnresolvedReferences
374-
def replace_names_by_ids(oasis_layout):
375-
name_id = {}
376-
for cell_id, cell in enumerate(oasis_layout.cells):
377-
if cell.name.string in name_id:
378-
raise RuntimeError(
379-
'Each cell name should be unique, name "' + cell.name.string + '" is used multiple times')
380-
name_id[cell.name.string] = cell_id
381-
cell.name = cell_id
382-
for cell in oasis_layout.cells:
383-
for placement in cell.placements:
384-
placement.name = name_id[placement.name.string]
385-
386-
oasis_layout.cellnames = {v: k for k, v in name_id.items()}
387-
388-
# improves performance for reading oasis file and workaround for fatamorgana-bug
389-
replace_names_by_ids(layout)
390-
391373
with open(name + '.oas', 'wb') as f:
392374
layout.write(f)
393375
elif library == 'ezdxf':

0 commit comments

Comments
 (0)