Add keyboard interrupts for subgraph.find_subgraph#275
Merged
boothby merged 2 commits intodwavesystems:mainfrom Oct 29, 2025
Merged
Add keyboard interrupts for subgraph.find_subgraph#275boothby merged 2 commits intodwavesystems:mainfrom
boothby merged 2 commits intodwavesystems:mainfrom
Conversation
675445d to
fdfc0cc
Compare
Collaborator
Author
|
Test procedure:
from minorminer import subgraph, find_embedding
from time import sleep
import dwave_networkx as dnx
source = dnx.chimera_graph(8)
target = dnx.chimera_graph(15, coordinates=True)
target.remove_node((7,7,0,0))
emb = subgraph.find_subgraph(source, target)
print("caught an interrupt in find_subgraph")
emb = find_embedding(source, target, chainlength_patience = 1000000, interactive=True, tries=1)
print("caught an interrupt in find_embedding")
emb = subgraph.find_subgraph(source, target)
print("caught an interrupt in find_subgraph")
try:
sleep(1000)
except KeyboardInterrupt:
print("caught an interrupt in sleep")
|
Merged
mahdiehmalekian
pushed a commit
to mahdiehmalekian/minorminer
that referenced
this pull request
Nov 14, 2025
* added ability to interrupt find_subgraph via ctrl-c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've finally figured out a (hopefully) good-enough means to halt on ctrl-c within
find_subgraph. Sadly, testing this capability in CI has proven flaky in the past (as seen in tests/test_lib.py:841 ). I'll try and scrounge some folks on windows and osx to do some tests.