misc doc updates

This commit is contained in:
Jan Petykiewicz 2026-02-01 15:04:34 -08:00
commit d8702af5b9
6 changed files with 57 additions and 8 deletions

View file

@ -24,6 +24,7 @@ class Abstract(PortList):
When snapping a sub-component to an existing pattern, only the name (not contained
in a `Pattern` object) and port info is needed, and not the geometry itself.
"""
# Alternate design option: do we want to store a Ref instead of just a name? then we can translate/rotate/mirror...
__slots__ = ('name', '_ports')
name: str
@ -48,8 +49,6 @@ class Abstract(PortList):
self.name = name
self.ports = copy.deepcopy(ports)
# TODO do we want to store a Ref instead of just a name? then we can translate/rotate/mirror...
def __repr__(self) -> str:
s = f'<Abstract {self.name} ['
for name, port in self.ports.items():
@ -88,7 +87,7 @@ class Abstract(PortList):
def rotate_around(self, pivot: ArrayLike, rotation: float) -> Self:
"""
Rotate the Abstract around the a location.
Rotate the Abstract around a pivot point.
Args:
pivot: (x, y) location to rotate around

View file

@ -210,7 +210,8 @@ class Builder(PortList):
self.pattern.rect(*args, **kwargs)
return self
# Note: We're a superclass of `Pather`, where path() means something different...
# Note: We're a superclass of `Pather`, where path() means something different,
# so we shouldn't wrap Pattern.path()
#@wraps(Pattern.path)
#def path(self, *args, **kwargs) -> Self:
# self.pattern.path(*args, **kwargs)

View file

@ -487,7 +487,7 @@ class RenderPather(PatherMixin):
# Fall back to drawing two L-bends
ccw0 = jog > 0
kwargs_no_out = (kwargs | {'out_ptype': None})
t_port0, _ = tool.planL( ccw0, length / 2, in_ptype=in_ptype, **kwargs_no_out)
t_port0, _ = tool.planL( ccw0, length / 2, in_ptype=in_ptype, **kwargs_no_out) # TODO length/2 may fail with asymmetric ptypes
jog0 = Port((0, 0), 0).measure_travel(t_port0)[0][1]
t_port1, _ = tool.planL(not ccw0, abs(jog - jog0), in_ptype=t_port0.ptype, **kwargs)
jog1 = Port((0, 0), 0).measure_travel(t_port1)[0][1]

View file

@ -141,7 +141,6 @@ class ILibraryView(Mapping[str, 'Pattern'], metaclass=ABCMeta):
Args:
tops: Name(s) of the pattern(s) to check.
Default is all patterns in the library.
skip: Memo, set patterns which have already been traversed.
Returns:
Set of all referenced pattern names
@ -274,7 +273,7 @@ class ILibraryView(Mapping[str, 'Pattern'], metaclass=ABCMeta):
For an in-place variant, see `Pattern.flatten`.
Args:
tops: The pattern(s) to flattern.
tops: The pattern(s) to flatten.
flatten_ports: If `True`, keep ports from any referenced
patterns; otherwise discard them.
dangling_ok: If `True`, no error will be thrown if any

View file

@ -1241,7 +1241,7 @@ class Pattern(PortList, AnnotatableImpl, Mirrorable):
ports specified by `map_out`.
Examples:
======list, ===
=========
- `my_pat.plug(subdevice, {'A': 'C', 'B': 'B'}, map_out={'D': 'myport'})`
instantiates `subdevice` into `my_pat`, plugging ports 'A' and 'B'
of `my_pat` into ports 'C' and 'B' of `subdevice`. The connected ports