@@ -441,11 +441,13 @@ def flush():
441441 help = 'Connection and read timeouts (in seconds) for all API requests' )
442442@click .option ('--polling-timeout' , default = None , type = float ,
443443 help = 'Problem polling timeout in seconds (time-to-solution timeout)' )
444+ @click .option ('--label' , default = 'dwave ping' , type = str , help = 'Problem label' )
444445@click .option ('--json' , 'json_output' , default = False , is_flag = True ,
445446 help = 'JSON output' )
446447@standardized_output
447448def ping (* , config_file , profile , endpoint , region , client_type , solver_def ,
448- sampling_params , json_output , request_timeout , polling_timeout , output ):
449+ sampling_params , request_timeout , polling_timeout , label , json_output ,
450+ output ):
449451 """Ping the QPU by submitting a single-qubit problem."""
450452
451453 # parse params (TODO: move to click validator)
@@ -458,6 +460,9 @@ def ping(*, config_file, profile, endpoint, region, client_type, solver_def,
458460 raise CLIError ("sampling parameters required as JSON-encoded "
459461 "map of param names to values" , code = 99 )
460462
463+ if label :
464+ params .update (label = label )
465+
461466 config = dict (
462467 config_file = config_file , profile = profile ,
463468 endpoint = endpoint , region = region ,
@@ -555,6 +560,7 @@ def solvers(config_file, profile, endpoint, region, client_type, solver_def,
555560 help = 'Submit a valid random problem using all qubits' )
556561@click .option ('--num-reads' , '-n' , default = None , type = int ,
557562 help = 'Number of reads/samples' )
563+ @click .option ('--label' , default = 'dwave sample' , type = str , help = 'Problem label' )
558564@click .option ('--sampling-params' , '-m' , default = None ,
559565 help = 'Sampling parameters, JSON encoded' )
560566@click .option ('--verbose' , '-v' , default = False , is_flag = True ,
@@ -563,7 +569,7 @@ def solvers(config_file, profile, endpoint, region, client_type, solver_def,
563569 help = 'JSON output' )
564570@standardized_output
565571def sample (* , config_file , profile , endpoint , region , client_type , solver_def ,
566- biases , couplings , random_problem , num_reads , sampling_params ,
572+ biases , couplings , random_problem , num_reads , label , sampling_params ,
567573 verbose , json_output , output ):
568574 """Submit Ising-formulated problem and return samples."""
569575
@@ -583,6 +589,9 @@ def sample(*, config_file, profile, endpoint, region, client_type, solver_def,
583589 if num_reads is not None :
584590 params .update (num_reads = num_reads )
585591
592+ if label :
593+ params .update (label = label )
594+
586595 # TODO: add other params, like timeout?
587596 config = dict (
588597 config_file = config_file , profile = profile ,
0 commit comments