You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Introspection fails for blocks with carrier port labels #341
#253 adds Carrier and Vector as port label values, so a block can declare input_port_labels = {"in": Species()} with a carrier covering several channels.
process_port_labels in scripts/pathview_introspect.py sorts the labels by value:
With a carrier among the values, the comparison between a Carrier and an int raises a TypeError, so introspection fails for any block that uses carriers. extract.py has the same pattern in _process_port_labels.
Carrier ports should be read with their channel layout (start, size, keys) and drawn as one port, which is what #332 asks for. Until then introspection should at least not fail, e.g. by sorting on start for carriers. This is needed before toolbox blocks (pathsim-fusion) can use carriers.
Introspection reads a Carrier port label as one port with its layout (start, size, keys), ports ordered by start. Fixes the TypeError in process_port_labels and extract.py.
Carrier ports are bus ports. A carrier output is a bus source whose elements are the carrier's keys (positions for a Vector), a carrier input expects a bus with exactly these elements. They connect carrier to carrier, to a Bus Selector, or from a Bus Creator. A bus into a generic block stays the bus-into-block wiring problem: generic blocks work on channels.
Expansion before code generation resolves a carrier port to its channel indices, so the generated connections stay index-based. TS and Python kept in agreement through bus_expansion.json.
Introspection reports a carrier port as one port whose channels are a bus structure (BusStructure, the representation the bus analysis already uses): one plain element per key, positions 0..n-1 for a Vector. No channel layout (start) in PathView; the register layout stays with pathsim. (Read carrier port labels as bus ports in block introspection #350)
Code generation addresses labeled ports by name (heater["stream"], amp["in"]), variable ports stay by index. Port position and channel index only coincide while every label is a single, contiguous channel, which a carrier breaks. Applies to the code builder, the live mutation queue and converter.py.
Carrier ports are bus ports in the bus analysis and expansion: a carrier output is a bus source, a carrier input takes a bus with the same elements. A single channel after expansion is addressed by port and key (heater["stream"]["T"]). A bus into a generic block stays bus-into-block. TS and Python kept in agreement through bus_expansion.json.
Done in #350 (carrier ports introspected as bus structures), #351 (labeled ports addressed by label in generated code) and #352 (carrier ports as bus ports in the bus analysis and expansion). Note for the next release: generated scripts now address labeled ports by label, e.g. pt1["in"] instead of pt1[0].
Activity
milanofthe commentedon Nov 10, 2026
Plan:
Carrierport label as one port with its layout (start,size,keys), ports ordered bystart. Fixes theTypeErrorinprocess_port_labelsandextract.py.Vector), a carrier input expects a bus with exactly these elements. They connect carrier to carrier, to a Bus Selector, or from a Bus Creator. A bus into a generic block stays thebus-into-blockwiring problem: generic blocks work on channels.bus_expansion.json.milanofthe commentedon Nov 10, 2026
Revised plan, replaces the one above:
BusStructure, the representation the bus analysis already uses): one plain element per key, positions0..n-1for aVector. No channel layout (start) in PathView; the register layout stays with pathsim. (Read carrier port labels as bus ports in block introspection #350)heater["stream"],amp["in"]), variable ports stay by index. Port position and channel index only coincide while every label is a single, contiguous channel, which a carrier breaks. Applies to the code builder, the live mutation queue andconverter.py.heater["stream"]["T"]). A bus into a generic block staysbus-into-block. TS and Python kept in agreement throughbus_expansion.json.milanofthe commentedon Nov 10, 2026
Done in #350 (carrier ports introspected as bus structures), #351 (labeled ports addressed by label in generated code) and #352 (carrier ports as bus ports in the bus analysis and expansion). Note for the next release: generated scripts now address labeled ports by label, e.g.
pt1["in"]instead ofpt1[0].