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

Move src/portmatching/pyo3.rs to pyrs #148

Closed
lmondada opened this issue Sep 29, 2023 · 2 comments · Fixed by #235
Closed

Move src/portmatching/pyo3.rs to pyrs #148

lmondada opened this issue Sep 29, 2023 · 2 comments · Fixed by #235
Assignees
Labels

Comments

@lmondada
Copy link
Contributor

There is no reason this should live within tket2.

@aborgna-q aborgna-q added enhancement New feature or request P-low chore and removed enhancement New feature or request labels Sep 29, 2023
@aborgna-q aborgna-q self-assigned this Oct 25, 2023
@aborgna-q
Copy link
Collaborator

Half of the code there is implementing #[pymethods] for structs in the crate. Those cannot be moved out (otherwise we'd be doing foreign type impls).

The other half of the code defines PyPatternMatch, which is used by the aforementioned impls so we cannot move out without changing the API.

I'll close this as WONTDO. We can review it in the future if we want to refactor the API in a way that doesn't require those impls.

@aborgna-q aborgna-q closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2023
@aborgna-q
Copy link
Collaborator

Reopening this as it's useful for #178

@aborgna-q aborgna-q reopened this Nov 10, 2023
github-merge-queue bot pushed a commit that referenced this issue Nov 10, 2023
Adds transparent wrappers on `tket2-py` that derive pyclass themselves.
This has multiple goals:

- Cleans up the code. Python stuff goes into the python crate.
Now `tket2:pyo3` and `hugr:pyo3` are only used for the python error
implementations.
(We could potentially move this too, and avoid us the `pyo3` dependency
headache).
  
- Let's us use the `tket2-py` conversion methods for tket1 and tket2
circuits. This is required for #178, which is in turn required for all
the python bindings in #204 that require stable indices.

Closes #148 

---

The code is mostly the same, asides from:
- replacing the custom implementation of `PyPatternMatch` with a
transparent wrapper. (There was a TODO for this).
- updating to tket-json-rs 0.3 (cleans up some calls that use
`Python::with_gil`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants