louwrentius / fio-plot

Create charts from FIO storage benchmark tool output
BSD 3-Clause "New" or "Revised" License
370 stars 87 forks source link

Supply plotting library an axis to squeeze. #81

Closed rout39574 closed 1 year ago

rout39574 commented 2 years ago

Heya. I found fio-plot to crash.

(fio-plot) [asr@az1-asrrhel8-lab01 fio-work]$ fio-plot -i /var/tmp/fio-work/benchfio/fio-work-dir/4k/    --source "yadda"  -T "title here" -L -t iops -r randread -o bar.png
Traceback (most recent call last):
  File "/var/tmp/fio-work/fio-plot/bin/fio-plot", line 33, in <module>
    sys.exit(load_entry_point('fio-plot==1.0.21', 'console_scripts', 'fio-plot')())
  File "/var/tmp/fio-work/fio-plot/lib64/python3.9/site-packages/fio_plot/__init__.py", line 45, in main
    routing_dict[graphtype]["function"](settings, data)
  File "/var/tmp/fio-work/fio-plot/lib64/python3.9/site-packages/fio_plot/fiolib/bar3d.py", line 140, in plot_3d
    res = fig.colorbar(sm, fraction=0.046, pad=0.19)
  File "/var/tmp/fio-work/fio-plot/lib64/python3.9/site-packages/matplotlib/figure.py", line 1256, in colorbar
    raise ValueError(
ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or add *mappable* to an Axes.

I followed the suggestion and added an ax argument.

louwrentius commented 2 years ago

Thanks, but I wonder which version of matplotlib you are running, can you please share? I'm afraid this change may break things for people on a different mpl version. Maybe if you can share the json data for me to reproduce the issue (louwrentius@gmail.com if you don't want to post it here) that might be interesting as I've not seen this error ever.

P.s. my response may be delayed

rout39574 commented 2 years ago

I'll find this and give you data tomorrow. It was a brand new install, so matplotlib drift is not ridiculous.

louwrentius commented 2 years ago

Ok I haven't looked at it but it may be worse: there was a new matplotlib version released that may break fio-flot. So this issue may be related to this and that means if I would merge this fix people on older versions have an issue.

rout39574 commented 2 years ago

Here are the packages in my venv

contourpy==1.0.5 cycler==0.11.0 fio-plot==1.0.21 fonttools==4.37.2 Jinja2==3.1.2 kiwisolver==1.4.4 MarkupSafe==2.1.1 matplotlib==3.6.0 numpy==1.23.3 packaging==21.3 Pillow==9.2.0 pyan3==1.2.0 pyparsing==3.0.9 python-dateutil==2.8.2 six==1.16.0

rout39574 commented 2 years ago

My read is that passing ax is the non-breaking technique that they recommended. Here's the 3.4 - 3.5 comment on how to avoid problems,

https://github.com/matplotlib/matplotlib/blob/v3.5.x/lib/matplotlib/figure.py

Seems to me that adding the ax= attribute isn't likely to break anyone's backlevel; that arg is present back to 2.2

louwrentius commented 1 year ago

Thanks and sorry for the extreme delay.