diff --git a/janis_core/ingestion/fromwdl.py b/janis_core/ingestion/fromwdl.py index 502de88a2..80c466497 100755 --- a/janis_core/ingestion/fromwdl.py +++ b/janis_core/ingestion/fromwdl.py @@ -177,13 +177,15 @@ def container_from_runtime(cls, runtime, inputs: List[WDL.Decl]): def parse_memory_requirement(self, value): s = self.translate_expr(value) - if isinstance(s, str): + if s is None: + return 1.074 + elif isinstance(s, str): if s.lower().endswith("g"): return float(s[:-1].strip()) if s.lower().endswith("gb"): return float(s[:-2].strip()) elif s.lower().endswith("gib"): - return float(s[:-3].strip()) * 0.931323 + return float(s[:-3].strip()) * 1.074 elif s.lower().endswith("mb"): return float(s[:-2].strip()) / 1000 elif s.lower().endswith("mib"): @@ -235,7 +237,7 @@ def from_loaded_task(self, obj: WDL.Task): inputs = obj.inputs cpus = self.translate_expr(rt.get("cpu")) - if cpus is not None and not isinstance(cpus, (int, float)): + if not isinstance(cpus, j.Selector) and cpus is not None and not isinstance(cpus, (int, float)): cpus = int(cpus) c = j.CommandToolBuilder( diff --git a/janis_core/tests/test_from_wdl.py b/janis_core/tests/test_from_wdl.py index c7af8d607..4340aa386 100644 --- a/janis_core/tests/test_from_wdl.py +++ b/janis_core/tests/test_from_wdl.py @@ -8,4 +8,4 @@ class TestFromWdl(unittest.TestCase): def test_missing_disk(self): result = self.parser.parse_disk_requirement(None) - self.assertEqual(0.931323, result) + self.assertEqual(2.14748, result) diff --git a/requirements/base.txt b/requirements/base.txt index fd20d2b7a..c9c84cf1a 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,4 +6,5 @@ tabulate path cwlformat >= 2020.5.19 cwl-utils >= 0.6 -graphviz \ No newline at end of file +graphviz +miniwdl \ No newline at end of file