Skip to content

Commit

Permalink
fixed API error when interval != 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Valdes-Tresanco-MS committed Feb 22, 2022
1 parent 15a599d commit c4edb8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 2 additions & 4 deletions GMXMMPBSA/API.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def _get_frames(self):
INPUT['interval']))
INPUT['endframe'] = frames_list[-1]
time_step_list = list(range(self.starttime,
self.starttime + len(frames_list) * ts,
self.starttime + len(frames_list) * ts * INPUT['interval'],
ts * INPUT['interval']))
self.frames = dict(zip(frames_list, time_step_list))

Expand All @@ -419,11 +419,9 @@ def _get_frames(self):
INPUT['interval']))
INPUT['nmendframe'] = nmframes_list[-1] if nmframes_list else None



nm_start = (nmframes_list[0] - frames_list[0]) * INPUT['interval']
nmtime_step_list = list(range(self.starttime + nm_start,
self.starttime + nm_start + len(nmframes_list) * ts,
self.starttime + nm_start + len(nmframes_list) * ts * INPUT['nminterval'],
ts * INPUT['nminterval']))

self.nmframes = dict(zip(nmframes_list, nmtime_step_list))
Expand Down
15 changes: 8 additions & 7 deletions GMXMMPBSA/analyzer/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,13 +1105,14 @@ def makeTree(self, sys_index):
itemiter += 1

def _remove_empty_terms(self, data):
if self.data_options['remove_empty_terms']:
if isinstance(data, pd.DataFrame):
columns = data.columns
for col in columns:
if (data[col] > -0.01).all() and (data[col] < 0.01).all():
del data[col]
return data
if self.data_options['remove_empty_terms'] and isinstance(
data, pd.DataFrame
):
columns = data.columns
for col in columns:
if (data[col] > -0.01).all() and (data[col] < 0.01).all():
del data[col]
return data
return data

def _remove_empty_charts(self, data):
Expand Down

0 comments on commit c4edb8f

Please sign in to comment.