oar-team / evalys

Infrastructure Performance Evaluation Toolkit
Other
8 stars 7 forks source link

Attribute error upon attempt to generate Gantt chart visualization #14

Open taiyihanle opened 1 year ago

taiyihanle commented 1 year ago

Hi there,

currently working on some preliminary testing for job scheduling research and followed through Batsim docs' tutorial of Gantt chart visualization with the Evalys Python library. As I run a small Python script made available in this page:

from evalys.jobset import JobSet
from evalys import visu
js = JobSet.from_csv("out_jobs.csv")
visu.gantt.plot_gantt(js, label_jobs=True)

..the calling of the plot_gantt method triggers the following attribute error.

Traceback (most recent call last):
  File "/home/taiyihanle/Desktop/pybatsim-run/expe-out/hist.py", line 4, in <module>
    visu.gantt.plot_gantt(js, label_jobs=True)
  File "/home/taiyihanle/.local/lib/python3.10/site-packages/evalys/visu/gantt.py", line 216, in plot_gantt
    layout = core.SimpleLayout(wtitle=title)
  File "/home/taiyihanle/.local/lib/python3.10/site-packages/evalys/visu/core.py", line 111, in __init__
    super().__init__(wtitle=wtitle)
  File "/home/taiyihanle/.local/lib/python3.10/site-packages/evalys/visu/core.py", line 56, in __init__
    self.wtitle = wtitle
  File "/home/taiyihanle/.local/lib/python3.10/site-packages/evalys/visu/core.py", line 102, in wtitle
    self.fig.canvas.set_window_title(wtitle)
AttributeError: 'FigureCanvasGTK4Agg' object has no attribute 'set_window_title'

I am using Evalys 4.0.6, Ubuntu 22.04.1 LTS with GNOME 42.5 and Python 3.10.6.

adfaure commented 1 year ago

Hello, I don't know if evalys is style maintained (@bleuse, @mickours ?). Have you considered using the R language as suggested here to build gantt charts ?

bleuse commented 1 year ago

Hi @taiyihanle,

evalys is no longer actively maintained, and unfortunately the set_window_title method has been removed from recent versions of matplotlib (see https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.6.0.html#classes-methods-and-attributes). I pushed a fix 66f22da (not yet released) that should work for all backends.

Also, I think the doc example you mention is not working per se. You should remove the label_jobs parameter as it is done by default. I'll update the doc.

Tell us if this works for you.