Skip to content

Commit

Permalink
Refactor define_memory_requested and define_time_requested functions …
Browse files Browse the repository at this point in the history
…to fix calculation bug
  • Loading branch information
alsmith151 committed Jul 24, 2024
1 parent f88c53c commit b757016
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions seqnado/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def define_memory_requested(attempts: int = 1, initial_value: int = 1, scale: f
"""
Define the memory requested for the job.
"""
memory = int(initial_value) * 2 ** int(attempts)
memory = int(initial_value) * 2 ** (int(attempts) - 1)
memory = memory * float(scale)
return f"{memory}G"

Expand All @@ -72,7 +72,7 @@ def define_time_requested(attempts: int = 1, initial_value: int = 1, scale: floa
Base time is 1 hour.
"""
time = int(initial_value) * 2 ** int(attempts)
time = int(initial_value) * 2 ** (int(attempts) - 1)
time = time * float(scale)
return f"{time}h"

Expand Down

0 comments on commit b757016

Please sign in to comment.