Skip to content

Commit

Permalink
Rename state, update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
dhomeier committed Apr 17, 2024
1 parent 577d236 commit d81645d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions glue/viewers/image/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,18 +492,18 @@ class ImageLayerState(BaseImageLayerState, StretchStateMixin):
v_min = DDCProperty(docstring='The lower level shown')
v_max = DDCProperty(docstring='The upper level shown')
attribute_display_unit = DDSCProperty(docstring='The units to use to define the levels')
percentile = DDSCProperty(docstring='The percentile value used to '
'automatically calculate levels')
percentile = DDSCProperty(docstring='The percentile value used to automatically '
'calculate levels; "Custom" for manually set levels')
contrast = DDCProperty(1, docstring='The contrast of the layer')
bias = DDCProperty(0.5, docstring='A constant value that is added to the '
'layer before rendering')
cmap = DDCProperty(docstring='The colormap used to render the layer')
global_sync = DDCProperty(False, docstring='Whether the color and transparency '
'should be synced with the global '
'color and transparency for the data')
global_limits = DDCProperty(True, docstring='Calculate automatic levels on statistics '
'over the entire data cube or only the '
'current layer (slice)')
stretch_global = DDCProperty(True, docstring='Calculate automatic levels for rendering '
'stretch from the full data cube or only the '
'current layer (slice)')

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

Expand Down Expand Up @@ -545,7 +545,7 @@ def format_unit(unit):

self.add_callback('global_sync', self._update_syncing)
self.add_callback('layer', self._update_attribute)
self.add_callback('global_limits', self._set_global_limits, priority=0)
self.add_callback('stretch_global', self._set_global_stretch, priority=0)

self._update_syncing()

Expand Down Expand Up @@ -585,8 +585,8 @@ def _update_syncing(self, *args):
def _get_image(self, view=None):
return self.layer[self.attribute, view]

def _set_global_limits(self, global_limits=True):
if global_limits:
def _set_global_stretch(self, stretch_global=True):
if stretch_global:
self.viewer_state.remove_callback('slices', self._update_slice_subset)
self.attribute_lim_helper.set_slice(None)

Check warning on line 591 in glue/viewers/image/state.py

View check run for this annotation

Codecov / codecov/patch

glue/viewers/image/state.py#L589-L591

Added lines #L589 - L591 were not covered by tests
else:
Expand Down

0 comments on commit d81645d

Please sign in to comment.