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

fix: Unpickling an AbstractInstruction will result in an AbstractInstruction instead of a quil Instruction #1801

Merged
merged 8 commits into from
Aug 13, 2024

Conversation

MarquessV
Copy link
Contributor

Description

Closes #1800

Checklist

  • The PR targets the master branch
  • The above description motivates these changes.
  • The change is atomic and can be described by a single commit (your PR will be squashed on merge).
  • All changes to code are covered via unit tests.
  • Parameters and return values have type hints with PEP 484 syntax.
  • Functions and classes have useful Sphinx-style docstrings.
  • (Bugfix) The associated issue is referenced above using auto-close keywords.

@MarquessV MarquessV requested a review from a team as a code owner August 13, 2024 17:37
@MarquessV MarquessV changed the title 1800 pickling fix fix: Unpickling an AbstractInstruction will result in an AbstractInstruction instead of a quil Instruction Aug 13, 2024
Copy link

github-actions bot commented Aug 13, 2024

🐰Bencher

ReportTue, August 13, 2024 at 22:36:14 UTC
Projectpyquil
Branch1800-pickling-fix
Testbedci-runner-linux
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
test/benchmarks/test_program.py::test_copy_everything_except_instructions✅ (view plot)9,963,794,907.60 (-2.60%)10,465,131,779.23 (95.21%)
test/benchmarks/test_program.py::test_instructions✅ (view plot)3,762,912,532.80 (-3.95%)4,044,600,481.93 (93.04%)
test/benchmarks/test_program.py::test_iteration✅ (view plot)3,779,460,840.20 (-3.74%)4,048,144,930.53 (93.36%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link
Contributor

@jselig-rigetti jselig-rigetti left a comment

Choose a reason for hiding this comment

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

LGTM, looks like it includes the changes from #1799 as well though

@instructions.setter
def instructions(self, instructions: list[AbstractInstruction]) -> None:
self.instrs = instructions

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this include work from #1799 then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically, it's based on the branch from #1799, so the commit with that fix is included here. I'll squash & merge #1799 first so we get two distinct changelog entries for the fix.

Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7253 6366 88% 87% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
pyquil/quilbase.py 94% 🟢
TOTAL 94% 🟢

updated for commit: c2d517b by action🐍

@MarquessV MarquessV merged commit 23967ca into master Aug 13, 2024
22 checks passed
@MarquessV MarquessV deleted the 1800-pickling-fix branch August 13, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unpickling AbstractInstruction classes returns quil types
2 participants