Skip to content

Commit 8123c4f

Browse files
committed
Fix python named argument bug in resource function
1 parent db8a613 commit 8123c4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

workflow/Snakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def make_resource_fn(rule_name, kind):
9999
- <kind>_scaler
100100
- <kind>_max
101101
"""
102-
def _fn(wildcards, inputs=[], threads=None, attempt=1):
102+
def _fn(wildcards, input=[], threads=None, attempt=1):
103103
# Config keys (mem or time)
104104
o_key = f"{kind}-offset"
105105
s_key = f"{kind}-scaler"
@@ -114,7 +114,8 @@ def make_resource_fn(rule_name, kind):
114114
capped = rule_cfg.get(m_key, resources_config["default"][m_key])
115115

116116
# Compute the total file size in MB
117-
total = sum(Path(f).stat().st_size for f in inputs) / 1000000.0
117+
total = sum(Path(f).stat().st_size for f in input) / 1000000.0
118+
# Alternative: total = input.size_mb
118119

119120
# Compute the resource value, capping it at the max.
120121
mul = factor ** (attempt - 1)

0 commit comments

Comments
 (0)