[set_dead] improve docs
This commit is contained in:
parent
f42e720c68
commit
5d040061f4
4 changed files with 49 additions and 5 deletions
|
|
@ -275,6 +275,10 @@ class Builder(PortList):
|
|||
Returns:
|
||||
self
|
||||
|
||||
Note:
|
||||
If the builder is 'dead' (see `set_dead()`), geometry generation is
|
||||
skipped but ports are still updated.
|
||||
|
||||
Raises:
|
||||
`PortError` if any ports specified in `map_in` or `map_out` do not
|
||||
exist in `self.ports` or `other_names`.
|
||||
|
|
@ -350,6 +354,10 @@ class Builder(PortList):
|
|||
Returns:
|
||||
self
|
||||
|
||||
Note:
|
||||
If the builder is 'dead' (see `set_dead()`), geometry generation is
|
||||
skipped but ports are still updated.
|
||||
|
||||
Raises:
|
||||
`PortError` if any ports specified in `map_in` or `map_out` do not
|
||||
exist in `self.ports` or `other.ports`.
|
||||
|
|
@ -425,13 +433,18 @@ class Builder(PortList):
|
|||
|
||||
def set_dead(self) -> Self:
|
||||
"""
|
||||
Disallows further changes through `plug()` or `place()`.
|
||||
Suppresses geometry generation for subsequent `plug()` and `place()`
|
||||
operations. Unlike a complete skip, the port state is still tracked
|
||||
and updated, using 'best-effort' fallbacks for impossible transforms.
|
||||
This allows a layout script to execute through problematic sections
|
||||
while maintaining valid port references for downstream code.
|
||||
|
||||
This is meant for debugging:
|
||||
```
|
||||
dev.plug(a, ...)
|
||||
dev.set_dead() # added for debug purposes
|
||||
dev.plug(b, ...) # usually raises an error, but now skipped
|
||||
dev.plug(c, ...) # also skipped
|
||||
dev.plug(b, ...) # usually raises an error, but now uses fallback port update
|
||||
dev.plug(c, ...) # also updated via fallback
|
||||
dev.pattern.visualize() # shows the device as of the set_dead() call
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -285,6 +285,12 @@ class Pather(Builder, PatherMixin):
|
|||
Returns:
|
||||
self
|
||||
|
||||
Note:
|
||||
If the builder is 'dead', this operation will still attempt to update
|
||||
the target port's location. If the pathing tool fails (e.g. due to an
|
||||
impossible length), a dummy linear extension is used to maintain port
|
||||
consistency for downstream operations.
|
||||
|
||||
Raises:
|
||||
BuildError if `distance` is too small to fit the bend (if a bend is present).
|
||||
LibraryError if no valid name could be picked for the pattern.
|
||||
|
|
@ -359,6 +365,12 @@ class Pather(Builder, PatherMixin):
|
|||
Returns:
|
||||
self
|
||||
|
||||
Note:
|
||||
If the builder is 'dead', this operation will still attempt to update
|
||||
the target port's location. If the pathing tool fails (e.g. due to an
|
||||
impossible length), a dummy linear extension is used to maintain port
|
||||
consistency for downstream operations.
|
||||
|
||||
Raises:
|
||||
BuildError if `distance` is too small to fit the s-bend (for nonzero jog).
|
||||
LibraryError if no valid name could be picked for the pattern.
|
||||
|
|
|
|||
|
|
@ -408,6 +408,12 @@ class RenderPather(PatherMixin):
|
|||
Returns:
|
||||
self
|
||||
|
||||
Note:
|
||||
If the builder is 'dead', this operation will still attempt to update
|
||||
the target port's location. If the pathing tool fails (e.g. due to an
|
||||
impossible length), a dummy linear extension is used to maintain port
|
||||
consistency for downstream operations.
|
||||
|
||||
Raises:
|
||||
BuildError if `distance` is too small to fit the bend (if a bend is present).
|
||||
LibraryError if no valid name could be picked for the pattern.
|
||||
|
|
@ -486,6 +492,12 @@ class RenderPather(PatherMixin):
|
|||
Returns:
|
||||
self
|
||||
|
||||
Note:
|
||||
If the builder is 'dead', this operation will still attempt to update
|
||||
the target port's location. If the pathing tool fails (e.g. due to an
|
||||
impossible length), a dummy linear extension is used to maintain port
|
||||
consistency for downstream operations.
|
||||
|
||||
Raises:
|
||||
BuildError if `distance` is too small to fit the s-bend (for nonzero jog).
|
||||
LibraryError if no valid name could be picked for the pattern.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue