Skip to content

Commit

Permalink
Cleanup plotter
Browse files Browse the repository at this point in the history
  • Loading branch information
tpaviot committed Dec 17, 2024
1 parent 1b9115f commit e4c532a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions processscheduler/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from typing import Optional, Tuple, Union
import warnings

from processscheduler.task_constraint import TaskStartAt

try:
import numpy as np

Expand Down Expand Up @@ -94,14 +92,17 @@ def plot_function(
if show_plot:
plt.show()

def sort_by_task_start(tasks: dict[str, TaskSolution], solution: SchedulingSolution) -> dict[str, TaskSolution]:

def sort_by_task_start(
tasks: dict[str, TaskSolution], solution: SchedulingSolution
) -> dict[str, TaskSolution]:
return dict(
sorted(
tasks.items(),
key=lambda item: solution.tasks[item[0]].start,
reverse=True
tasks.items(), key=lambda item: solution.tasks[item[0]].start, reverse=True
)
)


#
# Gantt graphical rendering using plotly and matplotlib
#
Expand Down Expand Up @@ -221,7 +222,7 @@ def render_gantt_matplotlib(
show_indicators: Optional[bool] = True,
render_mode: Optional[str] = "Resource",
fig_filename: Optional[str] = None,
sort_by_start: bool = False
sort_by_start: bool = False,
) -> None:
"""generate a gantt diagram using matplotlib.
Inspired by
Expand Down

0 comments on commit e4c532a

Please sign in to comment.