MCPcopy Create free account
hub / github.com/Notgnoshi/generative / wrap_bare

Function wrap_bare

generative/flatten/flatten.py:105–113  ·  view source on GitHub ↗

Wrap the given coordinate seqence in the given tag type. You pass in the _BEGIN tag, with the assumption that the _END tag is _BEGIN+1.

(coords: Iterable[Tuple[float]], begin_tag: PointTag)

Source from the content-addressed store, hash-verified

103
104
105def wrap_bare(coords: Iterable[Tuple[float]], begin_tag: PointTag) -> TaggedPointSequence:
106 """Wrap the given coordinate seqence in the given tag type.
107
108 You pass in the _BEGIN tag, with the assumption that the _END tag is _BEGIN+1.
109 """
110 yield coords[0], (begin_tag,)
111 for point in coords[1:-1]:
112 yield point, ()
113 yield coords[-1], (PointTag(begin_tag.value + 1),)
114
115
116def wrap_tagged(points: TaggedPointSequence, begin_tag: PointTag) -> TaggedPointSequence:

Callers 1

flatten_singleFunction · 0.85

Calls 1

PointTagClass · 0.85

Tested by

no test coverage detected