From 43310e7f49d3100599055f6cfd2c5b65f3c2670c Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 27 Apr 2025 16:07:01 +0200 Subject: [PATCH] Updating Python stubs --- src/pymod/distutils_src/klayout/dbcore.pyi | 81 +++++++++++---------- src/pymod/distutils_src/klayout/rdbcore.pyi | 8 ++ src/pymod/distutils_src/klayout/tlcore.pyi | 4 +- 3 files changed, 54 insertions(+), 39 deletions(-) diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index a9d4ed50c..65fc5acd7 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -11620,7 +11620,7 @@ class DEdgePair: ... ... -class DEdgePairWithProperties(EdgePair): +class DEdgePairWithProperties(DEdgePair): r""" @brief A DEdgePair object with properties attached. This class represents a combination of a DEdgePair object an user properties. User properties are stored in form of a properties ID. Convenience methods are provided to manipulate or retrieve user properties directly. @@ -11685,7 +11685,7 @@ class DEdgePairWithProperties(EdgePair): @brief Returns a string representing the polygon """ ... - def _assign(self, other: EdgePair) -> None: + def _assign(self, other: DEdgePair) -> None: r""" @brief Assigns another object to self """ @@ -15609,8 +15609,7 @@ class DText: Setter: @brief Sets the horizontal 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. """ size: float r""" @@ -15646,8 +15645,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""" @@ -25332,13 +25330,15 @@ class EdgePairs(ShapeCollection): @brief Creates a copy of self """ ... - def __getitem__(self, n: int) -> EdgePair: + def __getitem__(self, n: int) -> Any: r""" @brief Returns the nth edge pair This method returns nil if the index is out of range. It is available for flat edge pairs only - i.e. those for which \has_valid_edge_pairs? is true. Use \flatten to explicitly flatten an edge pair collection. The \each iterator is the more general approach to access the edge pairs. + + Since version 0.30.1, this method returns a \EdgePairWithProperties object. """ ... def __iadd__(self, other: EdgePairs) -> EdgePairs: @@ -29095,7 +29095,7 @@ class Edges(ShapeCollection): @brief Creates a copy of self """ ... - def __getitem__(self, n: int) -> Edge: + def __getitem__(self, n: int) -> Any: r""" @brief Returns the nth edge of the collection @@ -29103,6 +29103,8 @@ class Edges(ShapeCollection): This method returns the raw edge (not merged edges, even if merged semantics is enabled). The \each iterator is the more general approach to access the edges. + + Since version 0.30.1, this method returns an \EdgeWithProperties object. """ ... def __iadd__(self, other: Edges) -> Edges: @@ -34907,11 +34909,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""" @@ -34956,10 +34958,10 @@ class Instance: Getter: @brief Gets the basic \CellInstArray object associated with this instance reference. Setter: - @brief Changes the \CellInstArray object to the given one. - This method replaces the instance by the given CellInstArray object. + @brief Returns the basic cell instance array object by giving a micrometer unit object. + This method replaces the instance by the given CellInstArray object and it internally transformed into database units. - This method has been introduced in version 0.22 + This method has been introduced in version 0.25 """ cplx_trans: ICplxTrans r""" @@ -35455,7 +35457,7 @@ class Instance: r""" @brief Gets the layout this instance is contained in - This method has been introduced in version 0.22. + This const version of the method has been introduced in version 0.25. """ ... @overload @@ -35463,7 +35465,7 @@ class Instance: r""" @brief Gets the layout this instance is contained in - This const version of the method has been introduced in version 0.25. + This method has been introduced in version 0.22. """ ... def pcell_declaration(self) -> PCellDeclaration_Native: @@ -47706,17 +47708,17 @@ class Netlist: @overload def circuit_by_cell_index(self, cell_index: int) -> Circuit: r""" - @brief Gets the circuit object for a given cell index (const version). + @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. - - 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. + @brief Gets the circuit object for a given cell index (const version). If the cell index is not valid or no circuit is registered with this index, nil is returned. + + This constness variant has been introduced in version 0.26.8. """ ... @overload @@ -47738,20 +47740,20 @@ class Netlist: @overload def circuits_by_name(self, name_pattern: str) -> List[Circuit]: r""" - @brief Gets the circuit objects for a given name filter (const version). + @brief Gets the circuit objects for a given name filter. The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. - - This constness variant has been introduced in version 0.26.8. + This method has been introduced in version 0.26.4. """ ... @overload def circuits_by_name(self, name_pattern: str) -> List[Circuit]: r""" - @brief Gets the circuit objects for a given name filter. + @brief Gets the circuit objects for a given name filter (const version). The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. - This method has been introduced in version 0.26.4. + + This constness variant has been introduced in version 0.26.8. """ ... def combine_devices(self) -> None: @@ -47996,7 +47998,7 @@ class Netlist: @overload def top_circuit(self) -> Circuit: r""" - @brief Gets the top circuit. + @brief Gets the top circuit (const version). This method will return nil, if there is no top circuit. It will raise an error, if there is more than a single top circuit. This convenience method has been added in version 0.29.5. @@ -48005,7 +48007,7 @@ class Netlist: @overload def top_circuit(self) -> Circuit: r""" - @brief Gets the top circuit (const version). + @brief Gets the top circuit. This method will return nil, if there is no top circuit. It will raise an error, if there is more than a single top circuit. This convenience method has been added in version 0.29.5. @@ -58384,7 +58386,7 @@ class Region(ShapeCollection): @brief Creates a copy of self """ ... - def __getitem__(self, n: int) -> Polygon: + def __getitem__(self, n: int) -> Any: r""" @brief Returns the nth polygon of the region @@ -58392,6 +58394,8 @@ class Region(ShapeCollection): This method returns the raw polygon (not merged polygons, even if merged semantics is enabled). The \each iterator is the more general approach to access the polygons. + + Since version 0.30.1, this method returns a \PolygonWithProperties object. """ ... def __iadd__(self, other: Region) -> Region: @@ -63169,11 +63173,10 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent an edge. Setter: - @brief Replaces the shape by the given edge - This method replaces the shape by the given edge. 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. + @brief Replaces the shape by the given edge (in micrometer units) + This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. - This method has been introduced in version 0.22. + This method has been introduced in version 0.25. """ edge_pair: Any r""" @@ -63377,10 +63380,11 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon. Setter: - @brief Replaces the shape by the given simple polygon (in micrometer units) - This method replaces the shape by the given text, like \simple_polygon= with a \SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally. + @brief Replaces the shape by the given simple polygon object + This method replaces the shape by the given simple polygon 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: Any r""" @@ -68247,8 +68251,7 @@ class Text: Setter: @brief Sets the horizontal 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. """ size: int r""" @@ -70054,13 +70057,15 @@ class Texts(ShapeCollection): @brief Creates a copy of self """ ... - def __getitem__(self, n: int) -> Text: + def __getitem__(self, n: int) -> Any: r""" @brief Returns the nth text This method returns nil if the index is out of range. It is available for flat texts only - i.e. those for which \has_valid_texts? is true. Use \flatten to explicitly flatten an text collection. The \each iterator is the more general approach to access the texts. + + Since version 0.30.1, this method returns a \TextWithProperties object. """ ... def __iadd__(self, other: Texts) -> Texts: diff --git a/src/pymod/distutils_src/klayout/rdbcore.pyi b/src/pymod/distutils_src/klayout/rdbcore.pyi index 237cf2d15..73e6d9688 100644 --- a/src/pymod/distutils_src/klayout/rdbcore.pyi +++ b/src/pymod/distutils_src/klayout/rdbcore.pyi @@ -655,6 +655,14 @@ class RdbItem: """ ... @overload + def add_value(self, value: db.DText) -> None: + r""" + @brief Adds a text object to the values of this item + @param value The text to add. + This method has been introduced in version 0.30.1 to support text objects with properties. + """ + ... + @overload def add_value(self, value: float) -> None: r""" @brief Adds a numeric value to the values of this item diff --git a/src/pymod/distutils_src/klayout/tlcore.pyi b/src/pymod/distutils_src/klayout/tlcore.pyi index 09483e06c..fd53c5008 100644 --- a/src/pymod/distutils_src/klayout/tlcore.pyi +++ b/src/pymod/distutils_src/klayout/tlcore.pyi @@ -2908,7 +2908,9 @@ class Timer: r""" @brief Gets the current memory usage of the process in Bytes - This method has been introduced in version 0.27. + The returned value is the resident memory size on Linux and MacOS and the working set size on Windows. + + This method has been introduced in version 0.27. The value has been changed to be resident size (instead of virtual size) on Linux in version 0.30. """ ... @classmethod