Skip to content

Commit

Permalink
Merge pull request #550 from randomir/fix-doctests-post-dwave.sampler…
Browse files Browse the repository at this point in the history
…s-switch

Fix doctests post `dwave.samplers` switch
  • Loading branch information
randomir authored Dec 4, 2024
2 parents 36af264 + 6fd0b55 commit 1bb84c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/reference/warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ structured to represent variable ``a`` with a long chain.

>>> import networkx as nx
>>> import dimod
>>> import greedy
>>> import dwave.samplers
...
>>> G = nx.Graph()
>>> G.add_edges_from([(n, n + 1) for n in range(10)])
>>> sampler = dimod.StructureComposite(greedy.SteepestDescentSampler(), G.nodes, G.edges)
>>> sampler = dimod.StructureComposite(dwave.samplers.SteepestDescentSampler(), G.nodes, G.edges)
>>> sampleset = EmbeddingComposite(sampler).sample_ising({}, {("a", "b"): -1},
... return_embedding=True,
... embedding_parameters={"fixed_chains": {"a": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]}},
Expand Down
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
sphinx
sphinx_rtd_theme
dwave-greedy==0.3.0
sphinx_rtd_theme
7 changes: 3 additions & 4 deletions dwave/system/composites/linear_ancilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class LinearAncillaComposite(dimod.ComposedSampler, dimod.Structured):
large flux-bias offset.
Args:
child_sampler (:class:`dimod.Sampler`):
A dimod sampler, such as a :class:`~dwave.system.samplers.DWaveSampler()`,
that has flux bias controls.
child_sampler (:class:`dimod.Sampler`):
A dimod sampler, such as a :class:`~dwave.system.samplers.DWaveSampler()`,
that has flux bias controls.
Examples:
This example submits a two-qubit problem consisting of linear biases with opposed signs
Expand All @@ -52,7 +52,6 @@ class LinearAncillaComposite(dimod.ComposedSampler, dimod.Structured):
>>> sampleset = sampler.sample_ising({0:1, 1:-1}, {(0, 1): 1}, fast_anneal=True) # doctest: +SKIP
>>> sampleset.first.energy # doctest: +SKIP
-3
"""

def __init__(
Expand Down

0 comments on commit 1bb84c6

Please sign in to comment.