From 39f415b15b02d4f3bbcbb1e1ee7832985f8571ae Mon Sep 17 00:00:00 2001 From: John Children Date: Fri, 29 Nov 2024 13:25:47 +0000 Subject: [PATCH] chore: Remove use of removed auto_rebase_pass Pytket 1.36 removed the auto_rebase_pass function, replacing it with AutoRebase. This commit updates the code that uses with function and replaces it with the new class. --- tket2-py/src/passes.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tket2-py/src/passes.rs b/tket2-py/src/passes.rs index c33fce64..bb921a62 100644 --- a/tket2-py/src/passes.rs +++ b/tket2-py/src/passes.rs @@ -59,15 +59,13 @@ fn greedy_depth_reduce<'py>(circ: &Bound<'py, PyAny>) -> PyResult<(Bound<'py, Py /// /// Equivalent to running the following code: /// ```python -/// from pytket.passes.auto_rebase import auto_rebase_pass +/// from pytket.passes import AutoRebase /// from pytket import OpType -/// auto_rebase_pass({OpType.CX, OpType.Rz, OpType.H}).apply(circ)" +/// AutoRebase({OpType.CX, OpType.Rz, OpType.H}).apply(circ)" // ``` fn rebase_nam(circ: &Bound) -> PyResult<()> { let py = circ.py(); - let auto_rebase = py - .import_bound("pytket.passes.auto_rebase")? - .getattr("auto_rebase_pass")?; + let auto_rebase = py.import_bound("pytket.passes")?.getattr("AutoRebase")?; let optype = py.import_bound("pytket")?.getattr("OpType")?; let locals = [("OpType", &optype)].into_py_dict_bound(py); let op_set = py.eval_bound("{OpType.CX, OpType.Rz, OpType.H}", None, Some(&locals))?;