gdstk.read_gds

gdstk.read_gds(infile, unit=0, tolerance=0, filter=None) gdstk.Library

Import a library from a GDSII stream file.

Parameters:
  • infile (str or pathlib.Path) – Name of the input file.

  • unit (number) – If greater than zero, convert the imported geometry to the this unit.

  • tolerance (number) – Default tolerance for loaded paths. If zero or negative, the library rounding size is used (precision / unit).

  • filter (iterable of tuples) – If not None, only shapes with layer and data type in the iterable are read.

Returns:

The imported library.

Examples

>>> library = gdstk.read_gds("layout.gds")
>>> top_cells = library.top_level()
>>> filtered_lib = gdstk.read_gds("layout.gds", filter={(0, 1)})