Skip to content

feat: Export entrypoint metadata in Python and fix bug in import #2434

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

Merged
merged 3 commits into from
Jul 16, 2025

Conversation

zrho
Copy link
Contributor

@zrho zrho commented Jul 11, 2025

This PR ensures that the core.entrypoint metadata is exported in the Python bindings. It also fixes a bug in hugr-core import that added children of the root node to the entrypoint instead of the root.

Copy link

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.56%. Comparing base (6a0e270) to head (41480bd).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/import.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2434   +/-   ##
=======================================
  Coverage   82.56%   82.56%           
=======================================
  Files         247      247           
  Lines       45894    45900    +6     
  Branches    41528    41528           
=======================================
+ Hits        37891    37897    +6     
  Misses       5981     5981           
  Partials     2022     2022           
Flag Coverage Δ
python 91.26% <100.00%> (+0.01%) ⬆️
rust 81.64% <0.00%> (ø)

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.

@zrho zrho force-pushed the zrho/push-qywuqzomwxqs branch from 2749fb7 to dc50cc2 Compare July 11, 2025 11:58
@zrho zrho marked this pull request as ready for review July 11, 2025 12:08
@zrho zrho requested a review from a team as a code owner July 11, 2025 12:08
@zrho zrho requested a review from aborgna-q July 11, 2025 12:08
@ss2165
Copy link
Member

ss2165 commented Jul 11, 2025

Either split in to two PRs or include both changes in PR title (otherwise second is lost in changelog)

@zrho zrho changed the title feat: Export entrypoint metadata in Python feat: Export entrypoint metadata in Python and fix bug in import Jul 11, 2025
@zrho
Copy link
Contributor Author

zrho commented Jul 11, 2025

Edited the title since it makes sense to keep them together: the metadata export from Python unearthed the bug.

Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

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

I don't understand the behaviour of the standalone arg. A docstring addition might help.

@zrho zrho force-pushed the zrho/push-qywuqzomwxqs branch from 1aa3b34 to 11c60e3 Compare July 14, 2025 15:49
@zrho zrho force-pushed the zrho/push-qywuqzomwxqs branch from 11c60e3 to 41480bd Compare July 15, 2025 08:45
@zrho
Copy link
Contributor Author

zrho commented Jul 15, 2025

The standalone argument was meant to prevent the entrypoint metadata to be emitted twice when a core node corresponds to both a node and a region in hugr-model (which is the case for all hierarchical nodes except for Case). The argument is gone now, since I remembered that we wanted the regions to be the entrypoints and not the nodes.

@zrho zrho self-assigned this Jul 16, 2025
@zrho zrho requested a review from ss2165 July 16, 2025 08:54
Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

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

thanks

@zrho zrho added this pull request to the merge queue Jul 16, 2025
Merged via the queue into main with commit d17b245 Jul 16, 2025
26 checks passed
@zrho zrho deleted the zrho/push-qywuqzomwxqs branch July 16, 2025 09:51
This was referenced Jul 16, 2025
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