Skip to content

fix utils tests and examples to accommodate get_properties changes, add utils for creation of schedules#51

Closed
jackraymond wants to merge 49 commits into
dwavesystems:mainfrom
jackraymond:feature/schedule-helper-functions
Closed

fix utils tests and examples to accommodate get_properties changes, add utils for creation of schedules#51
jackraymond wants to merge 49 commits into
dwavesystems:mainfrom
jackraymond:feature/schedule-helper-functions

Conversation

@jackraymond

@jackraymond jackraymond commented May 21, 2026

Copy link
Copy Markdown
Contributor

Helper functions for the creation of target-detector-source schedules is added.

@jackraymond jackraymond force-pushed the feature/schedule-helper-functions branch from 40e6206 to 78c22f7 Compare May 28, 2026 19:15
@jackraymond jackraymond marked this pull request as ready for review June 1, 2026 22:54
@jackraymond jackraymond changed the title First pass helper functions fix utils tests and examples to accommodate get_properties changes, add utils for creation of schedules Jun 25, 2026
Comment thread releasenotes/notes/schedule-creation-functions-0275ae3d8bb6dd8c.yaml Outdated
Comment thread dwave/experimental/multicolor_anneal/utils.py Outdated
Comment thread dwave/experimental/multicolor_anneal/utils.py Outdated
Comment thread dwave/experimental/multicolor_anneal/utils.py Outdated
Comment thread dwave/experimental/multicolor_anneal/utils.py Outdated
Comment thread dwave/experimental/multicolor_anneal/utils.py Outdated
Comment thread dwave/experimental/multicolor_anneal/utils.py Outdated
Comment thread dwave/experimental/multicolor_anneal/utils.py
Comment thread tests/test_multicolor_anneal.py Outdated
Comment thread tests/test_multicolor_anneal.py Outdated
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.12613% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.32%. Comparing base (42c3ce5) to head (b4d6d1d).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
dwave/experimental/multicolor_anneal/utils.py 76.12% 53 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
- Coverage   94.29%   91.32%   -2.97%     
==========================================
  Files          15       15              
  Lines        1139     1360     +221     
==========================================
+ Hits         1074     1242     +168     
- Misses         65      118      +53     

☔ 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.

@jackraymond jackraymond force-pushed the feature/schedule-helper-functions branch from 229dc37 to 3b9d2f1 Compare July 8, 2026 20:48
Comment on lines +881 to +909
pattern of PWL construction doesn't change.
pattern of PWL construction doesnt change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why this change?


import networkx as nx

from dwave_networkx import zephyr_coordinates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These should be changed to dwave-graphs.

Comment on lines +88 to +89
:func:`dwave_networkx.zephyr_graph` and
:func:`dwave_networkx.zephyr_coordinates`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These should also be changed to dwave-graph.

Comment on lines +280 to +281
raise ValueError("delay must be non-negative.")
completion_time = max(pwl[-1][0] for pwl in anneal_schedules)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise ValueError("delay must be non-negative.")
completion_time = max(pwl[-1][0] for pwl in anneal_schedules)
raise ValueError("delay must be non-negative.")
completion_time = max(pwl[-1][0] for pwl in anneal_schedules)

and min time steps. It checks terminal values of the polarizing schedules
match those of anneal_schedules, and all schedules begin at time 0.

It does not exhaustively check all requirements. See Documentation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bumping this.

Comment on lines +301 to +307
def verify_schedules(
exp_feature_info: list[dict, list[LineFeatureInfo]],
x_anneal_schedules: AnnealSchedules | None = None,
x_polarizing_schedule: AnnealSchedule | None = None,
check_rounding: bool = True,
term_time: float | None = None,
):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bumping this also. Still think that this can be simplified by splitting it up.

Comment on lines +881 to +883
for line in all_lines:
if anneal_schedules[line][0][0] != 0:
anneal_schedules[line] = [[0.0, 0.0]] + anneal_schedules[line]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since all_lines is a set, and anneal_schedules is created by iterating through the set, it's not certain that anneal_schedules[line] refers to the same one that was created earlier. Sets aren't ordered, so instead you could either use a dictionary for anneal_schedules or make all_lines a sequence before creating anneal_schedules.

@jackraymond

Copy link
Copy Markdown
Contributor Author

A simplified version is here:
#60
And expanded feature set (as draft PR) is here:
#58
Will look to modularize 58 further.

@jackraymond jackraymond closed this Jul 8, 2026
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.

3 participants