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

feat: Special cased array, float and int constants in hugr-model export #1857

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

zrho
Copy link
Contributor

@zrho zrho commented Jan 13, 2025

This PR special cases the import/export of array, float and int constants so that they are represented as terms in hugr-model. This representation is a lot more efficient to handle than the encoding as JSON. In the future we should do this for all constants.

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 78.84615% with 22 lines in your changes missing coverage. Please review.

Project coverage is 86.56%. Comparing base (be3961d) to head (39dafb9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/import.rs 58.49% 10 Missing and 12 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1857    +/-   ##
========================================
  Coverage   86.55%   86.56%            
========================================
  Files         195      195            
  Lines       35584    35686   +102     
  Branches    32397    32499   +102     
========================================
+ Hits        30800    30891    +91     
+ Misses       3012     3010     -2     
- Partials     1772     1785    +13     
Flag Coverage Δ
python 92.34% <ø> (ø)
rust 85.99% <78.84%> (+0.01%) ⬆️

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.

@hugrbot
Copy link
Collaborator

hugrbot commented Jan 15, 2025

This PR contains breaking changes to the public Rust API.
Please deprecate the old API instead (if possible), or mark the PR with a ! to indicate a breaking change.

cargo-semver-checks summary

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.38.0/src/lints/enum_variant_added.ron

Failed in:
variant Term:Float in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-model/src/v0/mod.rs:724
variant Term:FloatType in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-model/src/v0/mod.rs:730

@zrho zrho marked this pull request as ready for review January 16, 2025 14:49
@zrho zrho requested a review from a team as a code owner January 16, 2025 14:49
@zrho zrho requested a review from ss2165 January 16, 2025 14:49
@zrho zrho force-pushed the zrho/model-compact-arrays branch from 7b7bc0d to b588731 Compare January 16, 2025 15:59
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.

🚀

hugr/Cargo.toml Outdated Show resolved Hide resolved
hugr-model/src/v0/text/print.rs Show resolved Hide resolved
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 force-pushed the zrho/model-compact-arrays branch from 79a9137 to 39dafb9 Compare January 21, 2025 11:56
@zrho zrho added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit 7483103 Jan 21, 2025
21 of 23 checks passed
@zrho zrho deleted the zrho/model-compact-arrays branch January 21, 2025 12:08
@hugrbot hugrbot mentioned this pull request Jan 21, 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.

4 participants