Zephyr layout coords fix
A bug in zephyr_layout in the file dwave-networkx/drawing/zephyr_layout.py is fixed so that if scale = scale, all positions fit within [0, scale] on the x-axis and [-scale, 0] on the y-axis.
A couple of tests are added to tests/test_zephyr_layout.py that would fail before fixing the bug. These test the range of x value and y-value produced by zephyr_layout for the default scale=1 and scale=10.
Similarly, for pegasus_layout and test_pegasus_layout.py
Codecov Report
Attention: Patch coverage is 6.45161% with 29 lines in your changes missing coverage. Please review.
Project coverage is 75.05%. Comparing base (
deb095f) to head (e0ccc6f). Report is 18 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| dwave_networkx/drawing/pegasus_layout.py | 6.25% | 15 Missing :warning: |
| dwave_networkx/drawing/zephyr_layout.py | 6.66% | 14 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #236 +/- ##
==========================================
- Coverage 75.96% 75.05% -0.91%
==========================================
Files 31 31
Lines 2184 2213 +29
==========================================
+ Hits 1659 1661 +2
- Misses 525 552 +27
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
- Flaky Tests Detection - Detect and resolve failed and flaky tests
@randomir - can you assign myself and @AndyZzzZzzZzz as reviewers?
@randomir Is this ready to be merged?
You're correct that the plots don't look different before and after this PR. However the document says scale=1 gives values in [0,1], and this is a feature that was relied on in the layout algorithm (in dnx_layout in layout.py) and the bug in this code caused the layout algorithm to give poor results.
@randomir Could you advise on numpy import?