Fix flake8 errors
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
parent
0c592bb179
commit
c0a523328d
2 changed files with 13 additions and 13 deletions
|
@ -67,14 +67,14 @@ class MemoryUsageDataModelUtil(DataModelUtil):
|
||||||
:param precision: the number of digits to display after the period
|
:param precision: the number of digits to display after the period
|
||||||
"""
|
"""
|
||||||
suffixes = ['B', 'KB', 'MB', 'GB', 'TB']
|
suffixes = ['B', 'KB', 'MB', 'GB', 'TB']
|
||||||
suffixIndex = 0
|
suffix_index = 0
|
||||||
mem_size = float(size)
|
mem_size = float(size)
|
||||||
while mem_size > 1024.0 and suffixIndex < 4:
|
while mem_size > 1024.0 and suffix_index < 4:
|
||||||
# Increment the index of the suffix
|
# Increment the index of the suffix
|
||||||
suffixIndex += 1
|
suffix_index += 1
|
||||||
# Apply the division
|
# Apply the division
|
||||||
mem_size = mem_size / 1024.0
|
mem_size = mem_size / 1024.0
|
||||||
return f'{mem_size:.{precision}f} {suffixes[suffixIndex]}'
|
return f'{mem_size:.{precision}f} {suffixes[suffix_index]}'
|
||||||
|
|
||||||
def get_max_memory_usage_per_tid(self) -> DataFrame:
|
def get_max_memory_usage_per_tid(self) -> DataFrame:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -64,13 +64,13 @@ class Ros2DataModelUtil(DataModelUtil):
|
||||||
# remove spaces
|
# remove spaces
|
||||||
pretty = pretty.replace(' ', '')
|
pretty = pretty.replace(' ', '')
|
||||||
# allocator
|
# allocator
|
||||||
STD_ALLOCATOR = '_<std::allocator<void>>'
|
std_allocator = '_<std::allocator<void>>'
|
||||||
pretty = pretty.replace(STD_ALLOCATOR, '')
|
pretty = pretty.replace(std_allocator, '')
|
||||||
# default_delete
|
# default_delete
|
||||||
STD_DEFAULTDELETE = 'std::default_delete'
|
std_defaultdelete = 'std::default_delete'
|
||||||
if STD_DEFAULTDELETE in pretty:
|
if std_defaultdelete in pretty:
|
||||||
dd_start = pretty.find(STD_DEFAULTDELETE)
|
dd_start = pretty.find(std_defaultdelete)
|
||||||
template_param_open = dd_start + len(STD_DEFAULTDELETE)
|
template_param_open = dd_start + len(std_defaultdelete)
|
||||||
# find index of matching/closing GT sign
|
# find index of matching/closing GT sign
|
||||||
template_param_close = template_param_open
|
template_param_close = template_param_open
|
||||||
level = 0
|
level = 0
|
||||||
|
@ -86,10 +86,10 @@ class Ros2DataModelUtil(DataModelUtil):
|
||||||
level -= 1
|
level -= 1
|
||||||
pretty = pretty[:dd_start] + pretty[(template_param_close + 1):]
|
pretty = pretty[:dd_start] + pretty[(template_param_close + 1):]
|
||||||
# bind
|
# bind
|
||||||
STD_BIND = 'std::_Bind<'
|
std_bind = 'std::_Bind<'
|
||||||
if pretty.startswith(STD_BIND):
|
if pretty.startswith(std_bind):
|
||||||
# remove bind<>
|
# remove bind<>
|
||||||
pretty = pretty.replace(STD_BIND, '')
|
pretty = pretty.replace(std_bind, '')
|
||||||
pretty = pretty[:-1]
|
pretty = pretty[:-1]
|
||||||
# remove placeholder stuff
|
# remove placeholder stuff
|
||||||
placeholder_from = pretty.find('*')
|
placeholder_from = pretty.find('*')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue