From d0ed03e3974f258a2a9ad8cb3ffc1500d2ae9529 Mon Sep 17 00:00:00 2001 From: Paul Madden Date: Mon, 13 Jan 2025 21:49:33 +0000 Subject: [PATCH] Use * args/kwargs split instead of arg reordering --- parsl/data_provider/ftp.py | 2 +- parsl/data_provider/globus.py | 4 ++-- parsl/data_provider/http.py | 2 +- parsl/data_provider/zip.py | 2 +- parsl/tests/test_regression/test_69a.py | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/parsl/data_provider/ftp.py b/parsl/data_provider/ftp.py index 9a60a7d6a3..9d50380716 100644 --- a/parsl/data_provider/ftp.py +++ b/parsl/data_provider/ftp.py @@ -66,7 +66,7 @@ def wrapper(*args, **kwargs): return wrapper -def _ftp_stage_in(working_dir, outputs, parent_fut=None, _parsl_staging_inhibit=True): +def _ftp_stage_in(working_dir, *, parent_fut=None, outputs, _parsl_staging_inhibit=True): file = outputs[0] if working_dir: os.makedirs(working_dir, exist_ok=True) diff --git a/parsl/data_provider/globus.py b/parsl/data_provider/globus.py index dfe4bbebab..f60a5c2514 100644 --- a/parsl/data_provider/globus.py +++ b/parsl/data_provider/globus.py @@ -267,7 +267,7 @@ def _update_local_path(self, file, executor, dfk): # this cannot be a class method, but must be a function, because I want # to be able to use partial() on it - and partial() does not work on # class methods -def _globus_stage_in(provider, executor, outputs, parent_fut=None, _parsl_staging_inhibit=True): +def _globus_stage_in(provider, executor, *, parent_fut=None, outputs, _parsl_staging_inhibit=True): globus_ep = provider._get_globus_endpoint(executor) file = outputs[0] dst_path = os.path.join( @@ -280,7 +280,7 @@ def _globus_stage_in(provider, executor, outputs, parent_fut=None, _parsl_stagin file.path, dst_path) -def _globus_stage_out(provider, executor, app_fu, inputs, _parsl_staging_inhibit=True): +def _globus_stage_out(provider, executor, *, app_fu, inputs, _parsl_staging_inhibit=True): """ Although app_fu isn't directly used in the stage out code, it is needed as an input dependency to ensure this code diff --git a/parsl/data_provider/http.py b/parsl/data_provider/http.py index 30daac2f9c..6c3c7128bd 100644 --- a/parsl/data_provider/http.py +++ b/parsl/data_provider/http.py @@ -73,7 +73,7 @@ def wrapper(*args, **kwargs): return wrapper -def _http_stage_in(working_dir, outputs, parent_fut=None, _parsl_staging_inhibit=True): +def _http_stage_in(working_dir, *, parent_fut=None, outputs, _parsl_staging_inhibit=True): file = outputs[0] if working_dir: os.makedirs(working_dir, exist_ok=True) diff --git a/parsl/data_provider/zip.py b/parsl/data_provider/zip.py index e9c1737f6b..fbcd2b1c4f 100644 --- a/parsl/data_provider/zip.py +++ b/parsl/data_provider/zip.py @@ -96,7 +96,7 @@ def stage_in(self, dm, executor, file, parent_fut): return app_fut._outputs[0] -def _zip_stage_out(zip_file, inside_path, working_dir, inputs, parent_fut=None, _parsl_staging_inhibit=True): +def _zip_stage_out(zip_file, inside_path, working_dir, *, parent_fut=None, inputs, _parsl_staging_inhibit=True): file = inputs[0] os.makedirs(os.path.dirname(zip_file), exist_ok=True) diff --git a/parsl/tests/test_regression/test_69a.py b/parsl/tests/test_regression/test_69a.py index c78e7f98ec..e991df9bae 100644 --- a/parsl/tests/test_regression/test_69a.py +++ b/parsl/tests/test_regression/test_69a.py @@ -10,7 +10,7 @@ @bash_app -def echo_slow_message(msg, outputs, sleep=0, fu=None, stderr='std.err', stdout='std.out'): +def echo_slow_message(msg, *, sleep=0, fu=None, outputs, stderr='std.err', stdout='std.out'): cmd_line = 'sleep {sleep}; echo {0} > {outputs[0]}' return cmd_line @@ -28,7 +28,7 @@ def test_immediate_datafuture(): """ import time - fu = echo_slow_message("Hello world", outputs=["hello.1.txt"], sleep=1) + fu = echo_slow_message("Hello world", sleep=1, outputs=["hello.1.txt"]) d_fu = fu.outputs[0] time.sleep(0.1) @@ -50,8 +50,8 @@ def test_delayed_datafuture(): import time sleep_fu = sleep() - fu = echo_slow_message("Hello world", outputs=["hello.1.txt"], sleep=1, - fu=sleep_fu) + fu = echo_slow_message("Hello world", sleep=1, fu=sleep_fu, + outputs=["hello.1.txt"]) d_fu = fu.outputs[0] state_1 = d_fu.__str__() print("State_1 : ", state_1, "Fu:", fu.parent)