Skip to content

Commit

Permalink
data im ind check before change
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclifford1 committed Aug 5, 2024
1 parent 0696633 commit 050f7e1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions IQM_Vis/UI/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ def redo_plots(self, calc_range=False):
change image in dataset
'''
def change_to_data_num(self, ind):
# change to an exact ind in the data list - be careful that the ind exists!!!
self.data_num = ind
self.change_data(0)
# change to an exact ind in the data list
# check the num is within the data limits
if ind < 0:
return
elif ind > self.max_data_ind:
return
else:
self.data_num = ind
self.change_data(0) # 0 means dont increment data_num

def change_data(self, ival, _redo_plots=True):
# reset any range/correlation data stored
Expand Down

0 comments on commit 050f7e1

Please sign in to comment.