-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
unwrapped DAGCircuit::collect_runs() to not return an Option #13222
Conversation
|
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
7fb8fb7
to
a0c3026
Compare
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, @cameron-d28!
This looks like a good start. I've left a few comments inline, primarily regarding the way we ought to handle the cycle error case. After addressing that, you'll need to adjust py_collect_runs
as well for the new return type.
thank you for the feedback @kevinhartman! i have improved my changes. please let me know how they look 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, @cameron-d28!
This is looking good to me now. I like the change you made to use a single for-loop rather than a map followed by a for-loop when adding runs to the out_set
in DAGCircuit::py_collect_runs
.
Pull Request Test Coverage Report for Build 11077292777Details
💛 - Coveralls |
glad to see the update made sense @kevinhartman! i didn't see why the mapping would still be needed - (maybe for lazy eval?? not sure). |
…13222) * changed collect runs to unwrap Option and route error to DAGCircuit * changes by @kevinhartman * updated py_collect_runs * update collect_runs calls and specified lifteime of return --------- Co-authored-by: Kevin Hartman <[email protected]>
…13222) * changed collect runs to unwrap Option and route error to DAGCircuit * changes by @kevinhartman * updated py_collect_runs * update collect_runs calls and specified lifteime of return --------- Co-authored-by: Kevin Hartman <[email protected]>
Summary
This change updates the collect_runs function to return a PyResult instead of an Option so that error can be routed by to DAGCircuit when invalid states are present.
Details and comments
fixes #13109