Skip to content

Commit bbdfbb3

Browse files
committed
fix python lint
1 parent 223386a commit bbdfbb3

File tree

1 file changed

+15
-9
lines changed
  • vtr_flow/scripts/python_libs/vtr

1 file changed

+15
-9
lines changed

vtr_flow/scripts/python_libs/vtr/util.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@
2222
from vtr import paths
2323

2424

25-
# The run directory name passed by set_global_run_dir is the run directory name to parse. If it is None,
26-
# the latest run directory will be parsed.
27-
global_run_dir_name = None
25+
class RunDir:
26+
"""
27+
A class for representing a run directory.
28+
"""
29+
# The run directory name passed by set_global_run_dir
30+
# is the run directory name to parse.
31+
# If it is None, the latest run directory will be parsed.
32+
g_run_dir_name = None
33+
34+
35+
2836

2937

3038
class RawDefaultHelpFormatter(
@@ -230,12 +238,11 @@ def run_system_command(
230238
# pylint: enable=too-many-arguments, too-many-instance-attributes, too-few-public-methods, too-many-locals
231239

232240

233-
def set_global_run_dir(run_dir_name):
241+
def set_global_run_dir(current_run_dir_name):
234242
"""
235243
Set the global run directory name.
236244
"""
237-
global global_run_dir_name
238-
global_run_dir_name = run_dir_name
245+
RunDir.g_run_dir_name = current_run_dir_name
239246

240247

241248
def check_cmd(command):
@@ -576,9 +583,8 @@ def get_latest_run_dir_name(base_dir):
576583
"""
577584
Returns the highest run number of all run directories with in base_dir
578585
"""
579-
global global_run_dir_name
580-
if global_run_dir_name is not None:
581-
return global_run_dir_name
586+
if RunDir.g_run_dir_name is not None:
587+
return RunDir.g_run_dir_name
582588
else:
583589
run_number = 1
584590
run_dir = Path(base_dir) / run_dir_name(run_number)

0 commit comments

Comments
 (0)