Skip to content

Commit

Permalink
fixed pytest errors
Browse files Browse the repository at this point in the history
Signed-off-by: ISP akm <[email protected]>
  • Loading branch information
xygyo77 committed Nov 20, 2023
1 parent fe8264a commit 1e5d3ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/caret_analyze/plot/visualize_lib/bokeh/stacked_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ def create_figure(self) -> Figure:
frame_min = data['start time'][0]
frame_max = data['start time'][-1]
x_label = 'start time'
converter: ClockConverter | None = None
if self._xaxis_type == 'system_time':
apply_x_axis_offset(fig, frame_min, frame_max)
converter = None
elif self._xaxis_type == 'index':
x_label = 'index'
converter = None
else: # sim_time
assert len(target_objects.child) > 0
provider = target_objects.child[0]._provider
provider = target_objects.child[0]._provider # type: ignore
converter = provider.get_sim_time_converter(frame_min, frame_max)
data, y_labels = self._metrics.to_stacked_bar_data(converter)
frame_min = converter.convert(frame_min)
Expand All @@ -92,7 +93,7 @@ def create_figure(self) -> Figure:
color_selector.get_color()
colors = [color_selector.get_color(y_label) for y_label in y_labels]

source = StackedBarSource(data, y_labels, self._xaxis_type, x_label, converter)
source = StackedBarSource(data, y_labels, self._xaxis_type, x_label, converter=converter)
# reverse the order of y_labels to reverse the order in which bars are stacked.
stacked_bar = fig.vbar_stack(list(reversed(y_labels)), x='start time',
width='x_width_list', color=list(reversed(colors)),
Expand Down

0 comments on commit 1e5d3ef

Please sign in to comment.