-
Notifications
You must be signed in to change notification settings - Fork 8
chore: Organize decoder code #1035
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
Conversation
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
There was a problem hiding this 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...
#[expect( | ||
unused_imports, | ||
reason = "Temporarily unused while we refactor the pytket decoder" | ||
)] | ||
pub use param::{LoadedParameter, LoadedParameterType}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed?
There was a problem hiding this comment.
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)
#[expect( | ||
dead_code, | ||
reason = "Temporarily unused while we refactor the pytket decoder" | ||
)] | ||
pub fn wire_type(&self) -> &Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needed?
There was a problem hiding this comment.
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)
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
param
submoduleLoadedParam
definition to its own submodule