Skip to content

Commit

Permalink
more general conditional; remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed May 1, 2019
1 parent efa1f20 commit d2565c2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def start_pipeline(self, args=None, multi=False):
print("* " + "Pypiper hash".rjust(20) + ": " + str(gitvars['pypiper_hash']))
print("* " + "Pypiper branch".rjust(20) + ": " + str(gitvars['pypiper_branch']))
print("* " + "Pypiper date".rjust(20) + ": " + str(gitvars['pypiper_date']))
if "" != str(gitvars['pypiper_diff']):
if gitvars['pypiper_diff']:
print("* " + "Pypiper diff".rjust(20) + ": " + str(gitvars['pypiper_diff']))
except KeyError:
# It is ok if keys aren't set, it means pypiper isn't in a git repo.
Expand Down Expand Up @@ -1923,12 +1923,10 @@ def _memory_usage(self, pid='self', category="hwm", container=None):
# since this is relatively untested.
cmd = "docker stats " + container + " --format '{{.MemUsage}}' --no-stream"
mem_use_str = subprocess.check_output(cmd, shell=True).decode()
mem_use = mem_use_str.split("/")[0].split()


mem_num = re.findall('[\d\.]+', mem_use_str.split("/")[0])[0]
mem_scale = re.findall('[A-Za-z]+', mem_use_str.split("/")[0])[0]

#print(mem_use_str, mem_num, mem_scale)
mem_num = float(mem_num)
if mem_scale == "GiB":
return mem_num * 1e6
Expand Down

0 comments on commit d2565c2

Please sign in to comment.