Skip to content

Commit

Permalink
Update pylintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Tsimfer authored and Sergey Tsimfer committed May 16, 2024
1 parent 0d6b697 commit f169c29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions nbtools/nbstat/resource_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from .resource import Resource
from .resource_table import ResourceTable
from .utils import format_memory, pid_to_name, pid_to_ngid, true_len, true_rjust, true_center, FiniteList
from .utils import format_memory, pid_to_name, pid_to_ngid, FiniteList
from ..run_notebook import get_run_notebook_name


Expand Down Expand Up @@ -575,16 +575,17 @@ def get_view(self, name='nbstat', formatter=None, index_condition=None, force_st
lines = self.add_help(lines, terminal=terminal,
underline=underline_help, bold=bold_help)

# Select visible #TODO: fix indexing
h_start = int(add_header) + int(separate_header)
h_end = 2*int(add_footnote) + int(separate_footnote) + 2*int(add_help)
h_size = terminal.height - h_start - h_end - 5

self._h_position = max(0, min(self._h_position + h_change, len(lines) - h_start - h_end - h_size - 1))
h_slice_start = h_start + self._h_position
h_slice_end = h_slice_start + h_size
if len(lines) > terminal.height:
lines = lines[:h_start] + lines[h_slice_start : h_slice_end] + lines[-h_end:]
# Select visible
if 'watch' in name:
h_start = int(add_header) + int(separate_header)
h_end = 2*int(add_footnote) + int(separate_footnote) + 2*int(add_help)
h_size = terminal.height - h_start - h_end - 5

self._h_position = max(0, min(self._h_position + h_change, len(lines) - h_start - h_end - h_size))
h_slice_start = h_start + self._h_position
h_slice_end = h_slice_start + h_size
if len(lines) > terminal.height:
lines = lines[:h_start] + lines[h_slice_start : h_slice_end] + lines[-h_end:]

# Placeholder for empty table
if not table:
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ argument-rgx=(.*[a-z][a-z0-9_]{1,30}|[a-z_])$ # snake_case + single letters

[MESSAGE CONTROL]
disable=import-error, relative-beyond-top-level, attribute-defined-outside-init, unnecessary-lambda-assignment,
consider-iterating-dictionary
consider-iterating-dictionary, possibly-used-before-assignment

[TYPECHECK]
ignored-modules=numpy, numba
Expand Down

0 comments on commit f169c29

Please sign in to comment.