fix utils tests and examples to accommodate get_properties changes, add utils for creation of schedules#51
Conversation
40e6206 to
78c22f7
Compare
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
…erval=polarized_preparation_interval
… depolarized preparation
229dc37 to
3b9d2f1
Compare
| pattern of PWL construction doesn't change. | ||
| pattern of PWL construction doesnt change. |
|
|
||
| import networkx as nx | ||
|
|
||
| from dwave_networkx import zephyr_coordinates |
There was a problem hiding this comment.
These should be changed to dwave-graphs.
| :func:`dwave_networkx.zephyr_graph` and | ||
| :func:`dwave_networkx.zephyr_coordinates`. |
There was a problem hiding this comment.
These should also be changed to dwave-graph.
| raise ValueError("delay must be non-negative.") | ||
| completion_time = max(pwl[-1][0] for pwl in anneal_schedules) |
There was a problem hiding this comment.
| 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. |
| 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, | ||
| ): |
There was a problem hiding this comment.
Bumping this also. Still think that this can be simplified by splitting it up.
| for line in all_lines: | ||
| if anneal_schedules[line][0][0] != 0: | ||
| anneal_schedules[line] = [[0.0, 0.0]] + anneal_schedules[line] |
There was a problem hiding this comment.
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.
Helper functions for the creation of target-detector-source schedules is added.