From 4193df590dcddc6fbaf86513d84b37d7c2eebbaf Mon Sep 17 00:00:00 2001 From: ODiogoSilva Date: Thu, 4 Oct 2018 09:41:08 +0100 Subject: [PATCH] Fixed inspection of tasks with duration of days --- changelog.md | 4 ++++ flowcraft/generator/inspect.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 0ce02190..2b659cec 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,10 @@ - Added removal of duplicate IDs from `reads_download` component input. - Added seed parameter to `downsample_fastq` component. +### Bug fixes + +- Fixed `inspect` issue when tasks took more than a day in duration. + ## 1.3.1 ### Features diff --git a/flowcraft/generator/inspect.py b/flowcraft/generator/inspect.py index af049f44..527e47df 100644 --- a/flowcraft/generator/inspect.py +++ b/flowcraft/generator/inspect.py @@ -338,7 +338,10 @@ def _hms(s): if s.endswith("ms"): return float(s.rstrip("ms")) / 1000 - fields = list(map(float, re.split("[hms]", s)[:-1])) + fields = list(map(float, re.split("[dhms]", s)[:-1])) + if len(fields) == 4: + return fields[0] * 24 * 3600 + fields[1] * 3600 + fields[2] * 60 +\ + fields[3] if len(fields) == 3: return fields[0] * 3600 + fields[1] * 60 + fields[2] elif len(fields) == 2: