Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up OpType methods #495

Closed
3 tasks
aborgna-q opened this issue Sep 5, 2023 · 0 comments · Fixed by #680
Closed
3 tasks

Clean up OpType methods #495

aborgna-q opened this issue Sep 5, 2023 · 0 comments · Fixed by #680
Assignees
Labels
enhancement New feature or request

Comments

@aborgna-q
Copy link
Collaborator

aborgna-q commented Sep 5, 2023

  • Add a method returning the Option<Port> for the static input (static_input_port?)
  • OpType::other_port returns the EdgeKind, and other_port_index returns the Port.
    Rename them to other_port_kind and other_port to avoid confusion.
  • Add more *_input/*_output helpers to the port getters to avoid writing the Direction.
@aborgna-q aborgna-q added enhancement New feature or request P-low labels Sep 5, 2023
@croyzor croyzor self-assigned this Sep 20, 2023
@ss2165 ss2165 assigned ss2165 and unassigned croyzor Nov 9, 2023
ss2165 added a commit that referenced this issue Nov 11, 2023
And addds `static_input_port` method.
Closes Clean up OpType methods #495
ss2165 added a commit that referenced this issue Nov 13, 2023
And addds `static_input_port` method.
Closes Clean up OpType methods #495
ss2165 added a commit that referenced this issue Nov 13, 2023
And addds `static_input_port` method.
Closes Clean up OpType methods #495
ss2165 added a commit that referenced this issue Nov 13, 2023
And addds `static_input_port` method.
Closes Clean up OpType methods #495
github-merge-queue bot pushed a commit that referenced this issue Nov 15, 2023
- [x] Closes #495
- [x] Closes #521
- [x] Closes #655
- [x] Closes #499
- [x] Closes #506 
- [x] Closes #653
- [x] `OpType::signature` returns option (non-dataflow ops don't return
signature)
- [x] Implement `try_into` from OpType references in to inner
references.

Doesn't necessarily do exactly as those issues specify - instead
considers them holistically for a more unified interface. Easiest to
review commit by commit.

Uses rust_version crate to use return position impl for the new
`HugrView` methods that return iterators. This will be stable with 1.75
(which enters beta in a few days).

BREAKING_CHANGES: `OpType` and `FunctionType` methods renamed for
clarity; `OpType::signature` returns `Option<FuncType>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants