Fixing pyi stubs for Box#moved and added defaults for Box#enlarge/enlarged

This commit is contained in:
Matthias Koefferlein 2024-12-02 22:23:14 +01:00
parent dd5214dc6e
commit bb635c3c59
2 changed files with 43 additions and 44 deletions

View File

@ -4,6 +4,7 @@
# clean up # clean up
rm -rf build dist rm -rf build dist
rm -rf python3-venv-make_stubs
python3 setup.py build python3 setup.py build
python3 setup.py bdist_wheel python3 setup.py bdist_wheel

View File

@ -553,7 +553,7 @@ class Box:
""" """
... ...
@overload @overload
def enlarge(self, dx: int, dy: int) -> Box: def enlarge(self, dx: Optional[int] = ..., dy: Optional[int] = ...) -> Box:
r""" r"""
@brief Enlarges the box by a certain amount. @brief Enlarges the box by a certain amount.
@ -596,7 +596,7 @@ class Box:
""" """
... ...
@overload @overload
def enlarged(self, dx: int, dy: int) -> Box: def enlarged(self, dx: Optional[int] = ..., dy: Optional[int] = ...) -> Box:
r""" r"""
@brief Enlarges the box by a certain amount. @brief Enlarges the box by a certain amount.
@ -701,7 +701,7 @@ class Box:
""" """
... ...
@overload @overload
def moved(self, dx, 0: int, dy: Optional[int] = ...) -> Box: def moved(self, dx: Optional[int] = ..., dy: Optional[int] = ...) -> Box:
r""" r"""
@brief Moves the box by a certain distance @brief Moves the box by a certain distance
@ -7407,7 +7407,7 @@ class DBox:
""" """
... ...
@overload @overload
def enlarge(self, dx: float, dy: float) -> DBox: def enlarge(self, dx: Optional[float] = ..., dy: Optional[float] = ...) -> DBox:
r""" r"""
@brief Enlarges the box by a certain amount. @brief Enlarges the box by a certain amount.
@ -7450,7 +7450,7 @@ class DBox:
""" """
... ...
@overload @overload
def enlarged(self, dx: float, dy: float) -> DBox: def enlarged(self, dx: Optional[float] = ..., dy: Optional[float] = ...) -> DBox:
r""" r"""
@brief Enlarges the box by a certain amount. @brief Enlarges the box by a certain amount.
@ -7555,7 +7555,7 @@ class DBox:
""" """
... ...
@overload @overload
def moved(self, dx, 0: float, dy: Optional[float] = ...) -> DBox: def moved(self, dx: Optional[float] = ..., dy: Optional[float] = ...) -> DBox:
r""" r"""
@brief Moves the box by a certain distance @brief Moves the box by a certain distance
@ -30277,10 +30277,9 @@ class Instance:
@brief Gets the complex transformation of the instance or the first instance in the array @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. This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well.
Setter: Setter:
@brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) @brief Sets the complex transformation of the instance or the first instance in the array
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.25. This method has been introduced in version 0.23.
""" """
da: DVector da: DVector
r""" r"""
@ -41368,15 +41367,15 @@ class NetPinRef:
@overload @overload
def net(self) -> Net: def net(self) -> Net:
r""" r"""
@brief Gets the net this pin reference is attached to (non-const version). @brief Gets the net this pin reference is attached to.
This constness variant has been introduced in version 0.26.8
""" """
... ...
@overload @overload
def net(self) -> Net: def net(self) -> Net:
r""" r"""
@brief Gets the net this pin reference is attached to. @brief Gets the net this pin reference is attached to (non-const version).
This constness variant has been introduced in version 0.26.8
""" """
... ...
def pin(self) -> Pin: def pin(self) -> Pin:
@ -41666,17 +41665,17 @@ class NetTerminalRef:
@overload @overload
def device(self) -> Device: def device(self) -> Device:
r""" r"""
@brief Gets the device reference. @brief Gets the device reference (non-const version).
Gets the device object that this connection is made to. Gets the device object that this connection is made to.
This constness variant has been introduced in version 0.26.8
""" """
... ...
@overload @overload
def device(self) -> Device: def device(self) -> Device:
r""" r"""
@brief Gets the device reference (non-const version). @brief Gets the device reference.
Gets the device object that this connection is made to. Gets the device object that this connection is made to.
This constness variant has been introduced in version 0.26.8
""" """
... ...
def device_class(self) -> DeviceClass: def device_class(self) -> DeviceClass:
@ -42686,15 +42685,6 @@ class Netlist:
""" """
... ...
@overload @overload
def circuit_by_name(self, name: str) -> Circuit:
r"""
@brief Gets the circuit object for a given name (const version).
If the name is not a valid circuit name, nil is returned.
This constness variant has been introduced in version 0.26.8.
"""
...
@overload
def circuit_by_name(self, name: str) -> Circuit: def circuit_by_name(self, name: str) -> Circuit:
r""" r"""
@brief Gets the circuit object for a given name. @brief Gets the circuit object for a given name.
@ -42702,12 +42692,12 @@ class Netlist:
""" """
... ...
@overload @overload
def circuits_by_name(self, name_pattern: str) -> List[Circuit]: def circuit_by_name(self, name: str) -> Circuit:
r""" r"""
@brief Gets the circuit objects for a given name filter. @brief Gets the circuit object for a given name (const version).
The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. If the name is not a valid circuit name, nil is returned.
This method has been introduced in version 0.26.4. This constness variant has been introduced in version 0.26.8.
""" """
... ...
@overload @overload
@ -42720,6 +42710,15 @@ class Netlist:
This constness variant has been introduced in version 0.26.8. This constness variant has been introduced in version 0.26.8.
""" """
... ...
@overload
def circuits_by_name(self, name_pattern: str) -> List[Circuit]:
r"""
@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 method has been introduced in version 0.26.4.
"""
...
def combine_devices(self) -> None: def combine_devices(self) -> None:
r""" r"""
@brief Combines devices where possible @brief Combines devices where possible
@ -56566,10 +56565,11 @@ class Shape:
Starting with version 0.23, this method returns nil, if the shape does not represent a box. Starting with version 0.23, this method returns nil, if the shape does not represent a box.
Setter: Setter:
@brief Replaces the shape by the given box (in micrometer units) @brief Replaces the shape by the given box
This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally. This method replaces the shape by the given box. 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.
""" """
box_center: Point box_center: Point
r""" r"""
@ -57238,10 +57238,10 @@ class Shape:
Applies to texts only. Will throw an exception if the object is not a text. Applies to texts only. Will throw an exception if the object is not a text.
Setter: Setter:
@brief Sets the text transformation in micrometer units @brief Sets the text transformation
Applies to texts only. Will throw an exception if the object is not a text. Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.25. This method has been introduced in version 0.23.
""" """
text_valign: int text_valign: int
r""" r"""
@ -60854,16 +60854,16 @@ class SubCircuit(NetlistObject):
@overload @overload
def circuit_ref(self) -> Circuit: def circuit_ref(self) -> Circuit:
r""" r"""
@brief Gets the circuit referenced by the subcircuit (non-const version). @brief Gets the circuit referenced by the subcircuit.
This constness variant has been introduced in version 0.26.8
""" """
... ...
@overload @overload
def circuit_ref(self) -> Circuit: def circuit_ref(self) -> Circuit:
r""" r"""
@brief Gets the circuit referenced by the subcircuit. @brief Gets the circuit referenced by the subcircuit (non-const version).
This constness variant has been introduced in version 0.26.8
""" """
... ...
@overload @overload
@ -61533,8 +61533,7 @@ class Text:
Setter: Setter:
@brief Sets the horizontal alignment @brief Sets the horizontal alignment
This property specifies how the text is aligned relative to the anchor point. This is the version accepting integer values. It's provided for backward compatibility.
This property has been introduced in version 0.22 and extended to enums in 0.28.
""" """
size: int size: int
r""" r"""
@ -61570,8 +61569,7 @@ class Text:
Setter: Setter:
@brief Sets the vertical alignment @brief Sets the vertical alignment
This property specifies how the text is aligned relative to the anchor point. This is the version accepting integer values. It's provided for backward compatibility.
This property has been introduced in version 0.22 and extended to enums in 0.28.
""" """
x: int x: int
r""" r"""