Skip to content

Local plotting functions fail on simulation benchmarks #129

@jordandsullivan

Description

@jordandsullivan

Repro:

  1. Run simulation benchmarks locally: ucc-bench benchmarks/simulation_benchmarks.toml
  2. Run plotting function: python plotting/plot_latest_benchmark.py .local_results Jordans-MacBook-Pro.local

Result:

(ucc-bench) jordansullivan@Jordans-MacBook-Pro ucc-bench % `python plotting/plot_latest_benchmark.py .local_results Jordans-MacBook-Pro.local`

Traceback (most recent call last):
  File "/Users/jordansullivan/UnitaryFund/ucc-bench/plotting/plot_latest_benchmark.py", line 190, in <module>
    main()
  File "/Users/jordansullivan/UnitaryFund/ucc-bench/plotting/plot_latest_benchmark.py", line 163, in main
    plot_compilation(df, latest_date, out_path, args.pdf)
  File "/Users/jordansullivan/UnitaryFund/ucc-bench/plotting/plot_latest_benchmark.py", line 85, in plot_compilation
    generate_plot(df, plot_configs, latest_date, out_path, use_pdf)
  File "/Users/jordansullivan/UnitaryFund/ucc-bench/plotting/plot_latest_benchmark.py", line 30, in generate_plot
    circuit_names = sorted(df["benchmark_id"].unique())
                           ~~^^^^^^^^^^^^^^^^
  File "/Users/jordansullivan/UnitaryFund/ucc-bench/.venv/lib/python3.12/site-packages/pandas/core/frame.py", line 4107, in __getitem__
    indexer = self.columns.get_loc(key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jordansullivan/UnitaryFund/ucc-bench/.venv/lib/python3.12/site-packages/pandas/core/indexes/range.py", line 417, in get_loc
    raise KeyError(key)
KeyError: 'benchmark_id'

Workaround

The following code succeeds with the --plot simulation argument provided:
python plotting/plot_latest_benchmark.py --plot simulation .local_results Jordans-MacBook-Pro.local

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions