Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diagnostics.py: fixed check for stuck for new formatting #139

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions bin/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,15 @@ def check_termination(path, trajectories, INFOS, f):
countmax = min(10, trajectories[path]['laststep'])
for line in range(len(f)):
if 'ntering timestep' in f[line].lower():
check_old = f[line + 2].split()
if "start" in f[line + 2].lower():
shift = 0
elif "start" in f[line + 3].lower():
shift = 1
check_old = f[line + 2 + shift].split()
if check_old[0] == "Start":
timesteps.append(f[line + 2].strip()[12:])
timesteps.append(f[line + 2 + shift].strip()[12:])
else:
timesteps.append(f[line + 2].strip())
timesteps.append(f[line + 2 + shift].strip())
count += 1
if count == countmax:
break
Expand All @@ -668,12 +672,16 @@ def check_termination(path, trajectories, INFOS, f):
total += tend - tstart
for line in range(len(f)):
if 'ntering timestep' in f[-line].lower():
check_old = f[-line + 2].split()
if "start" in f[line + 2].lower():
shift = 0
elif "start" in f[line + 3].lower():
shift = 1
check_old = f[-line + 2 + shift].split()
if check_old[0] == "Start":
tstart = datetime.datetime.strptime(f[-line + 2].strip()[12:], '%a %b %d %H:%M:%S %Y')
tstart = datetime.datetime.strptime(f[-line + 2 + shift].strip()[12:], '%a %b %d %H:%M:%S %Y')
break
else:
tstart = datetime.datetime.strptime(f[-line + 2].strip(), '%a %b %d %H:%M:%S %Y')
tstart = datetime.datetime.strptime(f[-line + 2 + shift].strip(), '%a %b %d %H:%M:%S %Y')
break
tend = datetime.datetime.now()
tdiff = tend - tstart
Expand Down
Loading