From f88c53c765b4564fd0de2240d5d892ef22609974 Mon Sep 17 00:00:00 2001 From: alsmith151 Date: Wed, 24 Jul 2024 11:15:48 +0100 Subject: [PATCH] Refactor define_memory_requested and define_time_requested functions --- seqnado/helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seqnado/helpers.py b/seqnado/helpers.py index 51ab023a..b8887226 100755 --- a/seqnado/helpers.py +++ b/seqnado/helpers.py @@ -62,8 +62,8 @@ def define_memory_requested(attempts: int = 1, initial_value: int = 1, scale: f """ Define the memory requested for the job. """ - memory = initial_value * 2 ** attempts - memory = memory * scale + memory = int(initial_value) * 2 ** int(attempts) + memory = memory * float(scale) return f"{memory}G" def define_time_requested(attempts: int = 1, initial_value: int = 1, scale: float = 1) -> str: @@ -72,8 +72,8 @@ def define_time_requested(attempts: int = 1, initial_value: int = 1, scale: floa Base time is 1 hour. """ - time = initial_value * 2 ** attempts - time = time * scale + time = int(initial_value) * 2 ** int(attempts) + time = time * float(scale) return f"{time}h"