Skip to content

Commit

Permalink
Fixed a bug when calling update_values_from_data on Data opened in an…
Browse files Browse the repository at this point in the history
… image viewer
  • Loading branch information
astrofrog committed Aug 2, 2018
1 parent 173ee84 commit 6b4340d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion glue/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def coords(self, value):
if (hasattr(self, '_coords') and self._coords != value) or not hasattr(self, '_coords'):
self._coords = value
if len(self.components) > 0:
self._update_world_components(self.ndim)
self._set_up_coordinate_component_links(self.ndim)

@property
def ndim(self):
Expand Down
9 changes: 9 additions & 0 deletions glue/viewers/image/qt/tests/test_data_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,15 @@ def test_close(self):
self.viewer.toolbar.active_tool = self.viewer.toolbar.tools['mpl:zoom']
self.viewer.close(warn=False)

def test_update_data(self):

# Regression test for a bug that caused issues when data values
# were updated with Data.update_values_from_data

self.viewer.add_data(self.image1)
data = Data(m=[[1, 2],[3, 4]], n=[[3, 4], [4, 5]])
self.image1.update_values_from_data(data)


class TestSessions(object):

Expand Down

0 comments on commit 6b4340d

Please sign in to comment.