Skip to content

Commit

Permalink
Use * args/kwargs split instead of arg reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp-noaa committed Jan 13, 2025
1 parent 482ed57 commit d0ed03e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion parsl/data_provider/ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions parsl/data_provider/globus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion parsl/data_provider/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion parsl/data_provider/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions parsl/tests/test_regression/test_69a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d0ed03e

Please sign in to comment.