Skip to content

Commit

Permalink
Added a test back
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis authored and Nabil Freij committed Apr 1, 2022
1 parent 2360cd6 commit bcee99a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ glue/qt/glue_qt_resources.py
.tox
.vscode
.history

.qt_for_python/
2 changes: 1 addition & 1 deletion glue/viewers/common/qt/data_slice_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, label='', world=None, lo=0, hi=10,
parent=None, world_unit=None,
world_warning=False):

super(SliceWidget, self).__init__(parent=parent)
super(SliceWidget, self).__init__(parent)

self.state = SliceState()
self.state.label = label
Expand Down
3 changes: 2 additions & 1 deletion glue/viewers/image/qt/slice_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class MultiSliceWidgetHelper(object):

def __init__(self, viewer_state=None, layout=None, *args, **kwargs):
def __init__(self, *args, viewer_state=None, layout=None, **kwargs):

self.viewer_state = viewer_state

Expand Down Expand Up @@ -60,6 +60,7 @@ def sync_state_from_sliders(self, *args):

@avoid_circular
def sync_sliders_from_state(self, *args):

if self.data is None or self.viewer_state.x_att is None or self.viewer_state.y_att is None:
return

Expand Down
7 changes: 7 additions & 0 deletions glue/viewers/profile/tests/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def test_basic(self):
assert_allclose(x, [0, 1, 2])
assert_allclose(y, [3.5, 11.5, 19.5])

def test_basic_world(self):
self.viewer_state.x_att = self.data.world_component_ids[0]
x, y = self.layer_state.profile
assert_allclose(x, [0, 1, 2])
assert_allclose(y, [3.5, 11.5, 19.5])


def test_x_att(self):

self.viewer_state.x_att = self.data.pixel_component_ids[0]
Expand Down

0 comments on commit bcee99a

Please sign in to comment.