MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / encode_problem_as_ref

Function encode_problem_as_ref

dwave/cloud/coders.py:349–367  ·  view source on GitHub ↗

Encode the problem given via reference for submission in the `ref` data format. Args: problem (str): A reference to an uploaded problem (problem ID). Returns: Encoded submission dictionary.

(problem)

Source from the content-addressed store, hash-verified

347
348
349def encode_problem_as_ref(problem):
350 """Encode the problem given via reference for submission in the `ref` data
351 format.
352
353 Args:
354 problem (str):
355 A reference to an uploaded problem (problem ID).
356
357 Returns:
358 Encoded submission dictionary.
359 """
360
361 if not isinstance(problem, str):
362 raise TypeError("unsupported problem reference type")
363
364 return {
365 'format': 'ref',
366 'data': problem
367 }
368
369
370def encode_problem_as_bq(problem):

Callers 5

test_ref_encoderMethod · 0.90
problem_dataMethod · 0.90
setUpClassMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_ref_encoderMethod · 0.72
setUpClassMethod · 0.72