c3sr/scope_plot

allow non-float fields to be x axis of scope_plot bar

Closed this issue · 1 comments

In the appended json file, try

scope_plot --debug bar --filter-name="Basic*<int>" hist_gpu.p9.json name bytes_per_second test.pdf

To produce the following error

[DEBU] Running: /Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/bin/scope_plot --debug bar --filter-name=Basic*<int> hist_gpu.p9.json name bytes_per_second test.pdf
[DEBU] subplot not in spec
[DEBU] inferring matplotlib backend from output path /Users/carl.pearson/repos/comm-scope-data/data/p9/test.pdf
[DEBU] Number of series: 1
[DEBU] series 0: Opening /Users/carl.pearson/repos/comm-scope-data/data/p9/hist_gpu.p9.json
[DEBU] series 0: filter regex is Basic*<int>
[DEBU] series 0: x field: name
[DEBU] series 0: y field: bytes_per_second
Traceback (most recent call last):
  File "/Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/bin/scope_plot", line 11, in <module>
    load_entry_point('scope-plot', 'console_scripts', 'scope_plot')()
  File "/Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/carl.pearson/.local/share/virtualenvs/comm-scope-data-6U__331-/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/cli.py", line 75, in bar
    backend.run(job)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/backend.py", line 21, in run
    return matplotlib_backend.run(job)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/backends/matplotlib.py", line 270, in run
    fig = generate(figure_spec)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/backends/matplotlib.py", line 255, in generate
    fig = generate_subplots(figure_spec)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/backends/matplotlib.py", line 242, in generate_subplots
    generate_axes(ax, ax_spec)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/backends/matplotlib.py", line 210, in generate_axes
    ax = generator_bar(ax, ax_spec)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/backends/matplotlib.py", line 81, in generator_bar
    series_df = b.keep_name_regex(regex).xy_dataframe(x_field, y_field)
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/benchmark.py", line 144, in xy_dataframe
    return self.custom_dataframe(*[x_field, y_field])
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/benchmark.py", line 137, in custom_dataframe
    filter(field_present, self.benchmarks)))
  File "/Users/carl.pearson/repos/scope_plot/scope_plot/benchmark.py", line 136, in <lambda>
    map(lambda b: float(b[field]),
ValueError: could not convert string to float: 'Histo_Gpu_Basic<int>/1/64/2097152/manual_time'
{
  "context": {
    "date": "2018-09-05 10:23:46",
    "executable": "./scope",
    "num_cpus": 160,
    "mhz_per_cpu": 3800,
    "cpu_scaling_enabled": false,
    "caches": [
      {
        "type": "Data",
        "level": 1,
        "size": 32000000,
        "num_sharing": 4
      },
      {
        "type": "Instruction",
        "level": 1,
        "size": 32000000,
        "num_sharing": 4
      },
      {
        "type": "Unified",
        "level": 2,
        "size": 512000000,
        "num_sharing": 8
      },
      {
        "type": "Unified",
        "level": 3,
        "size": 10240000000,
        "num_sharing": 8
      }
    ],
    "library_build_type": "release"
  },
  "benchmarks": [
    {
      "name": "Histo_Gpu_Basic<int>/1/64/2097152/manual_time",
      "iterations": 706,
      "real_time": 8.9660209699905885e+05,
      "cpu_time": 9.1299590651558060e+05,
      "time_unit": "ns",
      "bytes_per_second": 1.8711997279678024e+10,
      "num_bins": 6.4000000000000000e+01,
      "num_inputs": 2.0971520000000000e+06,
      "threads": 4.0960000000000000e+04
    },
    {
      "name": "Histo_Gpu_Basic<int>/8/64/2097152/manual_time",
      "iterations": 802,
      "real_time": 8.7345503746738611e+05,
      "cpu_time": 8.8965220947630878e+05,
      "time_unit": "ns",
      "bytes_per_second": 1.9207875941326225e+10,
      "num_bins": 6.4000000000000000e+01,
      "num_inputs": 2.0971520000000000e+06,
      "threads": 3.2768000000000000e+05
    }
  ]
}