oar-team/evalys

Alpha should not be fixed

Opened this issue · 1 comments

This issue happens with the version 2.6.1

This function takes alpha as a parameter.

The issue is that if I need a different "alpha" per job, it will override the alpha given by the
color_function call back.

For example, setting alpha equals one in this function will not work.

def color(job, palette):
  return [1, 0, 0, 1] # alpha is the last element  of the array

Thanks for reporting this.

This issue seems to still be there in the current version. This is due to the fact that the alpha is set at an upper level by the Gantt visualization method:
https://github.com/oar-team/evalys/blob/master/evalys/visu/gantt.py#L64

And then directly give to the matplotlib.patch.Rectangle function here:
https://github.com/oar-team/evalys/blob/master/evalys/visu/gantt.py#L127

To solve this, maybe we can set the alpha in the palette instead of at the matplotlib function.
What do you think @bleuse?