naojsoft / qplan

Other
2 stars 4 forks source link

qplan fails to schedule when no "OPEN" in categories #19

Closed monodera closed 5 years ago

monodera commented 5 years ago

When there is no "OPEN" in the categories column in the schedule tab, qplan fails to make a schedule. The error message is the following.

IndexError
list index out of range  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/qplan-0.4.20170423071442-py3.5.egg/qplan/View.py", line 250, in error_wrap
    return method(*args, **kwargs)

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/qplan-0.4.20170423071442-py3.5.egg/qplan/plots/summary.py", line 196, in plot
    plt.legend((unsched_bar, sched_bar), ('Delay+Unscheduled', 'Scheduled'), prop=self.legendFont)

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/axes/_axes.py", line 414, in legend
    self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/legend.py", line 552, in __init__
    self._init_legend_box(handles, labels, markerfirst)

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/legend.py", line 811, in _init_legend_box
    fontsize, handlebox))

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/legend_handler.py", line 115, in legend_artist
    fontsize, handlebox.get_transform())

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/legend_handler.py", line 299, in create_artists
    self.update_prop(p, orig_handle, legend)

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/legend_handler.py", line 72, in update_prop
    self._update_prop(legend_handle, orig_handle)

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/legend_handler.py", line 65, in _update_prop
    self._update_prop_func(legend_handle, orig_handle)

  File "/Users/monodera/anaconda3/envs/qplan/lib/python3.5/site-packages/matplotlib/legend_handler.py", line 38, in update_from_first_child
    tgt.update_from(src.get_children()[0])
rdk1024 commented 5 years ago

I removed the restriction that "categories" in the Schedule sheet had to have "OPEN" in the list in order for the scheduler to include that night (commit 680df981a1d). I also added messages to the plots if the Schedule sheet has no nights available to schedule or if the Programs sheet has no programs to schedule (commit 980b5ec6487).