Skip to content

Commit

Permalink
Merge pull request #764 from markotoplak/fix-hyper-line-changefile
Browse files Browse the repository at this point in the history
[FIX] HyperSpectra: fix changing data with active line trace
  • Loading branch information
markotoplak authored Oct 23, 2024
2 parents 0cefca3 + 5007ed4 commit 5f929bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions orangecontrib/spectroscopy/tests/test_owhyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@ def test_select_click(self):
out = self.get_output("Selection")
np.testing.assert_almost_equal(out.metas, [[53.2443, 30.6984]], decimal=3)

def test_select_line_change_file(self):
self.send_signal("Data", self.whitelight)
wait_for_image(self.widget)
# select whole image row
self.widget.imageplot.select_line(QPointF(50, 30.6), QPointF(55, 30.6))
out = self.get_output("Selection")
self.assertEqual(len(out), 200)
self.send_signal("Data", self.iris)
wait_for_image(self.widget)
out = self.get_output("Selection")
self.assertIsNone(out, None)

def test_select_click_multiple_groups(self):
data = self.whitelight
self.send_signal("Data", data)
Expand Down
1 change: 1 addition & 0 deletions orangecontrib/spectroscopy/widgets/owhyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ def set_data(self, data):
else:
self.data = None
self.data_ids = {}
self.selection_distances = None

def refresh_img_selection(self):
if self.lsx is None or self.lsy is None:
Expand Down

0 comments on commit 5f929bf

Please sign in to comment.