Skip to content

Commit

Permalink
Switch a load of input/output defaults to tuple not list
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Oct 29, 2023
1 parent 894d8e9 commit 1771bd3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion parsl/tests/integration/test_parsl_load_default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


@python_app
def cpu_stress(inputs=[], outputs=[]):
def cpu_stress(inputs=(), outputs=()):
s = 0
for i in range(10**8):
s += i
Expand Down
2 changes: 1 addition & 1 deletion parsl/tests/manual_tests/test_fan_in_out_htex_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def inc(x):


@python_app
def add_inc(inputs=[]):
def add_inc(inputs=()):
import time
start = time.time()
sleep_duration = 30.0
Expand Down
10 changes: 5 additions & 5 deletions parsl/tests/test_aalst_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def slow_increment(x, dur=1):


@python_app
def join(inputs=[]):
def join(inputs=()):
return sum(inputs)


Expand All @@ -96,7 +96,7 @@ def sleep_square(x):


@python_app
def sum_results(x=[]):
def sum_results(x=()):
total = 0
for r in x:
total += r.result()
Expand All @@ -109,12 +109,12 @@ def add(x, y):


@python_app
def sum_list(x=[]):
def sum_list(x=()):
return sum(x)


@python_app
def sum_lists(x=[], y=[], z=[]):
def sum_lists(x=(), y=(), z=()):
total = 0
for i in range(len(x)):
total += x[i].result()
Expand All @@ -126,7 +126,7 @@ def sum_lists(x=[], y=[], z=[]):


@python_app
def sum_elements(x=[], y=[], z=[]):
def sum_elements(x=(), y=(), z=()):
total = 0
for i in range(len(x)):
total += x[i].result()
Expand Down
4 changes: 2 additions & 2 deletions parsl/tests/test_docs/test_from_slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@


@bash_app
def echo(message, outputs=[]):
def echo(message, outputs=()):
return 'echo {m} &> {o}'.format(m=message, o=outputs[0])


@python_app
def cat(inputs=[]):
def cat(inputs=()):
with open(inputs[0].filepath) as f:
return f.readlines()

Expand Down
2 changes: 1 addition & 1 deletion parsl/tests/test_docs/test_tutorial_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@bash_app
def sim_mol_dyn(i, dur, outputs=[], stdout=None, stderr=None):
def sim_mol_dyn(i, dur, outputs=(), stdout=None, stderr=None):
# The bash app function, requires that the bash script is assigned to the special variable
# cmd_line. Positional and Keyword args to the fn() are formatted into the cmd_line string
cmd_line = """echo "{0}" > {outputs[0]}
Expand Down
2 changes: 1 addition & 1 deletion parsl/tests/test_docs/test_workflow1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def generate(limit):


@bash_app
def save(message, outputs=[]):
def save(message, outputs=()):
return 'echo {m} &> {o}'.format(m=message, o=outputs[0])


Expand Down
2 changes: 1 addition & 1 deletion parsl/tests/test_error_handling/test_rand_fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def local_config():


@python_app
def sleep_fail(sleep_dur, sleep_rand_max, fail_prob, inputs=[]):
def sleep_fail(sleep_dur, sleep_rand_max, fail_prob, inputs=()):
import time
import random

Expand Down

0 comments on commit 1771bd3

Please sign in to comment.