Skip to content

Conversation

@cqc-alec
Copy link
Collaborator

@cqc-alec cqc-alec commented Nov 14, 2025

Closes #2287 .

Testing:

  • All existing hugr-py tests that call validate() perform a round-trip, checking that the hashes of the start and end Hugrs (computed using the _NodeHash method defined in conftest.py) agree.
  • I exported all the Hugrs generated by tests in the guppylang repo (using just export-integration-tests) and tried importing them (1) using the old method via json and (2) using the new method, and checked that the hashes of the two imported Hugrs agree (using the same _NodeHash method).

There are a few TODO comments remaining in load.py which I could not see a way to resolve using the existing model. I will investigate these further and raise issues if necessary.

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 69.06077% with 224 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.33%. Comparing base (1edeb25) to head (f3b2d12).

Files with missing lines Patch % Lines
hugr-py/src/hugr/model/load.py 70.09% 189 Missing ⚠️
hugr-py/src/hugr/tys.py 12.50% 14 Missing ⚠️
hugr-model/src/v0/binary/read.rs 0.00% 10 Missing ⚠️
hugr-py/src/hugr/model/__init__.py 76.31% 9 Missing ⚠️
hugr-py/src/hugr/envelope.py 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2683      +/-   ##
==========================================
- Coverage   83.53%   83.33%   -0.21%     
==========================================
  Files         266      267       +1     
  Lines       51718    52433     +715     
  Branches    47184    47194      +10     
==========================================
+ Hits        43204    43696     +492     
- Misses       6134     6357     +223     
  Partials     2380     2380              
Flag Coverage Δ
python 88.60% <70.02%> (-2.93%) ⬇️
rust 82.75% <0.00%> (-0.02%) ⬇️

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.

@cqc-alec cqc-alec marked this pull request as ready for review November 14, 2025 15:32
@cqc-alec cqc-alec requested a review from a team as a code owner November 14, 2025 15:32
@cqc-alec cqc-alec requested a review from croyzor November 14, 2025 15:32
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.

Read the binary format from Python

3 participants