Skip to content

Commit

Permalink
minor modifications on cli.py and run.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Changhao-Li committed Feb 13, 2025
1 parent 50928aa commit 1119a77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions metriq_gym/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

LIST_JOBS_HEADERS = ["ID", "Provider", "Device", "Type", "Dispatch time (UTC)"]


def list_jobs(jobs: list[MetriqGymJob], show_index: bool = True) -> None:
"""List jobs recorded in the job manager.
Expand All @@ -30,7 +29,6 @@ def list_jobs(jobs: list[MetriqGymJob], show_index: bool = True) -> None:
)
)


def parse_arguments() -> argparse.Namespace:
"""
Parse command-line arguments for the quantum volume benchmark.
Expand Down
4 changes: 2 additions & 2 deletions metriq_gym/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def dispatch_job(args: argparse.Namespace, job_manager: JobManager) -> None:


def poll_job(args: argparse.Namespace, job_manager: JobManager) -> None:
logger.info("Polling job...")
if not args.job_id:
jobs = job_manager.get_jobs()
if not jobs:
Expand All @@ -72,11 +71,12 @@ def poll_job(args: argparse.Namespace, job_manager: JobManager) -> None:
if 0 <= selected_index < len(jobs):
break
else:
print("Invalid index. Please enter a number between 0 and", len(jobs) - 1)
print(f"Invalid index. Please enter a number between 0 and {len(jobs) - 1}")
except ValueError:
print("Invalid input. Please enter a valid number.")
args.job_id = jobs[selected_index].id

logger.info("Polling job...")
metriq_job: MetriqGymJob = job_manager.get_job(args.job_id)
job_type: JobType = JobType(metriq_job.job_type)
job_data: BenchmarkData = setup_job_data_class(job_type)(**metriq_job.data)
Expand Down

0 comments on commit 1119a77

Please sign in to comment.