Typing#
Type hints for common dimod inputs.
- GraphLike[source]#
Objects that can be interpreted as a graph.
This includes:
An
int
, interpreted as a complete graph with nodes labelledrange(n)
.A list of edges
A 2-tuple containing a list of nodes and a list of edges
alias of
Union
[int
,Tuple
[Collection
[Hashable
],Collection
[Tuple
[Hashable
,Hashable
]]],Collection
[Tuple
[Hashable
,Hashable
]],Graph
]
- Polynomial[source]#
A polynomial represented by a mapping.
alias of
Mapping
[Sequence
[Hashable
],Union
[float
,floating
,integer
]]
- SampleLike[source]#
Objects that can be interpreted as a single sample.
This includes:
A one-dimensional NumPy array_like.
A 2-
tuple
containing a one-dimensional NumPy array_like and a list of variable labels.A
dict
where the keys are variable labels and the values are the assignments.
NumPy array_like is a very flexible definition.
alias of
Union
[Sequence
[Union
[float
,floating
,integer
]],Mapping
[Hashable
,Union
[float
,floating
,integer
]],Tuple
[Sequence
[Union
[float
,floating
,integer
]],Sequence
[Hashable
]],Tuple
[ndarray
,Sequence
[Hashable
]],ndarray
]
- SamplesLike[source]#
Objects that can be interpreted as a collection of samples.
This includes:
Any
SampleLike
.A two-dimensional NumPy array_like.
A 2-
tuple
containing a two-dimensional array_like and a list of variable labels.
alias of
Union
[Sequence
[Union
[float
,floating
,integer
]],Mapping
[Hashable
,Union
[float
,floating
,integer
]],Tuple
[Sequence
[Union
[float
,floating
,integer
]],Sequence
[Hashable
]],Tuple
[ndarray
,Sequence
[Hashable
]],ndarray
,Sequence
[Sequence
[Union
[float
,floating
,integer
]]],Tuple
[Sequence
[Sequence
[Union
[float
,floating
,integer
]]],Sequence
[Hashable
]],Sequence
[Union
[Sequence
[Union
[float
,floating
,integer
]],Mapping
[Hashable
,Union
[float
,floating
,integer
]],Tuple
[Sequence
[Union
[float
,floating
,integer
]],Sequence
[Hashable
]],Tuple
[ndarray
,Sequence
[Hashable
]],ndarray
]],Iterator
[Union
[Sequence
[Union
[float
,floating
,integer
]],Mapping
[Hashable
,Union
[float
,floating
,integer
]],Tuple
[Sequence
[Union
[float
,floating
,integer
]],Sequence
[Hashable
]],Tuple
[ndarray
,Sequence
[Hashable
]],ndarray
]]]