def dimod_object_hook(obj): """JSON-decoding for dimod objects. See Also: :class:`json.JSONDecoder` for using custom decoders. """ if _is_sampleset_v2(obj): # in the future we could handle subtypes but right now we just have the # one return SampleSet.from_serializable(obj) elif _is_bqm(obj): # in the future we could handle subtypes but right now we just have the # one return BinaryQuadraticModel.from_serializable(obj) return obj
def __init__(self, fujitsu_answer): sampleset = SampleSet.from_serializable(fujitsu_answer) Response.__init__(self, sampleset) self.timing = self.sampleset.info["timing"]
def __init__(self, dwave_answer): sampleset = SampleSet.from_serializable(dwave_answer) Response.__init__(self, sampleset)
def __init__(self, dimod_answer): solution = SampleSet.from_serializable(dimod_answer) Response.__init__(self, solution)