kqcircuits.util.export_helper

kqcircuits.util.export_helper.generate_probepoints_json(cell: klayout.dbcore.Cell, face: str = '1t1', flip_face: Optional[bool] = None, references: List[str] = ['nw'], contact: Optional[Union[Tuple[klayout.dbcore.DPoint, klayout.dbcore.DPoint], List[Tuple[klayout.dbcore.DPoint, klayout.dbcore.DPoint]]]] = None) Dict[source]

For given cell, collects probepoints from cell’s refpoints into a json Dict.

A refpoint is a probepoint if it

  • contains some string from default_probe_types and

  • has a suffix from default_probe_suffixes

Json format consists of {‘x’: x, ‘y’: y} type 2d points, in millimeter units. The returned json object consists of:

  • an ‘alignment’ point, which tells the position of the reference marker defined in references marker and

  • ‘sites’ list. Each entry of the list has a ‘west’ and ‘east’ point, and also a unique ‘id’ as string

Parameters
  • cell (*) – cell from which to collect probepoints

  • face (*) – name of the face from where to collect probepoints

  • flip_face (*) – explicitly specifies if the points should be flipped around the y-axis. Can be set to None, in which case will infer whether to flip points from the face arg

  • references (*) – a list of markers to use as alignment references. String values are one of “nw”, “ne”, “sw”, “se”. If multiple values supplied, the resulting json will have “groups” key on top level, with each group containing the marker string as ‘id’ and its own ‘alignment’ and ‘sites’ values, grouping each site to its closest marker.

  • contact (*) – a manually defined contact probe, a tuple of two DPoints. Can be None so no “contact” site is added, or can be a list if a different “contact” site is needed for each reference

kqcircuits.util.export_helper.generate_probepoints_from_file(cell_file: str, face: str = '1t1', flip_face: Optional[bool] = None, references: List[str] = ['nw'], contact: Optional[Union[Tuple[klayout.dbcore.DPoint, klayout.dbcore.DPoint], List[Tuple[klayout.dbcore.DPoint, klayout.dbcore.DPoint]]]] = None) Dict[source]

For an OAS and GDS file containing a chip at its top cell, collects probepoints from cell’s refpoints into a json Dict. A refpoint is a probepoint if it

  • contains some string from default_probe_types and

  • has a suffix from default_probe_suffixes

Json format consists of {‘x’: x, ‘y’: y} type 2d points, in millimeter units. The returned json object consists of:

  • an ‘alignment’ point, which tells the position of the reference marker defined in references marker and

  • ‘sites’ list. Each entry of the list has a ‘west’ and ‘east’ point, and also a unique ‘id’ as string

Parameters
  • cell_file (*) – file path to the OAS or GDS file containing a chip at its top cell

  • face (*) – name of the face from where to collect probepoints

  • flip_face (*) – explicitly specifies if the points should be flipped around the y-axis. Can be set to None, in which case will infer whether to flip points from the face arg

  • references (*) – a list of markers to use as alignment references. String values are one of “nw”, “ne”, “sw”, “se”. If multiple values supplied, the resulting json will have “groups” key on top level, with each group containing the marker string as ‘id’ and its own ‘alignment’ and ‘sites’ values, grouping each site to its closest marker.

  • contact (*) – a manually defined contact probe, a tuple of two DPoints. Can be None so no “contact” site is added, or can be a list if a different “contact” site is needed for each reference

kqcircuits.util.export_helper.create_or_empty_tmp_directory(dir_name)[source]

Creates directory into TMP_PATH or removes its content if it exists. Returns directory path.

kqcircuits.util.export_helper.get_simulation_directory(dir_name)[source]

Returns directory path consistent with create_or_empty_tmp_directory.

kqcircuits.util.export_helper.get_active_or_new_layout()[source]

Tries to return active layout in GUI or returns new layout when running standalone.

kqcircuits.util.export_helper.write_commit_reference_file(path: pathlib.Path, write_versions_file=True)[source]

Writes file COMMIT_REFERENCE into given file path. The file includes current git revision number. If git repository is not found in given path, no file is written.

kqcircuits.util.export_helper.write_export_machine_versions_file(path: pathlib.Path)[source]

Writes file EXPORT_MACHINE_VERSIONS into given file path.

kqcircuits.util.export_helper.open_with_klayout_or_default_application(filepath)[source]

Tries to open file with KLayout. If KLayout is not found, opens file with operating system’s default application. Implementation supports Windows, macOS, and Linux.

kqcircuits.util.export_helper.get_klayout_version()[source]
kqcircuits.util.export_helper.export_drc_report(name, path, drc_script='example.lydrc')[source]

Run a DRC script on path/name.oas and export results in path/name_drc_report.lyrdb.

../_images/kqcircuits.util.export_helper.png