Skip to content

Commit

Permalink
Fix more Pylint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel committed Jan 12, 2025
1 parent b02a5aa commit 7fa7637
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
1 change: 0 additions & 1 deletion lglpy/timeline/drawable/drawable_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import bisect

from lglpy.timeline.drawable.primitive_rectangle import PrimitiveRectangle
from lglpy.timeline.drawable.world_drawable import WorldDrawableLine


class DrawableChannel:
Expand Down
7 changes: 2 additions & 5 deletions lglpy/timeline/drawable/timeline_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@
from lglpy.timeline.drawable.drawable import Drawable
from lglpy.timeline.drawable.style import Style
from lglpy.timeline.drawable.canvas_drawable import CanvasDrawableRect, \
CanvasDrawableRectFill, CanvasDrawableLabel, CanvasDrawableLine
CanvasDrawableRectFill, CanvasDrawableLine
from lglpy.timeline.drawable.timeline_viewport import TimelineViewport
from lglpy.timeline.drawable.entry_dialog import get_entry_dialog


class TimelineWidgetBase:
Expand Down Expand Up @@ -650,9 +649,7 @@ def get_coord_str(self, cx, cy):
change should be presented to the lglpy.timeline.
'''
# If in the ACTION BAR then no string
start = 0
end = self.ACTION_BAR_PIXELS
if start <= cy < self.ACTION_BAR_PIXELS:
if 0 <= cy < self.ACTION_BAR_PIXELS:
return ''

# Otherwise we are over the main timeline so provide timeline coords
Expand Down
10 changes: 5 additions & 5 deletions lglpy/timeline/gui/timeline/info_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from collections import defaultdict

from ...data.raw_trace import GPUStreamID, GPUStageID
from ...data.raw_trace import GPUStreamID
from ...drawable.text_pane_widget import TextPaneWidget


Expand Down Expand Up @@ -71,7 +71,7 @@ def get_frame_rate_report(self, start, end):
'''
# Determine which frames are entirely in the active range
out_frames = set()
in_frames = dict()
in_frames = {}

for event in self.timeline_widget.drawable_trace.each_object():
frame = event.user_data.frame
Expand Down Expand Up @@ -195,7 +195,7 @@ def ch_filt(x):
metrics.append(f' {label:{label_len}} {util:>5.1f}%')

util = self.get_utilization(start, end, channels)
label = f'Any stream:'
label = 'Any stream:'
metrics.append(f' {label:{label_len}} {util:>5.1f}%')
metrics.append('')
return metrics
Expand Down Expand Up @@ -314,7 +314,7 @@ def compute_active_event_stats_multi(self, active):
if top_n_limit > 1:
metrics.append(f'Top {top_n_limit} workload runtimes:')
else:
metrics.append(f'Workload runtime:')
metrics.append('Workload runtime:')

tags_by_cost = sorted(
total_tag_time, key=total_tag_time.get, reverse=True)
Expand Down Expand Up @@ -356,7 +356,7 @@ def get_active_event_stats(self):
if self.cached_active_event == active:
return self.cached_event_info

elif len(active) == 0:
if len(active) == 0:
info = None

else:
Expand Down
1 change: 0 additions & 1 deletion lglpy/timeline/gui/timeline/timeline_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
# pylint: disable=wrong-import-position
from gi.repository import Gtk

from lglpy.timeline.drawable.world_drawable import WorldDrawableLine
from lglpy.timeline.drawable.timeline_base import TimelineWidgetBase


Expand Down

0 comments on commit 7fa7637

Please sign in to comment.