From 31e52e20d6f86ff03d89743efec6b9f0fe21b934 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 29 Jul 2024 17:53:03 -0700 Subject: [PATCH] use double quotes for docstrings --- fatamorgana/test/build_testfiles.py | 4 +-- fatamorgana/test/test_files_cblocks.py | 4 +-- fatamorgana/test/test_files_cells.py | 28 ++++++++--------- fatamorgana/test/test_files_circles.py | 4 +-- fatamorgana/test/test_files_ctrapezoids.py | 8 ++--- fatamorgana/test/test_files_empty.py | 20 ++++++------ fatamorgana/test/test_files_layernames.py | 16 +++++----- fatamorgana/test/test_files_modals.py | 4 +-- fatamorgana/test/test_files_paths.py | 4 +-- fatamorgana/test/test_files_placements.py | 20 ++++++------ fatamorgana/test/test_files_polygons.py | 8 ++--- fatamorgana/test/test_files_properties.py | 32 +++++++++---------- fatamorgana/test/test_files_rectangles.py | 4 +-- fatamorgana/test/test_files_texts.py | 36 +++++++++++----------- fatamorgana/test/test_files_trapezoids.py | 4 +-- 15 files changed, 98 insertions(+), 98 deletions(-) diff --git a/fatamorgana/test/build_testfiles.py b/fatamorgana/test/build_testfiles.py index 5bb7525..649de3e 100644 --- a/fatamorgana/test/build_testfiles.py +++ b/fatamorgana/test/build_testfiles.py @@ -1,6 +1,6 @@ -''' +""" Build files equivalent to the test cases used by KLayout. -''' +""" from typing import Callable, IO diff --git a/fatamorgana/test/test_files_cblocks.py b/fatamorgana/test/test_files_cblocks.py index 3f02e93..f4d32b5 100644 --- a/fatamorgana/test/test_files_cblocks.py +++ b/fatamorgana/test/test_files_cblocks.py @@ -27,8 +27,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_cells.py b/fatamorgana/test/test_files_cells.py index 285bd08..40a6009 100644 --- a/fatamorgana/test/test_files_cells.py +++ b/fatamorgana/test/test_files_cells.py @@ -24,9 +24,9 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' + """ Single cell with explicit name 'XYZ' - ''' + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) @@ -49,9 +49,9 @@ def test_file_1() -> None: def write_file_2(buf: IO[bytes]) -> IO[bytes]: - ''' + """ Two cellnames ('XYZ', 'ABC') and two cells with name references. - ''' + """ buf.write(HEADER) write_uint(buf, 3) # CELLNAME record (implicit id 0) @@ -86,9 +86,9 @@ def test_file_2() -> None: def write_file_3(buf: IO[bytes]) -> IO[bytes]: - ''' + """ Invalid file, contains a mix of explicit and implicit cellnames - ''' + """ buf.write(HEADER) write_uint(buf, 4) # CELLNAME record (explicit id) @@ -117,9 +117,9 @@ def test_file_3() -> None: def write_file_4(buf: IO[bytes]) -> IO[bytes]: - ''' + """ Two cells referencing two names with explicit ids (unsorted) - ''' + """ buf.write(HEADER) write_uint(buf, 4) # CELLNAME record (explicit id) @@ -156,9 +156,9 @@ def test_file_4() -> None: def write_file_5(buf: IO[bytes]) -> IO[bytes]: - ''' + """ Reference to non-existent cell name. - ''' + """ buf.write(HEADER) write_uint(buf, 4) # CELLNAME record (explicit id) @@ -197,9 +197,9 @@ def test_file_5() -> None: def write_file_6(buf: IO[bytes]) -> IO[bytes]: - ''' + """ Cellname with invalid n-string. - ''' + """ buf.write(HEADER) write_uint(buf, 4) # CELLNAME record (explicit id) @@ -238,9 +238,9 @@ def test_file_6() -> None: def write_file_7(buf: IO[bytes]) -> IO[bytes]: - ''' + """ Unused cellname. - ''' + """ buf.write(HEADER) write_uint(buf, 4) # CELLNAME record (explicit id) diff --git a/fatamorgana/test/test_files_circles.py b/fatamorgana/test/test_files_circles.py index f29b18f..b5d2cba 100644 --- a/fatamorgana/test/test_files_circles.py +++ b/fatamorgana/test/test_files_circles.py @@ -25,8 +25,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_ctrapezoids.py b/fatamorgana/test/test_files_ctrapezoids.py index 095909f..b6f8bc0 100644 --- a/fatamorgana/test/test_files_ctrapezoids.py +++ b/fatamorgana/test/test_files_ctrapezoids.py @@ -21,8 +21,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) @@ -154,8 +154,8 @@ def test_file_1() -> None: def write_file_2(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_empty.py b/fatamorgana/test/test_files_empty.py index 8554c28..1f9e6f3 100644 --- a/fatamorgana/test/test_files_empty.py +++ b/fatamorgana/test/test_files_empty.py @@ -23,11 +23,11 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File contains one PAD record. 1000 units/micron Offset table inside START. - ''' + """ buf.write(MAGIC_BYTES) write_uint(buf, 1) # START record @@ -56,11 +56,11 @@ def test_file_1() -> None: def write_file_2(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File contains no records. 1/2 unit/micron Offset table inside START. - ''' + """ buf.write(MAGIC_BYTES) write_uint(buf, 1) # START record @@ -87,11 +87,11 @@ def test_file_2() -> None: def write_file_3(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File contains no records. 10/4 unit/micron Offset table inside START. - ''' + """ buf.write(MAGIC_BYTES) write_uint(buf, 1) # START record @@ -119,11 +119,11 @@ def test_file_3() -> None: def write_file_4(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File contains no records. 12.5 unit/micron (float32) Offset table inside START. - ''' + """ buf.write(MAGIC_BYTES) write_uint(buf, 1) # START record @@ -150,11 +150,11 @@ def test_file_4() -> None: def write_file_5(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File contains no records. 12.5 unit/micron (float64) Offset table inside START. - ''' + """ buf.write(MAGIC_BYTES) write_uint(buf, 1) # START record diff --git a/fatamorgana/test/test_files_layernames.py b/fatamorgana/test/test_files_layernames.py index d430aaf..304835f 100644 --- a/fatamorgana/test/test_files_layernames.py +++ b/fatamorgana/test/test_files_layernames.py @@ -207,8 +207,8 @@ def elem_test_text(geometry: Sequence) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_names_geom(buf) @@ -237,8 +237,8 @@ def test_file_1() -> None: def write_file_2(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_names_text(buf) @@ -267,8 +267,8 @@ def test_file_2() -> None: def write_file_3(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_names_text(buf, prefix=b'T') write_names_geom(buf, short=True) @@ -283,8 +283,8 @@ def write_file_3(buf: IO[bytes]) -> IO[bytes]: def write_file_4(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_modals.py b/fatamorgana/test/test_files_modals.py index 9eac770..7b6662e 100644 --- a/fatamorgana/test/test_files_modals.py +++ b/fatamorgana/test/test_files_modals.py @@ -21,8 +21,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_paths.py b/fatamorgana/test/test_files_paths.py index 3243a79..e54315d 100644 --- a/fatamorgana/test/test_files_paths.py +++ b/fatamorgana/test/test_files_paths.py @@ -27,8 +27,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_placements.py b/fatamorgana/test/test_files_placements.py index 290ffee..2a718c0 100644 --- a/fatamorgana/test/test_files_placements.py +++ b/fatamorgana/test/test_files_placements.py @@ -34,8 +34,8 @@ def write_rectangle(buf: IO[bytes], pos: Tuple[int, int] = (300, -400)) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) @@ -250,8 +250,8 @@ def test_file_1() -> None: def write_file_common(buf: IO[bytes], variant: int) -> IO[bytes]: - ''' - ''' + """ + """ assert variant in (2, 3, 5, 7), 'Error in test definition!' buf.write(HEADER) @@ -516,8 +516,8 @@ def common_tests(layout: OasisLayout, variant: int) -> None: def write_file_4(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 3) # CELLNAME record (implicit id 0) @@ -595,8 +595,8 @@ def write_file_4(buf: IO[bytes]) -> IO[bytes]: def write_file_6(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) @@ -748,8 +748,8 @@ def test_file_6() -> None: def write_file_8(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_polygons.py b/fatamorgana/test/test_files_polygons.py index f89a019..a3d9bfa 100644 --- a/fatamorgana/test/test_files_polygons.py +++ b/fatamorgana/test/test_files_polygons.py @@ -107,8 +107,8 @@ def common_tests(layout: OasisLayout) -> None: def write_file_common(buf: IO[bytes], variant: int) -> IO[bytes]: - ''' - ''' + """ + """ assert variant in (1, 3), 'Error in test!!' buf.write(HEADER) @@ -376,8 +376,8 @@ def test_file_1() -> None: def write_file_2(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit) diff --git a/fatamorgana/test/test_files_properties.py b/fatamorgana/test/test_files_properties.py index 0100318..433ed54 100644 --- a/fatamorgana/test/test_files_properties.py +++ b/fatamorgana/test/test_files_properties.py @@ -24,8 +24,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_common(buf: IO[bytes], variant: int) -> IO[bytes]: - ''' - ''' + """ + """ include_repetitions = variant in (2, 5) def var_byte(buf, byte): @@ -355,8 +355,8 @@ def test_file_5() -> None: def write_file_3(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 10) # PROPSTRING (explicit id) @@ -580,8 +580,8 @@ def test_file_3() -> None: def write_file_4_6(buf: IO[bytes], variant: int) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 10) # PROPSTRING (explicit id) @@ -786,8 +786,8 @@ def write_file_4_6(buf: IO[bytes], variant: int) -> IO[bytes]: def test_file_4() -> None: - ''' - ''' + """ + """ buf = write_file_4_6(BytesIO(), 4) buf.seek(0) @@ -855,8 +855,8 @@ def test_file_4() -> None: def test_file_6() -> None: - ''' - ''' + """ + """ buf = write_file_4_6(BytesIO(), 6) buf.seek(0) @@ -928,8 +928,8 @@ def test_file_6() -> None: def write_file_7_8_9(buf: IO[bytes], variant: int) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 28) # PROPERTY record @@ -1059,8 +1059,8 @@ def test_file_7() -> None: def test_file_8() -> None: - ''' - ''' + """ + """ buf = write_file_7_8_9(BytesIO(), 8) buf.seek(0) @@ -1069,8 +1069,8 @@ def test_file_8() -> None: def test_file_9() -> None: - ''' - ''' + """ + """ buf = write_file_7_8_9(BytesIO(), 9) buf.seek(0) diff --git a/fatamorgana/test/test_files_rectangles.py b/fatamorgana/test/test_files_rectangles.py index a7ffdc7..82ec564 100644 --- a/fatamorgana/test/test_files_rectangles.py +++ b/fatamorgana/test/test_files_rectangles.py @@ -75,8 +75,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_common(buf: IO[bytes], variant: int) -> IO[bytes]: - ''' - ''' + """ + """ assert variant in (1, 2), 'Error in test!!' buf.write(HEADER) diff --git a/fatamorgana/test/test_files_texts.py b/fatamorgana/test/test_files_texts.py index 2603691..60679ce 100644 --- a/fatamorgana/test/test_files_texts.py +++ b/fatamorgana/test/test_files_texts.py @@ -100,9 +100,9 @@ def common_tests(layout: OasisLayout) -> None: def write_file_common(buf: IO[bytes], variant: int) -> IO[bytes]: - ''' + """ Single cell with explicit name 'XYZ' - ''' + """ assert variant in (1, 2, 5, 12), 'Error in test!!' buf.write(HEADER) @@ -461,10 +461,10 @@ def test_file_12() -> None: def write_file_3(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with one textstring with explicit id, and one with an implicit id. Should fail. - ''' + """ buf.write(HEADER) write_uint(buf, 6) # TEXTSTRING record (explicit id) @@ -498,11 +498,11 @@ def test_file_3() -> None: def write_file_4(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with a TEXT record that references a non-existent TEXTSTRING TODO add an optional check for valid references - ''' + """ buf.write(HEADER) write_uint(buf, 5) # TEXTSTRING record (implicit id 0) @@ -538,9 +538,9 @@ def test_file_4() -> None: def write_file_6(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with TEXT record that uses an un-filled modal for the repetition - ''' + """ buf.write(HEADER) write_uint(buf, 5) # TEXTSTRING record (implicit id 0) @@ -571,9 +571,9 @@ def test_file_6() -> None: def write_file_7(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with TEXT record that uses an un-filled modal for the layer - ''' + """ buf.write(HEADER) write_uint(buf, 5) # TEXTSTRING record (implicit id 0) @@ -602,9 +602,9 @@ def test_file_7() -> None: def write_file_8(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with TEXT record that uses an un-filled modal for the datatype - ''' + """ buf.write(HEADER) write_uint(buf, 5) # TEXTSTRING record (implicit id 0) @@ -633,9 +633,9 @@ def test_file_8() -> None: def write_file_9(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with TEXT record that uses a default modal for the x coordinate - ''' + """ buf.write(HEADER) write_uint(buf, 5) # TEXTSTRING record (implicit id 0) @@ -669,9 +669,9 @@ def test_file_9() -> None: def write_file_10(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with TEXT record that uses a default modal for the y coordinate - ''' + """ buf.write(HEADER) write_uint(buf, 5) # TEXTSTRING record (implicit id 0) @@ -705,9 +705,9 @@ def test_file_10() -> None: def write_file_11(buf: IO[bytes]) -> IO[bytes]: - ''' + """ File with TEXT record that uses an un-filled modal for the text string - ''' + """ buf.write(HEADER) write_uint(buf, 5) # TEXTSTRING record (implicit id 0) diff --git a/fatamorgana/test/test_files_trapezoids.py b/fatamorgana/test/test_files_trapezoids.py index cea3123..4f47332 100644 --- a/fatamorgana/test/test_files_trapezoids.py +++ b/fatamorgana/test/test_files_trapezoids.py @@ -25,8 +25,8 @@ def base_tests(layout: OasisLayout) -> None: def write_file_1(buf: IO[bytes]) -> IO[bytes]: - ''' - ''' + """ + """ buf.write(HEADER) write_uint(buf, 14) # CELL record (explicit)