use double quotes for docstrings

This commit is contained in:
Jan Petykiewicz 2024-07-29 17:53:03 -07:00
parent 5ea5e8d8f9
commit 31e52e20d6
15 changed files with 98 additions and 98 deletions

View File

@ -1,6 +1,6 @@
'''
"""
Build files equivalent to the test cases used by KLayout.
'''
"""
from typing import Callable, IO

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)