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: Serialize index of control-flow ports #1924

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Feb 21, 2025

and remove logic duplicated in OpType::port_kind

The main goal here is to enable hugr-py to read in CFGs serialized from Rust, by changing the Rust to output in the same form as the python.

So, to test this...I should write out a file from the Rust test (i.e. comparing against snapshot)...and then load that into a test in python (that checks the CFG still has edges, it won't without this fix). We don't have any code that does this yet AFAICS so this is a draft while that remains TODO.

fixes #1923

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.71%. Comparing base (2f588cb) to head (1d7b630).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1924      +/-   ##
==========================================
- Coverage   83.78%   83.71%   -0.07%     
==========================================
  Files         196      196              
  Lines       37493    37538      +45     
  Branches    34306    34351      +45     
==========================================
+ Hits        31414    31426      +12     
- Misses       4296     4328      +32     
- Partials     1783     1784       +1     
Flag Coverage Δ
python 92.34% <ø> (ø)
rust 82.91% <100.00%> (-0.08%) ⬇️

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.

@acl-cqc acl-cqc changed the title Serialize number of control-flow ports fix: Serialize index of control-flow ports Feb 24, 2025
@acl-cqc acl-cqc requested a review from ss2165 February 24, 2025 08:47
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.

hugr-py cannot load CFG edges json-serialized from Rust
1 participant