fix(hugr-py): solved graph rendering with Const nodes after applyingNormalizeGuppy#2744
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2744 +/- ##
==========================================
- Coverage 83.36% 83.36% -0.01%
==========================================
Files 267 267
Lines 52505 52507 +2
Branches 47214 47214
==========================================
+ Hits 43773 43774 +1
- Misses 6354 6355 +1
Partials 2378 2378
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:
|
|
Should we instead reapply some DCE to remove the unused Consts? We might also want to consider hash-consing identical Consts into a single node, at least for those which can be hashed ;) |
aborgna-q
left a comment
There was a problem hiding this comment.
The tests are failing due to formatting, try running just format (or just check) to fix that
I think the constant folding pass will remove the unneeded constants already. And merging identical const may be doable at load time? But it should be easy to write a pass for it |
I committed the file properly formatted |
🤖 I have created a release *beep* *boop* --- ## [0.15.0](hugr-py-v0.14.2...hugr-py-v0.15.0) (2026-01-02) ### ⚠ BREAKING CHANGES * ValueArray is gone, as is LinearizeArrayPass * **hugr-py:** Removes `extensions` field of `val.Extension`. ### Features * `collated_digitstring_counts` to extend bitstring collation to digits ([#2788](#2788)) ([191c473](191c473)) * **hugr-py:** Remove `extensions` field of `val.Extension`. ([#2686](#2686)) ([911c089](911c089)) * Make `ComposablePass.__call__` return a Hugr ([#2697](#2697)) ([dbf8c8e](dbf8c8e)) * Result type for ComposablePasses ([#2703](#2703)) ([b8df28e](b8df28e)) ### Bug Fixes * **hugr-py:** solved graph rendering with `Const` nodes after applying`NormalizeGuppy` ([#2744](#2744)) ([d996690](d996690)) * set hugr field of `PassResult` correctly ([#2715](#2715)) ([d860722](d860722)) ### Code Refactoring * Delete ValueArray ([#2760](#2760)) ([b3cdc4e](b3cdc4e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Solve issue Improve Python graph rendering for Const nodes #2726.
"When drawing the hugr in Python with DotRenderer the Const nodes take up an unreasonable amount of space which makes the HUGR hard to navigate. (This happens after applying the NormalizeGuppy pass to a HUGR containing parameterized gates)."
Defined the method
__str__to theExtension(Value)class inhugr-py/src/hugr/val.py