Skip to content

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Aug 13, 2025

  • Moves the pytket parameter parser logic into a param submodule
  • Moves LoadedParam definition to its own submodule

@aborgna-q aborgna-q requested a review from a team as a code owner August 13, 2025 16:32
@aborgna-q aborgna-q requested a review from doug-q August 13, 2025 16:32
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 85.83333% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.74%. Comparing base (2cdc11b) to head (5ed0769).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tket/src/serialize/pytket/decoder/param/parser.rs 85.13% 5 Missing and 6 partials ⚠️
tket/src/serialize/pytket/decoder/param.rs 86.95% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1035      +/-   ##
==========================================
- Coverage   79.76%   79.74%   -0.03%     
==========================================
  Files          96       97       +1     
  Lines       11643    11654      +11     
  Branches    11364    11375      +11     
==========================================
+ Hits         9287     9293       +6     
- Misses       1725     1730       +5     
  Partials      631      631              
Flag Coverage Δ
python 81.00% <ø> (ø)
rust 79.70% <85.83%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot

This comment was marked as spam.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code was just moved from param.rs

@aborgna-q aborgna-q requested review from cqc-alec and removed request for doug-q August 13, 2025 16:50
@aborgna-q aborgna-q changed the title feat: Add a LoadedParam struct for the pytket decoder chore: Organize decoder code Aug 13, 2025
Copy link
Collaborator

@cqc-alec cqc-alec left a comment

Choose a reason for hiding this comment

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

Not sure why the semver check failed...

Comment on lines +6 to +10
#[expect(
unused_imports,
reason = "Temporarily unused while we refactor the pytket decoder"
)]
pub use param::{LoadedParameter, LoadedParameterType};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this still needed?

Copy link
Collaborator Author

@aborgna-q aborgna-q Aug 14, 2025

Choose a reason for hiding this comment

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

Yes, expect fails when it's no longer needed.

I'm later making the decoder module public in #1030, but for now the pub export here doesn't do anything. (I just left it so we don't forget)

Comment on lines +51 to +55
#[expect(
dead_code,
reason = "Temporarily unused while we refactor the pytket decoder"
)]
pub fn wire_type(&self) -> &Type {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this is a new method, that will be used by #1036
(this was a quick split out of the pytket decoder framework PR, sorry it's a bit messy)

@aborgna-q aborgna-q added this pull request to the merge queue Aug 14, 2025
Merged via the queue into main with commit 505100b Aug 14, 2025
23 of 24 checks passed
@aborgna-q aborgna-q deleted the ab/decoder-lopaded-param branch August 14, 2025 11:07
github-merge-queue bot pushed a commit that referenced this pull request Aug 15, 2025
Defines a `WireTracker` struct for the pytket decoder framework.

It keeps track of wires that have been added to the HUGR being created
along with which qubit/bit/parameter elements each of them carries
(wires may carry multiple, see `PytketTypeTranslator` in
`::serialize::pytket::extensions`.
The tracker lets us associate new wires with registers/parameters, and
updates previous references so they know they don't have the latest
pytket register value.

In the future we'll expand this tracker to let us do automatic type
translations (e.g. unpacking a tuple), as defined by the extension
decoders.

Also adds a new `Tk1DecodeError` that will be used by the decoder
framework.

Depends on #1035
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.

2 participants