Skip to content

Fix #555: Method Pattern.draw attempts to compute Pauli flow from pattern.#561

Open
matulni wants to merge 4 commits into
TeamGraphix:masterfrom
matulni:fix555-vis-pauliflow
Open

Fix #555: Method Pattern.draw attempts to compute Pauli flow from pattern.#561
matulni wants to merge 4 commits into
TeamGraphix:masterfrom
matulni:fix555-vis-pauliflow

Conversation

@matulni

@matulni matulni commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fix #555: Method Pattern.draw attempts to compute Pauli flow from pattern before fall back to flow extraction from open graph.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.61%. Comparing base (2351197) to head (8e83816).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #561      +/-   ##
==========================================
+ Coverage   90.58%   90.61%   +0.02%     
==========================================
  Files          49       49              
  Lines        7481     7477       -4     
==========================================
- Hits         6777     6775       -2     
+ Misses        704      702       -2     

☔ View full report in Codecov by Harness.
📢 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.

Comment thread graphix/pattern.py
Comment thread graphix/pattern.py
Comment thread graphix/pattern.py Outdated
og = self.extract_opengraph()
gv = GraphVisualizer.from_opengraph(og=og, **options)
else:
xz_corrections = self.extract_xzcorrections()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit-picking: could we use xzcorrections for the variable name as well, following the convention of #557.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 213eef7

Comment thread graphix/pattern.py Outdated
case DrawPatternAnnotations.XZCorrections:
xzcorrections = self.extract_xzcorrections()
gv = GraphVisualizer.from_xzcorrections(xz_corr=xzcorrections, **options)
gv = GraphVisualizer.from_xzcorrections(xz_corr=xz_corrections, **options)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit‑picking: I think it's preferable to pass xz_corr as a positional argument, since there is no ambiguity here and the name isn't necessarily stable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 213eef7

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These images are identical: they do not need to be updated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They were all generated with pytest --mpl-generate-path=tests/baseline, is it possible to selectively generate a few of them only ?
I tried to amend the commit to remove the unnecessary updates, but now I'm not sure if I just removed them altogether.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You've removed them indeed in 923119 but you've restored them since, thanks!
We can generate only the images related to a given test by running pytest --mpl-generate-path=tests/baseline -k test-name.

@matulni matulni force-pushed the fix555-vis-pauliflow branch from 3675e75 to 062d91e Compare July 13, 2026 13:48

@thierry-martinez thierry-martinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thanks.

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.

[Bug]: Pattern.draw should attempt to compute the Pauli flow from pattern

2 participants