diff --git a/src/doc/doc/about/drc_ref_layer.xml b/src/doc/doc/about/drc_ref_layer.xml index 3d68b9eda..9dd40b6ca 100644 --- a/src/doc/doc/about/drc_ref_layer.xml +++ b/src/doc/doc/about/drc_ref_layer.xml @@ -2255,7 +2255,11 @@ on polygons and edges (input1: red, input2: blue): This method will copy the content of the layer to the specified output.

If a report database is selected for the output, the specification has to include a -category name and optionally a category description. +category name and optionally a category description. The category name can be an +array of strings - in that case, a hierarchy of categories is created +with the first array item being the top level category name. +Shapes are added to an existing category, if a category with the given +name already exists.

If the layout is selected for the output, the specification can consist of one to three parameters: a layer number, a data type (optional, default is 0) diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index 8ec6b5f47..54ab2769b 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -354,6 +354,20 @@ class Box: The DBU argument has been added in version 0.27.6. """ + def __sub__(self, box: Box) -> Box: + r""" + @brief Subtraction of boxes + + + The - operator subtracts the argument box from self. + This will return the bounding box of the are covered by self, but not by argument box. Subtracting a box from itself will render an empty box. Subtracting another box from self will modify the first box only if the argument box covers one side entirely. + + @param box The box to subtract from this box. + + @return The result box + + This feature has been introduced in version 0.29. + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -3941,12 +3955,12 @@ class CompoundRegionOperationNode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ def __hash__(self) -> int: r""" @@ -3979,12 +3993,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -4149,12 +4163,12 @@ class CompoundRegionOperationNode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ def __hash__(self) -> int: r""" @@ -4391,12 +4405,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -4477,22 +4491,26 @@ class CompoundRegionOperationNode: @brief Creates a node providing a composition into convex pieces. """ @classmethod - def new_corners_as_dots(cls, input: CompoundRegionOperationNode, angle_min: float, include_angle_min: bool, angle_max: float, include_angle_max: bool) -> CompoundRegionOperationNode: + def new_corners_as_dots(cls, input: CompoundRegionOperationNode, angle_min: float, include_angle_min: bool, angle_max: float, include_angle_max: bool, inverse: Optional[bool] = ..., absolute: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node turning corners into dots (single-point edges). + + 'absolute' and 'inverse' arguments have been added in version 0.29.1. """ @classmethod - def new_corners_as_edge_pairs(cls, input: CompoundRegionOperationNode, angle_min: float, include_angle_min: bool, angle_max: float, include_angle_max: bool) -> CompoundRegionOperationNode: + def new_corners_as_edge_pairs(cls, input: CompoundRegionOperationNode, angle_min: float, include_angle_min: bool, angle_max: float, include_angle_max: bool, inverse: Optional[bool] = ..., absolute: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node turning corners into edge pairs containing the two edges adjacent to the corner. The first edge will be the incoming edge and the second one the outgoing edge. - This feature has been introduced in version 0.27.1. + This feature has been introduced in version 0.27.1. 'absolute' and 'inverse' arguments have been added in version 0.29.1. """ @classmethod - def new_corners_as_rectangles(cls, input: CompoundRegionOperationNode, angle_min: float, include_angle_min: bool, angle_max: float, include_angle_max: bool, dim: int) -> CompoundRegionOperationNode: + def new_corners_as_rectangles(cls, input: CompoundRegionOperationNode, angle_min: float, include_angle_min: bool, angle_max: float, include_angle_max: bool, dim: int, inverse: Optional[bool] = ..., absolute: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node turning corners into rectangles. + + 'absolute' and 'inverse' arguments have been added in version 0.29.1. """ @classmethod def new_count_filter(cls, inputs: CompoundRegionOperationNode, invert: Optional[bool] = ..., min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> CompoundRegionOperationNode: @@ -4510,9 +4528,11 @@ class CompoundRegionOperationNode: @brief Creates a node filtering edges by their length sum (over the local set). """ @classmethod - def new_edge_orientation_filter(cls, input: CompoundRegionOperationNode, inverse: bool, amin: float, include_amin: bool, amax: float, include_amax: bool) -> CompoundRegionOperationNode: + def new_edge_orientation_filter(cls, input: CompoundRegionOperationNode, inverse: bool, amin: float, include_amin: bool, amax: float, include_amax: bool, absolute_angle: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node filtering edges by their orientation. + + 'absolute_angle' has been introduced in version 0.29.1. """ @classmethod def new_edge_pair_to_first_edges(cls, input: CompoundRegionOperationNode) -> CompoundRegionOperationNode: @@ -4910,6 +4930,8 @@ class Connectivity: All layers are specified in terms of layer indexes. Layer indexes are layout layer indexes (see \Layout class). The connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \global_net_name. + Starting with version 0.29, soft connections are supported. Soft connections attach to high-ohmic substrate or diffusion layers (the 'lower' layer) are upon netlist extraction it will be checked that no wiring is routed over such connections. See \soft_connect and \soft_global_connect for details. + This class has been introduced in version 0.26. """ @classmethod @@ -4929,6 +4951,14 @@ class Connectivity: r""" @brief Creates a new object of this class """ + def __repr__(self) -> str: + r""" + @hide + """ + def __str__(self) -> str: + r""" + @hide + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -4974,11 +5004,13 @@ class Connectivity: def connect(self, layer: int) -> None: r""" @brief Specifies intra-layer connectivity. + This method specifies a hard connection between shapes on the given layer. Without specifying such a connection, shapes on that layer do not form connection regions. """ @overload def connect(self, layer_a: int, layer_b: int) -> None: r""" @brief Specifies inter-layer connectivity. + This method specifies a hard connection between shapes on layer_a and layer_b. """ def connect_global(self, layer: int, global_net_name: str) -> int: r""" @@ -5020,6 +5052,27 @@ class Connectivity: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ + def soft_connect(self, layer_a: int, layer_b: int) -> None: + r""" + @brief Specifies a soft connection between layer_a and layer_b. + @param layer_a The 'upper' layer + @param layer_b The 'lower' layer + Soft connections are made between a lower and an upper layer. The lower layer conceptually is a high-ohmic (i.e. substrate, diffusion) region that is not intended for signal wiring. The netlist extraction will check that no routing happens over such regions. + + Soft connections have in introduced in version 0.29. + """ + def soft_connect_global(self, layer: int, global_net_name: str) -> int: + r""" + @brief Soft-connects the given layer to the global net given by name. + Returns the ID of the global net. + See \soft_connect for a description of the soft connection feature. The global net is always the 'lower' (i.e. high-ohmic, substrate) part of the soft connection. + + Soft connections have in introduced in version 0.29. + """ + def to_s(self) -> str: + r""" + @hide + """ class CplxTrans: r""" @@ -6289,6 +6342,20 @@ class DBox: The DBU argument has been added in version 0.27.6. """ + def __sub__(self, box: DBox) -> DBox: + r""" + @brief Subtraction of boxes + + + The - operator subtracts the argument box from self. + This will return the bounding box of the are covered by self, but not by argument box. Subtracting a box from itself will render an empty box. Subtracting another box from self will modify the first box only if the argument box covers one side entirely. + + @param box The box to subtract from this box. + + @return The result box + + This feature has been introduced in version 0.29. + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -11446,8 +11513,7 @@ class DText: Setter: @brief Sets the vertical alignment - This property specifies how the text is aligned relative to the anchor point. - This property has been introduced in version 0.22 and extended to enums in 0.28. + This is the version accepting integer values. It's provided for backward compatibility. """ x: float r""" @@ -17034,12 +17100,12 @@ class EdgeMode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ def __hash__(self) -> int: r""" @@ -19065,6 +19131,41 @@ class EdgePairs(ShapeCollection): @return The transformed edge pairs. """ @overload + def with_abs_angle(self, angle: float, inverse: bool) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of their edges + + This method behaves like \with_angle, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up. + + This method has been added in version 0.29.1. + """ + @overload + def with_abs_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of their edges + + This method behaves like \with_angle, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up. + + This method has been added in version 0.29.1. + """ + @overload + def with_abs_angle_both(self, angle: float, inverse: bool) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of both of their edges + + This method behaves like \with_angle_both, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up. + + This method has been added in version 0.29.1. + """ + @overload + def with_abs_angle_both(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: + r""" + + This method behaves like \with_angle_both, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up. + + This method has been added in version 0.29.1. + """ + @overload def with_angle(self, angle: float, inverse: bool) -> EdgePairs: r""" @brief Filter the edge pairs by orientation of their edges @@ -19274,6 +19375,13 @@ class EdgePairs(ShapeCollection): This method has been added in version 0.27.1. """ + def write(self, filename: str) -> None: + r""" + @brief Writes the region to a file + This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell. + + This method has been introduced in version 0.29. + """ class EdgeProcessor: r""" @@ -20565,12 +20673,12 @@ class Edges(ShapeCollection): @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ def __hash__(self) -> int: r""" @@ -22787,6 +22895,24 @@ class Edges(ShapeCollection): 'zero_distance_mode' has been added in version 0.29. """ @overload + def with_abs_angle(self, angle: float, inverse: bool) -> Edges: + r""" + @brief Filter the edges by orientation + + This method behaves like \with_angle, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up. + + This method has been added in version 0.29.1. + """ + @overload + def with_abs_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges: + r""" + @brief Filter the edges by orientation + + This method behaves like \with_angle, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up. + + This method has been added in version 0.29.1. + """ + @overload def with_angle(self, angle: float, inverse: bool) -> Edges: r""" @brief Filters the edges by orientation @@ -22832,6 +22958,13 @@ class Edges(ShapeCollection): If you don't want to specify a lower or upper limit, pass nil to that parameter. """ + def write(self, filename: str) -> None: + r""" + @brief Writes the region to a file + This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell. + + This method has been introduced in version 0.29. + """ def xor(self, other: Edges) -> Edges: r""" @brief Returns the boolean XOR between self and the other edge collection @@ -25545,11 +25678,11 @@ class Instance: Starting with version 0.25 the displacement is of vector type. Setter: - @brief Sets the displacement vector for the 'a' axis in micrometer units + @brief Sets the displacement vector for the 'a' axis - Like \a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. + If the instance was not an array instance before it is made one. - This method has been introduced in version 0.25. + This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type. """ b: Vector r""" @@ -25558,11 +25691,11 @@ class Instance: Starting with version 0.25 the displacement is of vector type. Setter: - @brief Sets the displacement vector for the 'b' axis in micrometer units + @brief Sets the displacement vector for the 'b' axis - Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. + If the instance was not an array instance before it is made one. - This method has been introduced in version 0.25. + This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type. """ cell: Cell r""" @@ -25605,10 +25738,9 @@ class Instance: @brief Gets the complex transformation of the instance or the first instance in the array This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well. Setter: - @brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) - This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. + @brief Sets the complex transformation of the instance or the first instance in the array - This method has been introduced in version 0.25. + This method has been introduced in version 0.23. """ da: DVector r""" @@ -25737,9 +25869,10 @@ class Instance: @brief Gets the transformation of the instance or the first instance in the array The transformation returned is only valid if the array does not represent a complex transformation array Setter: - @brief Sets the transformation of the instance or the first instance in the array + @brief Sets the transformation of the instance or the first instance in the array (in micrometer units) + This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. - This method has been introduced in version 0.23. + This method has been introduced in version 0.25. """ @classmethod def new(cls) -> Instance: @@ -30883,12 +31016,12 @@ class LayoutToNetlist: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -30978,6 +31111,13 @@ class LayoutToNetlist: This attribute has been introduced in version 0.27 and replaces the arguments of \extract_netlist. """ + make_soft_connection_diodes: bool + r""" + Getter: + @hide + Setter: + @hide + """ max_vertex_count: int r""" Getter: @@ -31381,6 +31521,7 @@ class LayoutToNetlist: r""" @brief Defines a connection of the given text layer with a global net. This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. + This variant has been introduced in version 0.27. """ def const_cell_mapping_into(self, layout: Layout, cell: Cell) -> CellMapping: @@ -31720,6 +31861,56 @@ class LayoutToNetlist: "prop_id" is an optional properties ID. If given, this property set will be attached to the shapes. The optional 'trans' parameter allows applying a transformation to all shapes. It has been introduced in version 0.28.4. """ + @overload + def soft_connect(self, a: Region, b: Region) -> None: + r""" + @brief Defines an inter-layer connection for the given layers in soft mode. + Connects two layers through a soft connection. + Soft connections cannot make connections between two different nets. + These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion). + + Soft connections have been introduced in version 0.29. + """ + @overload + def soft_connect(self, a: Region, b: Texts) -> None: + r""" + @brief Defines an inter-layer connection for the given layers in soft mode. + Connects two layers through a soft connection. + Soft connections cannot make connections between two different nets. + These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion). + As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. + + Soft connections have been introduced in version 0.29. + """ + @overload + def soft_connect(self, a: Texts, b: Region) -> None: + r""" + @brief Defines an inter-layer connection for the given layers in soft mode. + Connects two layers through a soft connection. + Soft connections cannot make connections between two different nets. + These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion). + As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. + + Soft connections have been introduced in version 0.29. + """ + @overload + def soft_connect_global(self, l: Region, global_net_name: str) -> int: + r""" + @brief Defines a connection of the given layer with a global net in soft mode. + This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. + Soft connections are directional, where the global net is the 'lower' layer (typically high-ohmic substrate or diffusion). + + Soft connections have been introduced in version 0.29. + """ + @overload + def soft_connect_global(self, l: Texts, global_net_name: str) -> int: + r""" + @brief Defines a connection of the given text layer with a global net in soft mode. + This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. + Soft connections are directional, where the global net is the 'lower' layer (typically high-ohmic substrate or diffusion). + + Soft connections have been introduced in version 0.29. + """ def write(self, path: str, short_format: Optional[bool] = ...) -> None: r""" @brief Writes the extracted netlist to a file. @@ -32067,8 +32258,6 @@ class Library: def for_technologies(self) -> bool: r""" @brief Returns a value indicating whether the library is associated with any technology. - The method is equivalent to checking whether the \technologies list is empty. - This method has been introduced in version 0.27 """ def id(self) -> int: @@ -32085,6 +32274,8 @@ class Library: def is_for_technology(self, tech: str) -> bool: r""" @brief Returns a value indicating whether the library is associated with the given technology. + The method is equivalent to checking whether the \technologies list is empty. + This method has been introduced in version 0.27 """ def layout(self) -> Layout: @@ -32176,12 +32367,12 @@ class LoadLayoutOptions: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ def __hash__(self) -> int: r""" @@ -35164,12 +35355,6 @@ class NetTerminalRef: The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ @overload - def device(self) -> Device: - r""" - @brief Gets the device reference. - Gets the device object that this connection is made to. - """ - @overload def device(self) -> Device: r""" @brief Gets the device reference (non-const version). @@ -35177,6 +35362,12 @@ class NetTerminalRef: This constness variant has been introduced in version 0.26.8 """ + @overload + def device(self) -> Device: + r""" + @brief Gets the device reference. + Gets the device object that this connection is made to. + """ def device_class(self) -> DeviceClass: r""" @brief Gets the class of the device which is addressed. @@ -35194,14 +35385,14 @@ class NetTerminalRef: @overload def net(self) -> Net: r""" - @brief Gets the net this terminal reference is attached to. + @brief Gets the net this terminal reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 """ @overload def net(self) -> Net: r""" - @brief Gets the net this terminal reference is attached to (non-const version). - - This constness variant has been introduced in version 0.26.8 + @brief Gets the net this terminal reference is attached to. """ def terminal_def(self) -> DeviceTerminalDefinition: r""" @@ -35962,12 +36153,6 @@ class Netlist: For more details see \Circuit#blank which is the corresponding method on the actual object. """ @overload - def circuit_by_cell_index(self, cell_index: int) -> Circuit: - r""" - @brief Gets the circuit object for a given cell index. - If the cell index is not valid or no circuit is registered with this index, nil is returned. - """ - @overload def circuit_by_cell_index(self, cell_index: int) -> Circuit: r""" @brief Gets the circuit object for a given cell index (const version). @@ -35976,6 +36161,12 @@ class Netlist: This constness variant has been introduced in version 0.26.8. """ @overload + def circuit_by_cell_index(self, cell_index: int) -> Circuit: + r""" + @brief Gets the circuit object for a given cell index. + If the cell index is not valid or no circuit is registered with this index, nil is returned. + """ + @overload def circuit_by_name(self, name: str) -> Circuit: r""" @brief Gets the circuit object for a given name (const version). @@ -36060,24 +36251,18 @@ class Netlist: This constness variant has been introduced in version 0.26.8. """ @overload - def each_circuit_bottom_up(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the circuits bottom-up (const version) - Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. - - This constness variant has been introduced in version 0.26.8. - """ - @overload def each_circuit_bottom_up(self) -> Iterator[Circuit]: r""" @brief Iterates over the circuits bottom-up Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. """ @overload - def each_circuit_top_down(self) -> Iterator[Circuit]: + def each_circuit_bottom_up(self) -> Iterator[Circuit]: r""" - @brief Iterates over the circuits top-down - Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. + @brief Iterates over the circuits bottom-up (const version) + Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. + + This constness variant has been introduced in version 0.26.8. """ @overload def each_circuit_top_down(self) -> Iterator[Circuit]: @@ -36088,6 +36273,12 @@ class Netlist: This constness variant has been introduced in version 0.26.8. """ @overload + def each_circuit_top_down(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits top-down + Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. + """ + @overload def each_device_class(self) -> Iterator[DeviceClass]: r""" @brief Iterates over the device classes of the netlist @@ -38520,12 +38711,12 @@ class PCellParameterState: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ def __hash__(self) -> int: r""" @@ -41836,12 +42027,12 @@ class PreferredOrientation: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ def __hash__(self) -> int: r""" @@ -41874,12 +42065,12 @@ class PreferredOrientation: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -42033,12 +42224,12 @@ class PropertyConstraint: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ def __hash__(self) -> int: r""" @@ -42071,12 +42262,12 @@ class PropertyConstraint: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -42767,6 +42958,22 @@ class RecursiveShapeIterator: The RecursiveShapeIterator class has been introduced in version 0.18 and has been extended substantially in 0.23. """ + for_merged_input: bool + r""" + Getter: + @brief Gets a flag indicating whether iterator optimizes for merged input + + see \for_merged_input= for details of this attribute. + + This method has been introduced in version 0.29. + + Setter: + @brief Sets a flag indicating whether iterator optimizes for merged input + + If this flag is set to true, the iterator is allowed to skip shapes it deems irrelevant because they are covered entirely by other shapes. This allows shortcutting hierarchy traversal in some cases. + + This method has been introduced in version 0.29. + """ global_dtrans: DCplxTrans r""" Getter: @@ -43513,12 +43720,12 @@ class Region(ShapeCollection): @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ def __hash__(self) -> int: r""" @@ -43551,12 +43758,12 @@ class Region(ShapeCollection): @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -44097,11 +44304,25 @@ class Region(ShapeCollection): @classmethod def new(cls, shapes: Shapes) -> Region: r""" - @brief Shapes constructor + @brief Constructor from a shapes container - This constructor creates a region from a \Shapes collection. + This constructor creates a region from the shapes container. + Text objects and edges are not inserted, because they cannot be converted to polygons. + This method allows feeding the shapes from a hierarchy of cells into the region. - This constructor has been introduced in version 0.25. + This constructor has been introduced in version 0.25 and extended in version 0.29. + """ + @overload + @classmethod + def new(cls, shapes: Shapes, trans: ICplxTrans) -> Region: + r""" + @brief Constructor from a shapes container with a transformation + + This constructor creates a region from the shapes container after applying the transformation. + Text objects and edges are not inserted, because they cannot be converted to polygons. + This method allows feeding the shapes from a hierarchy of cells into the region. + + This constructor variant has been introduced in version 0.29. """ def __add__(self, other: Region) -> Region: r""" @@ -44314,11 +44535,24 @@ class Region(ShapeCollection): @overload def __init__(self, shapes: Shapes) -> None: r""" - @brief Shapes constructor + @brief Constructor from a shapes container - This constructor creates a region from a \Shapes collection. + This constructor creates a region from the shapes container. + Text objects and edges are not inserted, because they cannot be converted to polygons. + This method allows feeding the shapes from a hierarchy of cells into the region. - This constructor has been introduced in version 0.25. + This constructor has been introduced in version 0.25 and extended in version 0.29. + """ + @overload + def __init__(self, shapes: Shapes, trans: ICplxTrans) -> None: + r""" + @brief Constructor from a shapes container with a transformation + + This constructor creates a region from the shapes container after applying the transformation. + Text objects and edges are not inserted, because they cannot be converted to polygons. + This method allows feeding the shapes from a hierarchy of cells into the region. + + This constructor variant has been introduced in version 0.29. """ def __ior__(self, other: Region) -> Region: r""" @@ -44521,7 +44755,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. The 'property_constraint' parameter controls whether properties are considered: with 'SamePropertiesConstraint' the operation is only applied between shapes with identical properties. With 'DifferentPropertiesConstraint' only between shapes with different properties. This option has been introduced in version 0.28.4. """ - def corners(self, angle_min: Optional[float] = ..., angle_max: Optional[float] = ..., dim: Optional[int] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Region: + def corners(self, angle_min: Optional[float] = ..., angle_max: Optional[float] = ..., dim: Optional[int] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ..., inverse: Optional[bool] = ..., absolute: Optional[bool] = ...) -> Region: r""" @brief This method will select all corners whose attached edges satisfy the angle condition. @@ -44529,28 +44763,31 @@ class Region(ShapeCollection): If 'include_angle_min' is true, the angle condition is >= min. angle, otherwise it is > min. angle. Same for 'include_angle_,ax' and the max. angle. - The angle is measured between the incoming and the outcoming edge in mathematical sense: a positive value is a turn left while a negative value is a turn right. Since polygon contours are oriented clockwise, positive angles will report concave corners while negative ones report convex ones. + With 'absolute' set to false (the default), the angle is measured between the incoming and the outcoming edge in mathematical sense: a positive value is a turn left while a negative value is a turn right. Since polygon contours are oriented clockwise, positive angles will report concave corners while negative ones report convex ones. + With the 'absolute' option set to true, there is no such distinction and angle values are always positive. + + With 'inverse' set to true, the method will select corners not meeting the angle criterion. A similar function that reports corners as point-like edges is \corners_dots. - This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. + This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. 'inverse' and 'absolute' have been added in version 0.29.1. """ - def corners_dots(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges: + def corners_dots(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ..., inverse: Optional[bool] = ..., absolute: Optional[bool] = ...) -> Edges: r""" @brief This method will select all corners whose attached edges satisfy the angle condition. This method is similar to \corners, but delivers an \Edges collection with dot-like edges for each corner. - This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. + This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. 'inverse' and 'absolute' have been added in version 0.29.1. """ - def corners_edge_pairs(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: + def corners_edge_pairs(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ..., inverse: Optional[bool] = ..., absolute: Optional[bool] = ...) -> EdgePairs: r""" @brief This method will select all corners whose attached edges satisfy the angle condition. This method is similar to \corners, but delivers an \EdgePairs collection with an edge pairs for each corner. The first edge is the incoming edge of the corner, the second one the outgoing edge. - This method has been introduced in version 0.27.1. + This method has been introduced in version 0.27.1. 'inverse' and 'absolute' have been added in version 0.29.1. """ def count(self) -> int: r""" @@ -44661,6 +44898,18 @@ class Region(ShapeCollection): @brief Disable progress reporting Calling this method will disable progress reporting. See \enable_progress. """ + def drc_hull(self, metrics: Metrics, space: int, n_circle: Optional[int] = ...) -> Region: + r""" + @brief Computes a visualization of the forbidden region for a DRC space check + + @param metrics The metrics to apply + @param space The space value to apply + @param n_circle The full-circle number of points for the Euclidian space visualization + + @return The new polygons representing the forbidden region. + + This method has been introduced in version 0.29.1. + """ def dup(self) -> Region: r""" @brief Creates a copy of self @@ -46768,6 +47017,13 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ + def write(self, filename: str) -> None: + r""" + @brief Writes the region to a file + This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell. + + This method has been introduced in version 0.29. + """ def xor(self, other: Region) -> Region: r""" @brief Returns the boolean XOR between self and the other region @@ -47507,12 +47763,12 @@ class Severity: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -48241,10 +48497,11 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent a text. Setter: - @brief Replaces the shape by the given text (in micrometer units) - This method replaces the shape by the given text, like \text= with a \Text argument does. This version translates the text from micrometer units to database units internally. + @brief Replaces the shape by the given text object + This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - This method has been introduced in version 0.25. + This method has been introduced in version 0.22. """ text_dpos: DVector r""" @@ -48533,10 +48790,26 @@ class Shape: Equality of shapes is not specified by the identity of the objects but by the identity of the pointers - both shapes must refer to the same object. """ + def __hash__(self) -> int: + r""" + @brief Hash function + + The hash function enables Shape objects as keys in hashes. + + This method has been introduced in version 0.29.1. + """ def __init__(self) -> None: r""" @brief Creates a new object of this class """ + def __lt__(self, other: Shape) -> bool: + r""" + @brief Less operator + + The less operator implementation is based on pointers and not strictly reproducible.However, it is good enough so Shape objects can serve as keys in hashes (see also \hash). + + This method has been introduced in version 0.29.1. + """ def __ne__(self, other: object) -> bool: r""" @brief Inequality operator @@ -48672,6 +48945,14 @@ class Shape: This method has been added in version 0.25. """ + def drectangle(self) -> Any: + r""" + @brief Gets the rectangle in micron units if the object represents one or nil if not + + If the shape represents a rectangle - i.e. a box or box polygon, a path with two points and no round ends - this method returns the box. If not, nil is returned. + + This method has been introduced in version 0.29. + """ def dup(self) -> Shape: r""" @brief Creates a copy of self @@ -48768,6 +49049,14 @@ class Shape: r""" @brief Returns true, if the shape has properties, i.e. has a properties ID """ + def hash(self) -> int: + r""" + @brief Hash function + + The hash function enables Shape objects as keys in hashes. + + This method has been introduced in version 0.29.1. + """ def holes(self) -> int: r""" @brief Returns the number of holes @@ -48882,6 +49171,14 @@ class Shape: This method is a convenience method that gets the property with the given key. If no property with that key does not exist, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. This method has been introduced in version 0.22. """ + def rectangle(self) -> Any: + r""" + @brief Gets the rectangle if the object represents one or nil if not + + If the shape represents a rectangle - i.e. a box or box polygon, a path with two points and no round ends - this method returns the box. If not, nil is returned. + + This method has been introduced in version 0.29. + """ def set_property(self, key: Any, value: Any) -> None: r""" @brief Sets the user property with the given key to the given value @@ -51446,12 +51743,6 @@ class SubCircuit(NetlistObject): Usually it's not required to call this method. It has been introduced in version 0.24. """ @overload - def circuit(self) -> Circuit: - r""" - @brief Gets the circuit the subcircuit lives in. - This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. - """ - @overload def circuit(self) -> Circuit: r""" @brief Gets the circuit the subcircuit lives in (non-const version). @@ -51460,9 +51751,10 @@ class SubCircuit(NetlistObject): This constness variant has been introduced in version 0.26.8 """ @overload - def circuit_ref(self) -> Circuit: + def circuit(self) -> Circuit: r""" - @brief Gets the circuit referenced by the subcircuit. + @brief Gets the circuit the subcircuit lives in. + This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. """ @overload def circuit_ref(self) -> Circuit: @@ -51473,6 +51765,11 @@ class SubCircuit(NetlistObject): This constness variant has been introduced in version 0.26.8 """ @overload + def circuit_ref(self) -> Circuit: + r""" + @brief Gets the circuit referenced by the subcircuit. + """ + @overload def connect_pin(self, pin: Pin, net: Net) -> None: r""" @brief Connects the given pin to the specified net. @@ -51576,6 +51873,7 @@ class Technology: Setter: @brief Sets the default grids If not empty, this list replaces the global grid list for this technology. + Note that this method will reset the default grid (see \default_grid). Use \set_default_grids to set the default grids and the strong default one. This property has been introduced in version 0.28.17. """ @@ -51830,6 +52128,17 @@ class Technology: @brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ + def default_grid(self) -> float: + r""" + @brief Gets the default grid + + The default grid is a specific one from the default grid list. + It indicates the one that is taken if the current grid is not matching one of the default grids. + + To set the default grid, use \set_default_grids. + + This property has been introduced in version 0.29. + """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -51872,6 +52181,14 @@ class Technology: r""" @brief Saves the technology definition to a file """ + def set_default_grids(self, grids: Sequence[float], default_grid: Optional[float] = ...) -> None: + r""" + @brief Sets the default grids and the strong default one + See \default_grids and \default_grid for a description of this property. + Note that the default grid has to be a member of the 'grids' array to become active. + + This method has been introduced in version 0.29. + """ def to_xml(self) -> str: r""" @brief Returns a XML representation of this technolog @@ -52068,7 +52385,8 @@ class Text: Setter: @brief Sets the vertical alignment - This is the version accepting integer values. It's provided for backward compatibility. + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. """ x: int r""" @@ -53826,6 +54144,13 @@ class Texts(ShapeCollection): If "inverse" is false, this method returns the texts with the given string. If "inverse" is true, this method returns the texts not having the given string. """ + def write(self, filename: str) -> None: + r""" + @brief Writes the region to a file + This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell. + + This method has been introduced in version 0.29. + """ class TileOutputReceiver(TileOutputReceiverBase): r""" @@ -55327,12 +55652,12 @@ class TrapezoidDecompositionMode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -55610,12 +55935,12 @@ class VAlign: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ def __hash__(self) -> int: r""" @@ -57077,12 +57402,12 @@ class ZeroDistanceMode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ def __hash__(self) -> int: r""" diff --git a/src/pymod/distutils_src/klayout/laycore.pyi b/src/pymod/distutils_src/klayout/laycore.pyi index 269620872..6ea64fd6c 100644 --- a/src/pymod/distutils_src/klayout/laycore.pyi +++ b/src/pymod/distutils_src/klayout/laycore.pyi @@ -2512,6 +2512,266 @@ class Dispatcher: is returned but no exception is thrown. """ +class EditorHooks: + r""" + @brief An implementation base class for editor hooks + + Editor hooks allow implementing technology-specific callbacks into the editor for example to implement visual feedback about DRC rules. + + This class provides the basic interface. To implement callbacks, use the \EditorHooks class. You should not need to instantiate this class. + + The following is an excample for editor hooks that add DRC space indicators for polygon-alike shapes, + It implements the shape creation protocol to capture new shapes and the modification protocol to capture shape manipulations. It displays a halo following hard-coded DRC rules to indicate the forbidden zones around the shapes: + + @code + class MyEditorHooks < RBA::EditorHooks + + def initialize() + + register("editor_hooks_demo") + + cleanup + + # some demo values + @spaces = { + RBA::LayerInfo::new(1, 0) => [ 0.2, RBA::Region::Euclidian ], + RBA::LayerInfo::new(2, 0) => [ 0.5, RBA::Region::Projection ] + } + + end + + # Utilities + + # pick the space value from layer or set to nil + def set_space_from_layer(layer_index) + lp = @layout.get_info(layer_index) + if @spaces[lp] + (s, m) = @spaces[lp] + @space = s / @layout.dbu + @metrics = m + else + @space = nil + end + end + + def add_marker_from_shape(shape, trans) + + if !@space + return # no space value set + end + + p = shape.polygon + if !p + return # not a polygon-like object + end + + r = RBA::Region::new + # maintain 2-point polygons for the first edge drawn + r.merged_semantics = (p.num_points != 2) + r.insert(p) + + # compute DRC hull and prepare markers + r.drc_hull(@metrics, @space).each do |pp| + m = RBA::Marker::new(@view) + m.line_style = 2 + m.vertex_size = 0 + m.set_polygon(trans * pp) + @markers.append(m) + end + + end + + # setup session + def start(cv) + cleanup + @view = cv.view + @layout = cv.layout + end + + # end session + def cleanup + @space = nil + @view = nil + @layout = nil + clear_markers + end + + def clear_markers + @markers && @markers.each do |m| + # this is how a marker gets removed in Ruby: + m._destroy + end + @markers = [] + end + + # Shape creation protocol + + def begin_create_shapes(cv, layer) + start(cv) + set_space_from_layer(layer.layer_index) + end + + def begin_new_shapes + clear_markers + end + + def create_shape(shape, trans) + add_marker_from_shape(shape, trans) + end + + def end_create_shapes + cleanup + end + + # Modification protocol + + def begin_edit(cv) + start(cv) + end + + def begin_edits + # create new markers + clear_markers + end + + # transformation of a shape or instance + def transformed(path, applied, trans) + if path.shape + set_space_from_layer(path.layer) + add_marker_from_shape(path.shape, trans * applied) + end + end + + # modification of a shape + def modified(path, shape, trans) + set_space_from_layer(path.layer) + add_marker_from_shape(shape, trans) + end + + def end_edit + cleanup + end + + end + + # instantiation of the hooks object + MyEditorHooks::new + @/code + + The EditorHooks class has been introduced in version 0.29.1. + """ + @property + def technology(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief sets the name of the technology the hooks are associated with + This will clear all technology associations and associate the hooks with that technology only. + """ + @classmethod + def new(cls) -> EditorHooks: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_technology(self, tech: str) -> None: + r""" + @brief Additionally associates the hooks with the given technology. + See also \clear_technologies. + """ + def clear_technologies(self) -> None: + r""" + @brief Clears the list of technologies the hooks are associated with. + See also \add_technology. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def for_technologies(self) -> bool: + r""" + @brief Returns a value indicating whether the hooks are associated with any technology. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_for_technology(self, tech: str) -> bool: + r""" + @brief Returns a value indicating whether the hooks are associated with the given technology. + The method is equivalent to checking whether the \technologies list is empty. + """ + def name(self) -> str: + r""" + @brief Gets the name of the hooks object. + This is the name, the object was registered under in the system. + """ + def register(self, name: str) -> None: + r""" + @brief Registers the hooks in the system. + The hooks will not be active before they are registered in the system. Registration will also transfer object ownership to the system. + + The name is arbitary, but should be unique. Upon registration, this hooks object will replace others with the same name already registered in the system. This will simplify debugging as you can re-run the same code, without accumulating hooks. + """ + def technologies(self) -> List[str]: + r""" + @brief Gets the list of technologies these hooks are associated with. + """ + class Image(BasicImage): r""" @brief An image to be stored as a layout annotation @@ -9157,6 +9417,14 @@ class PluginFactory: r""" @brief Creates a new object of this class """ + def __copy__(self) -> PluginFactory: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> PluginFactory: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -9256,6 +9524,10 @@ class PluginFactory: This method has been introduced in version 0.27. """ + def assign(self, other: PluginFactory) -> None: + r""" + @brief Assigns another object to self + """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -9273,6 +9545,10 @@ class PluginFactory: This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ + def dup(self) -> PluginFactory: + r""" + @brief Creates a copy of self + """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference diff --git a/src/pymod/distutils_src/klayout/rdbcore.pyi b/src/pymod/distutils_src/klayout/rdbcore.pyi index 9e052a27b..e659fc2b8 100644 --- a/src/pymod/distutils_src/klayout/rdbcore.pyi +++ b/src/pymod/distutils_src/klayout/rdbcore.pyi @@ -86,15 +86,31 @@ class RdbCategory: This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ + @overload def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with this category This method has been introduced in version 0.23. """ + @overload + def each_item(self) -> Iterator[RdbItem]: + r""" + @brief Iterates over all items inside the database which are associated with this category (non-const version) + + This method has been introduced in version 0.29. + """ + @overload def each_sub_category(self) -> Iterator[RdbCategory]: r""" @brief Iterates over all sub-categories + + The const version has been added in version 0.29. + """ + @overload + def each_sub_category(self) -> Iterator[RdbCategory]: + r""" + @brief Iterates over all sub-categories (non-const version) """ def is_const_object(self) -> bool: r""" @@ -118,10 +134,19 @@ class RdbCategory: @brief Gets the number of visited items in this category The number of items includes the items in sub-categories of this category. """ + @overload def parent(self) -> RdbCategory: r""" @brief Gets the parent category of this category @return The parent category or nil if this category is a top-level category + + The const version has been added in version 0.29. + """ + @overload + def parent(self) -> RdbCategory: + r""" + @brief Gets the parent category of this category (non-const version) + @return The parent category or nil if this category is a top-level category """ def path(self) -> str: r""" @@ -262,12 +287,20 @@ class RdbCell: @brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ + @overload def database(self) -> ReportDatabase: r""" @brief Gets the database object that category is associated with This method has been introduced in version 0.23. """ + @overload + def database(self) -> ReportDatabase: + r""" + @brief Gets the database object that category is associated with (non-const version) + + This method has been introduced in version 0.29. + """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -280,26 +313,50 @@ class RdbCell: This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ + @overload def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with this cell This method has been introduced in version 0.23. """ + @overload + def each_item(self) -> Iterator[RdbItem]: + r""" + @brief Iterates over all items inside the database which are associated with this cell (non-const version) + + This method has been introduced in version 0.29. + """ + @overload def each_reference(self) -> Iterator[RdbReference]: r""" @brief Iterates over all references """ + @overload + def each_reference(self) -> Iterator[RdbReference]: + r""" + @brief Iterates over all references (non-const version) + + This method has been introduced in version 0.23. + """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ + def layout_name(self) -> str: + r""" + @brief Gets the name of the layout cell + For variants, this string is the name of the actual layout cell. If empty, the cell is assume to be called 'name'. + @return The layout cell name + This read-only attribute has been added in version 0.29.1. + """ def name(self) -> str: r""" @brief Gets the cell name - The cell name is an string that identifies the category in the database. Additionally, a cell may carry a variant identifier which is a string that uniquely identifies a cell in the context of its variants. The "qualified name" contains both the cell name and the variant name. Cell names are also used to identify report database cell's with layout cells. @return The cell name + The cell name is an string that identifies the category in the database. Additionally, a cell may carry a variant identifier which is a string that uniquely identifies a cell in the context of its variants. The "qualified name" contains both the cell name and the variant name. Cell names are also used to identify report database cells with layout cells. For variants, the layout cell name can be specified explicitly with the \layout_name attribute (see \RdbDatabase#create_cell). The latter is available since version 0.29.1. + @return The cell name """ def num_items(self) -> int: r""" @@ -311,7 +368,7 @@ class RdbCell: """ def qname(self) -> str: r""" - @brief Gets the cell's qualified name + @brief Gets the qualified name of the cell The qualified name is a combination of the cell name and optionally the variant name. It is used to identify the cell by name in a unique way. @return The qualified name """ @@ -324,7 +381,8 @@ class RdbCell: def variant(self) -> str: r""" @brief Gets the cell variant name - A variant name additionally identifies the cell when multiple cells with the same name are present. A variant name is either assigned automatically or set when creating a cell. @return The cell variant name + A variant name additionally identifies the cell when multiple cells with the same name are present. A variant name is either assigned automatically or set when creating a cell. + @return The cell variant name """ class RdbItem: @@ -332,6 +390,21 @@ class RdbItem: @brief An item inside the report database An item is the basic information entity in the RDB. It is associated with a cell and a category. It can be assigned values which encapsulate other objects such as strings and geometrical objects. In addition, items can be assigned an image (i.e. a screenshot image) and tags which are basically boolean flags that can be defined freely. """ + comment: str + r""" + Getter: + @brief Gets the common associated with this item as a string + @return The comment string + The comment string is an arbitrary string added by the user to the item. + + This attribute has been added in version 0.29.1. + + Setter: + @brief Sets the common associated with this item as a string + See \comment for a description of that attribute. + + This attribute has been added in version 0.29.1. + """ @property def image(self) -> None: r""" @@ -563,6 +636,11 @@ class RdbItem: @brief Remove the tag with the given id from the item If a tag with that ID does not exists on this item, this method does nothing. """ + def remove_tags(self) -> None: + r""" + @brief Removes all tags from the item + This method has been introduced in version 0.29.1. + """ class RdbItemValue: r""" @@ -955,6 +1033,14 @@ class RdbReference: @brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ + @overload + def database(self) -> ReportDatabase: + r""" + @brief Gets the database object that category is associated with (non-const version) + + This method has been introduced in version 0.29. + """ + @overload def database(self) -> ReportDatabase: r""" @brief Gets the database object that category is associated with @@ -1041,6 +1127,14 @@ class ReportDatabase: @param name The name of the database The name of the database will be used in the user interface to refer to a certain database. """ + def __copy__(self) -> ReportDatabase: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ReportDatabase: + r""" + @brief Creates a copy of self + """ def __init__(self, name: str) -> None: r""" @brief Creates a report database @@ -1084,29 +1178,98 @@ class ReportDatabase: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def apply(self, other: ReportDatabase) -> None: + r""" + @brief Transfers item attributes from one database to another for identical items + This method will identify items that are identical between the two databases and transfer item attributes from the 'other' database to this database. Transferable attributes are: + + @ul + @li Images @/li + @li Item tags @/li + @/ul + + Existing attributes in this database are overwritten. + + Items are identical if + + @ul + @li They belong to the same cell (by qname) @/li + @li They belong to the same category (by name) @/li + @li Their values are identical @/li + @/ul + + Values are identical if their individual values and (optional) value tags are identical. Values tagged with a tag unknown to the other database are ignored. The order of values matters during the compare. So the value pair (17.0, 'abc') is different from ('abc', 17.0). + + The intended application for this method is use for error waiving: as the waived attribute is a transferable attribute, it is possible to apply the waived flag from from a waiver database (the 'other' database) using this method. + + This method has been added in version 0.29.1. + """ + def assign(self, other: ReportDatabase) -> None: + r""" + @brief Assigns another object to self + """ + @overload def category_by_id(self, id: int) -> RdbCategory: r""" @brief Gets a category by ID @return The (const) category object or nil if the ID is not valid """ + @overload + def category_by_id(self, id: int) -> RdbCategory: + r""" + @brief Gets a category by ID (non-const version) + @return The (const) category object or nil if the ID is not valid + + This non-const variant has been introduced in version 0.29. + """ + @overload def category_by_path(self, path: str) -> RdbCategory: r""" @brief Gets a category by path @param path The full path to the category starting from the top level (subcategories separated by dots) @return The (const) category object or nil if the name is not valid """ + @overload + def category_by_path(self, path: str) -> RdbCategory: + r""" + @brief Gets a category by path (non-const version) + @param path The full path to the category starting from the top level (subcategories separated by dots) + @return The (const) category object or nil if the name is not valid + + This non-const variant has been introduced in version 0.29. + """ + @overload def cell_by_id(self, id: int) -> RdbCell: r""" @brief Returns the cell for a given ID @param id The ID of the cell @return The cell object or nil if no cell with that ID exists """ + @overload + def cell_by_id(self, id: int) -> RdbCell: + r""" + @brief Returns the cell for a given ID (non-const version) + @param id The ID of the cell + @return The cell object or nil if no cell with that ID exists + + This non-const variant has been added version 0.29. + """ + @overload def cell_by_qname(self, qname: str) -> RdbCell: r""" @brief Returns the cell for a given qualified name @param qname The qualified name of the cell (name plus variant name optionally) @return The cell object or nil if no such cell exists """ + @overload + def cell_by_qname(self, qname: str) -> RdbCell: + r""" + @brief Returns the cell for a given qualified name (non-const version) + @param qname The qualified name of the cell (name plus variant name optionally) + @return The cell object or nil if no such cell exists + + This non-const variant has been added version 0.29. + """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -1124,6 +1287,7 @@ class ReportDatabase: @brief Creates a new sub-category @param parent The category under which the category should be created @param name The name of the category + Since version 0.29.1, 'parent' can be nil. In that case, a top-level category is created. """ @overload def create_cell(self, name: str) -> RdbCell: @@ -1132,11 +1296,13 @@ class ReportDatabase: @param name The name of the cell """ @overload - def create_cell(self, name: str, variant: str) -> RdbCell: + def create_cell(self, name: str, variant: str, layout_name: Optional[str] = ...) -> RdbCell: r""" @brief Creates a new cell, potentially as a variant for a cell with the same name @param name The name of the cell @param variant The variant name of the cell + @param layout_name For variants, this is the name of the layout cell. If empty, 'name' is used for the layout cell name. + The 'layout_name' argument has been added in version 0.29.1. """ @overload def create_item(self, cell: RdbCell, category: RdbCategory) -> RdbItem: @@ -1302,34 +1468,90 @@ class ReportDatabase: This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ + def dup(self) -> ReportDatabase: + r""" + @brief Creates a copy of self + """ + @overload def each_category(self) -> Iterator[RdbCategory]: r""" @brief Iterates over all top-level categories """ + @overload + def each_category(self) -> Iterator[RdbCategory]: + r""" + @brief Iterates over all top-level categories (non-const version) + + The non-const variant has been added in version 0.29. + """ + @overload def each_cell(self) -> Iterator[RdbCell]: r""" @brief Iterates over all cells """ + @overload + def each_cell(self) -> Iterator[RdbCell]: + r""" + @brief Iterates over all cells (non-const version) + + This non-const variant has been added version 0.29. + """ + @overload def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database """ + @overload + def each_item(self) -> Iterator[RdbItem]: + r""" + @brief Iterates over all items inside the database (non-const version) + + This non-const variant has been added in version 0.29. + """ + @overload def each_item_per_category(self, category_id: int) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with the given category @param category_id The ID of the category for which all associated items should be retrieved """ + @overload + def each_item_per_category(self, category_id: int) -> Iterator[RdbItem]: + r""" + @brief Iterates over all items inside the database which are associated with the given category (non-const version) + @param category_id The ID of the category for which all associated items should be retrieved + + This non-const variant has been added in version 0.29. + """ + @overload def each_item_per_cell(self, cell_id: int) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with the given cell @param cell_id The ID of the cell for which all associated items should be retrieved """ + @overload + def each_item_per_cell(self, cell_id: int) -> Iterator[RdbItem]: + r""" + @brief Iterates over all items inside the database which are associated with the given cell (non-const version) + @param cell_id The ID of the cell for which all associated items should be retrieved + + This non-const variant has been added in version 0.29. + """ + @overload def each_item_per_cell_and_category(self, cell_id: int, category_id: int) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with the given cell and category @param cell_id The ID of the cell for which all associated items should be retrieved @param category_id The ID of the category for which all associated items should be retrieved """ + @overload + def each_item_per_cell_and_category(self, cell_id: int, category_id: int) -> Iterator[RdbItem]: + r""" + @brief Iterates over all items inside the database which are associated with the given cell and category + @param cell_id The ID of the cell for which all associated items should be retrieved + @param category_id The ID of the category for which all associated items should be retrieved + + This non-const variant has been added in version 0.29. + """ def filename(self) -> str: r""" @brief Gets the file name and path where the report database is stored