From 00188912001b0b945a9719ed830e7d5ce02f1cb9 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sat, 20 Apr 2019 15:42:42 -0700 Subject: [PATCH] handle defaults for path params --- masque/file/gdsii.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/masque/file/gdsii.py b/masque/file/gdsii.py index 8a0ff7a..58b40ec 100644 --- a/masque/file/gdsii.py +++ b/masque/file/gdsii.py @@ -30,7 +30,9 @@ __author__ = 'Jan Petykiewicz' logger = logging.getLogger(__name__) -path_cap_map = {0: Path.Cap.Flush, +path_cap_map = { + None: Path.Cap.Flush, + 0: Path.Cap.Flush, 1: Path.Cap.Circle, 2: Path.Cap.Square, #3: custom? @@ -285,7 +287,7 @@ def read(stream: io.BufferedIOBase, raise PatternError('Unrecognized path type: {}'.format(element.path_type)) args = {'vertices': element.xy, - 'width': element.width, + 'width': element.width if element.width is not None else 0.0, 'cap': cap, }