Skip to content

Commit

Permalink
fix bug when updating the dataset, the map is also updated and cleane…
Browse files Browse the repository at this point in the history
…d useless print
  • Loading branch information
a3eille committed Aug 19, 2024
1 parent 31dd242 commit 439d9de
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions titantuner/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,10 @@ def plot_config(self, plot_orange_if_possible=True):
flag_to_plot = [-99, self.number_tests -1]
else:
flag_to_plot = np.sort(np.unique(self.data['test_code']))
print("code found when plotting", flag_to_plot)
for test in flag_to_plot:
Itest = np.where(self.data["test_code"]==test)[0]
if test != -99:
color = self.colors[np.mod(test, len(self.colors))]
print("color for test ",test, color, len(self.data['x'][Itest]))
#if (self.number_tests >0 and self.combine_test == "chain"):
#if test != self.number_tests:
if self.combine_test == "chain" or self.combine_test == "single":
Expand Down Expand Up @@ -382,13 +380,6 @@ def plot_config(self, plot_orange_if_possible=True):
)
Ichange = np.where( (self.data['unflagged_new'] | self.data['flagged_new']))
flagged_change_plot.data_source.data = {"x": self.data['x'][Ichange] , "y": self.data['y'][Ichange]}
print("number of tests , different codes ", self.number_tests, np.sort(np.unique(self.data['test_code'])))

else:
print("don't show orange circle")
print("old_flags is ", self.old_flags)
print("number of tests , different codes ", self.number_tests, np.sort(np.unique(self.data['test_code'])))


# flagged_least1_plot = self.p.scatter([], [],
# fill_alpha=0, size=13,
Expand Down Expand Up @@ -428,7 +419,6 @@ def color_picker_initialize(self):
def setup_initialize(self):
self.number_tests = 0
self.marker_color = "red"
print("colors reinitialized")
self.colors = ["red", "green", "cyan", "magenta", "blue", "gold", "brown"]
self.old_flags = None
self.dico_test_code2type = {0: None}
Expand Down Expand Up @@ -460,7 +450,9 @@ def reset_root(self):

def choose_dataset_handler(self, attr, old, new):
self.set_dataset(int(new), self.datetime)
self.set_ui(self.ui_name)
self.setup_initialize()
# self.set_ui(self.ui_name)


def choose_datetime_handler(self, attr, old, new):
new = int(new)
Expand Down

0 comments on commit 439d9de

Please sign in to comment.