Skip to content

Conversation

jakelishman
Copy link
Member

Summary

Two changes in pydot 3 changed the reference output:

  1. previously, attributes were sorted before being output. Pydot 3 stores them in declaration order. Here, we sort our attributes to maintain the closest behaviour between the two versions.

  2. Text fields (like label) that contain special characters now have their values enclosed in quote marks. This is a difference between the two versions, and we update the reference files to the new version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our tests that are a little more tied to the current version.

Details and comments

Two changes in pydot 3 changed the reference output:

1. previously, attributes were sorted before being output.  Pydot 3
   stores them in declaration order.  Here, we sort our attributes to
   maintain the closest behaviour between the two versions.

2. Text fields (like `label`) that contain special characters now have
   their values enclosed in quote marks.  This is a difference between
   the two versions, and we update the reference files to the new
   version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our
tests that are a little more tied to the current version.
@jakelishman jakelishman added type: qa Issues and PRs that relate to testing and code quality stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog mod: visualization qiskit.visualization labels Jul 16, 2024
@jakelishman jakelishman requested review from nonhermitian and a team as code owners July 16, 2024 11:23
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

@coveralls
Copy link

coveralls commented Jul 16, 2024

Pull Request Test Coverage Report for Build 9956375211

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.04%) to 89.916%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/visualization/pass_manager_visualization.py 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
qiskit/visualization/pass_manager_visualization.py 1 17.54%
qiskit/synthesis/clifford/clifford_decompose_ag.py 2 96.15%
Totals Coverage Status
Change from base Build 9917090942: 0.04%
Covered Lines: 65812
Relevant Lines: 73193

💛 - Coveralls

@jakelishman
Copy link
Member Author

@Mergifyio backport stable/0.46 stable/1.1

Copy link
Contributor

mergify bot commented Jul 16, 2024

backport stable/0.46 stable/1.1

✅ Backports have been created

mtreinish
mtreinish previously approved these changes Jul 16, 2024
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

This looks fine to me assuming it passes CI, it's just an argument reordering and escaping change in the expected output. I guess the open question is did you want to throw a test version constraint on > 3.0.0 and leave the optional requirement at whatever the current minimum is? It doesn't matter too much so feel free to just enqueue this for merging if you're fine leaving the minimum for testing unchanged.

@jakelishman
Copy link
Member Author

That sounds like a good idea - done in 7158eef.

@mtreinish mtreinish enabled auto-merge July 16, 2024 12:14
@mtreinish mtreinish added this pull request to the merge queue Jul 16, 2024
Merged via the queue into Qiskit:main with commit c3b468c Jul 16, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Jul 16, 2024
* Fix pass-manager drawing tests for pydot 3.0

Two changes in pydot 3 changed the reference output:

1. previously, attributes were sorted before being output.  Pydot 3
   stores them in declaration order.  Here, we sort our attributes to
   maintain the closest behaviour between the two versions.

2. Text fields (like `label`) that contain special characters now have
   their values enclosed in quote marks.  This is a difference between
   the two versions, and we update the reference files to the new
   version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our
tests that are a little more tied to the current version.

* Add test-only constraint on pydot

(cherry picked from commit c3b468c)

# Conflicts:
#	qiskit/visualization/pass_manager_visualization.py
#	test/python/visualization/references/pass_manager_standard.dot
#	test/python/visualization/references/pass_manager_style.dot
mergify bot pushed a commit that referenced this pull request Jul 16, 2024
* Fix pass-manager drawing tests for pydot 3.0

Two changes in pydot 3 changed the reference output:

1. previously, attributes were sorted before being output.  Pydot 3
   stores them in declaration order.  Here, we sort our attributes to
   maintain the closest behaviour between the two versions.

2. Text fields (like `label`) that contain special characters now have
   their values enclosed in quote marks.  This is a difference between
   the two versions, and we update the reference files to the new
   version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our
tests that are a little more tied to the current version.

* Add test-only constraint on pydot

(cherry picked from commit c3b468c)
@jakelishman jakelishman deleted the fix-pydot3 branch July 16, 2024 14:08
jakelishman added a commit that referenced this pull request Jul 16, 2024
* Fix pass-manager drawing tests for pydot 3.0

Two changes in pydot 3 changed the reference output:

1. previously, attributes were sorted before being output.  Pydot 3
   stores them in declaration order.  Here, we sort our attributes to
   maintain the closest behaviour between the two versions.

2. Text fields (like `label`) that contain special characters now have
   their values enclosed in quote marks.  This is a difference between
   the two versions, and we update the reference files to the new
   version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our
tests that are a little more tied to the current version.

* Add test-only constraint on pydot

(cherry picked from commit c3b468c)
github-merge-queue bot pushed a commit that referenced this pull request Jul 16, 2024
* Fix pass-manager drawing tests for pydot 3.0

Two changes in pydot 3 changed the reference output:

1. previously, attributes were sorted before being output.  Pydot 3
   stores them in declaration order.  Here, we sort our attributes to
   maintain the closest behaviour between the two versions.

2. Text fields (like `label`) that contain special characters now have
   their values enclosed in quote marks.  This is a difference between
   the two versions, and we update the reference files to the new
   version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our
tests that are a little more tied to the current version.

* Add test-only constraint on pydot

(cherry picked from commit c3b468c)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
github-merge-queue bot pushed a commit that referenced this pull request Jul 16, 2024
* Fix pass-manager drawing tests for pydot 3.0 (#12775)

* Fix pass-manager drawing tests for pydot 3.0

Two changes in pydot 3 changed the reference output:

1. previously, attributes were sorted before being output.  Pydot 3
   stores them in declaration order.  Here, we sort our attributes to
   maintain the closest behaviour between the two versions.

2. Text fields (like `label`) that contain special characters now have
   their values enclosed in quote marks.  This is a difference between
   the two versions, and we update the reference files to the new
   version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our
tests that are a little more tied to the current version.

* Add test-only constraint on pydot

(cherry picked from commit c3b468c)

* Fix reference files

---------

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
* Fix pass-manager drawing tests for pydot 3.0

Two changes in pydot 3 changed the reference output:

1. previously, attributes were sorted before being output.  Pydot 3
   stores them in declaration order.  Here, we sort our attributes to
   maintain the closest behaviour between the two versions.

2. Text fields (like `label`) that contain special characters now have
   their values enclosed in quote marks.  This is a difference between
   the two versions, and we update the reference files to the new
   version since that's what we'll be using in CI.

Qiskit is still compatible with pydot 2 in general usage, it's just our
tests that are a little more tied to the current version.

* Add test-only constraint on pydot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog mod: visualization qiskit.visualization stable backport potential The bug might be minimal and/or import enough to be port to stable type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants