-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Add Python TASO pass #180
Conversation
# Conflicts: # pyrs/src/optimiser.rs
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.
Nice!
pyrs/src/pass.rs
Outdated
/// This requires a `nam_6_3.rwr` file in the current directory. The location | ||
/// can alternatively be specified using the `rewriter_dir` argument. | ||
#[pyfunction] | ||
fn nam_taso_optimise( |
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.
This has almost the same doc as taso_optimise
. The fact that one rebases and the other doesn't should be clear there.
Perhaps just have a rebase
optional parameter that defaults to true
?
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.
Yes, I've removed the nam_
variant (I had originially thought I would write some of this in Python, but chose to have it all in Rust in the end).
1 => (vec![1], vec![timeout]), | ||
_ => unreachable!(), | ||
}; | ||
let optimiser = PyDefaultTasoOptimiser::load_precompiled(rewrite_dir.join("nam_6_3.rwr")); |
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.
The hardcoded file is sketchy... add a TODO to remove it for now.
34ee863
to
daafc2c
Compare
In hindsight this should have been part of #180. However, note that the Python tests currently fail: I get a segmentation fault, no idea why! drive by: renamed `PyDefaultTasoOptimiser` -> `PyTasoOptimiser`. --------- Co-authored-by: Agustin Borgna <[email protected]>
This is a useful Python binding to create the pytket-hyper extension on top of.