Skip to content

Commit c9547d3

Browse files
committed
fix lint issues
1 parent 6057360 commit c9547d3

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

parsl/executors/taskvine/executor.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,13 @@ def __init__(self,
178178
# Path to directory that holds all tasks' data and results.
179179
self._function_data_dir = ""
180180

181-
# Mapping of function names to function details
182-
# Currently the values include function objects, path to serialized functions, path to serialized function contexts, and whether functions are serialized
183-
# Helpful to detect inconsistencies in serverless functions
184-
# Helpful to deduplicate the same function
181+
# Mapping of function names to function details.
182+
# Currently the values include function objects, path to serialized functions,
183+
# path to serialized function contexts, and whether functions are serialized.
184+
# Helpful to detect inconsistencies in serverless functions.
185+
# Helpful to deduplicate the same function.
185186
self._map_func_names_to_func_details = {}
186-
187+
187188
# Helper scripts to prepare package tarballs for Parsl apps
188189
self._package_analyze_script = shutil.which("poncho_package_analyze")
189190
self._package_create_script = shutil.which("poncho_package_create")
@@ -350,11 +351,14 @@ def submit(self, func, resource_specification, *args, **kwargs):
350351
exec_mode = 'regular'
351352

352353
if exec_mode == 'serverless':
353-
if func.__name__ not in self._map_func_names_to_func_details or 'func_obj' not in self._map_func_names_to_func_details[func.__name__]:
354+
if func.__name__ not in self._map_func_names_to_func_details or\
355+
'func_obj' not in self._map_func_names_to_func_details[func.__name__]:
354356
self._map_func_names_to_func_details[func.__name__] = {'func_obj': func}
355357
else:
356358
if id(func) != id(self._map_func_names_to_func_details[func.__name__]['func_obj']):
357-
logger.warning('Inconsistency in a serverless function call detected. A function name cannot point to two different function objects. Falling back to executing it as a regular task.')
359+
logger.warning('Inconsistency in a serverless function call detected.\
360+
A function name cannot point to two different function objects.\
361+
Falling back to executing it as a regular task.')
358362
exec_mode = 'regular'
359363

360364
# Detect resources and features of a submitted Parsl app
@@ -425,7 +429,8 @@ def submit(self, func, resource_specification, *args, **kwargs):
425429
# Get path to files that will contain the pickled function,
426430
# arguments, result, and map of input and output files
427431
if exec_mode == 'serverless':
428-
if func.__name__ not in self._map_func_names_to_func_details or 'function_file' not in self._map_func_names_to_func_details[func.__name__]:
432+
if func.__name__ not in self._map_func_names_to_func_details or\
433+
'function_file' not in self._map_func_names_to_func_details[func.__name__]:
429434
function_file = os.path.join(self._function_data_dir.name, func.__name__, 'function')
430435
self._map_func_names_to_func_details[func.__name__] = {'function_file': function_file, 'is_serialized': False}
431436
os.makedirs(os.path.join(self._function_data_dir.name, func.__name__))
@@ -449,7 +454,6 @@ def submit(self, func, resource_specification, *args, **kwargs):
449454
else:
450455
function_context_file = self._map_func_names_to_func_details[func.__name__]['function_context_file']
451456

452-
453457
logger.debug("Creating executor task {} with function at: {}, argument at: {}, \
454458
and result to be found at: {}".format(executor_task_id, function_file, argument_file, result_file))
455459

parsl/executors/taskvine/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from parsl.executors.taskvine import exec_parsl_function
1010
from parsl.executors.taskvine.utils import VineTaskToParsl, run_parsl_function
1111
from parsl.process_loggers import wrap_with_logs
12-
from parsl.utils import setproctitle
1312
from parsl.serialize import deserialize, serialize
13+
from parsl.utils import setproctitle
1414

1515
try:
1616
from ndcctools.taskvine import FunctionCall, Manager, Task, cvine

0 commit comments

Comments
 (0)