Skip to content

CI verification run for microsoft/Trace#53 - #1

Open
MaxFreedomPollard wants to merge 1 commit into
mainfrom
fix/apply-op-tuple-and-kwargs
Open

CI verification run for microsoft/Trace#53#1
MaxFreedomPollard wants to merge 1 commit into
mainfrom
fix/apply-op-tuple-and-kwargs

Conversation

@MaxFreedomPollard

Copy link
Copy Markdown
Owner

Runs the repo's own Python unit tests workflow against the branch proposed in microsoft#53. Not for merge — this fork PR exists only to produce a public CI result, since upstream workflow runs from first-time contributors require maintainer approval.

apply_op broadcasts an operator over containers of Nodes, but two cases
in opto/trace/broadcast.py never worked:

- A tuple container raised "TypeError: 'tuple' object does not support
  item assignment", because the loop assigned into the tuple in place.
  The trailing `if isinstance(output, tuple): output = tuple(output)`
  was therefore unreachable. Accumulate into a list and convert back.

- Keyword inputs against a Node-valued attribute of a NodeContainer
  tested `isinstance(v, Node)` (the output's attribute) instead of
  `isinstance(vv, Node)` (the keyword input), so a container passed by
  keyword was forwarded whole instead of being indexed by attribute,
  tripping the admissible-type assertion. The positional path already
  did the right thing.

Adds regression tests covering a tuple container standalone and nested
in a NodeContainer, a list and a dict; a bare Node broadcast against a
tuple; the existing in-place list behaviour; and keyword inputs whose
values are containers, including one mixed with a bare Node.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant