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

feat: Use ensure_routine to streamline conversion from Qref to Bartiq #125

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

dexter2206
Copy link
Contributor

Description

This uses the recently introduced ensure_routine from qref.functools to streamline conversions between Qref objects and Bartiq native dataclasses. Relies on PsiQ/qref#122 to be merged first (and then Qref to be released).

Please verify that you have completed the following steps

  • I have self-reviewed my code.
  • I have included test cases validating introduced feature/fix.
  • I have updated documentation.

@cla-bot cla-bot bot added the cla-signed label Sep 29, 2024
@dexter2206 dexter2206 marked this pull request as draft September 30, 2024 00:00
@@ -120,8 +121,8 @@ def filter_ports(self, directions: Iterable[str]) -> dict[str, Port[T]]:
return {port_name: port for port_name, port in self.ports.items() if port.direction in directions}

@classmethod
def from_qref(cls, qref_obj: SchemaV1 | RoutineV1, backend: SymbolicBackend[T]) -> Routine[T]:
program = qref_obj.program if isinstance(qref_obj, SchemaV1) else qref_obj
def from_qref(cls, qref_obj: AnyQrefType, backend: SymbolicBackend[T]) -> Routine[T]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lack of docstrings?

@dexter2206 dexter2206 marked this pull request as ready for review October 9, 2024 09:34
@dexter2206 dexter2206 merged commit c03e5f0 into main Oct 9, 2024
7 checks passed
@dexter2206 dexter2206 deleted the use-ensure-routine branch October 9, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants