Skip to content

Commit

Permalink
internal renaming for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Jul 12, 2024
1 parent a1faaab commit e2de7c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class SpectralExtraction(PluginTemplateMixin, ApertureSubsetSelectMixin,
function_items = List().tag(sync=True)
function_selected = Unicode('Sum').tag(sync=True)
filename = Unicode().tag(sync=True)
extracted_available = Bool(False).tag(sync=True)
extraction_available = Bool(False).tag(sync=True)
overwrite_warn = Bool(False).tag(sync=True)

aperture_method_items = List().tag(sync=True)
Expand Down Expand Up @@ -193,7 +193,7 @@ def user_api(self):
@observe('dataset_items')
def _update_disabled_msg(self, msg={}):
for data in self.app.data_collection:
if len(data.data.shape) == 3:
if data.data.ndim == 3:
self.disabled_msg = ''
break
else:
Expand Down Expand Up @@ -227,9 +227,9 @@ def slice_indicator_viewers(self):

@observe('active_step', 'is_active')
def _active_step_changed(self, *args):
self.aperture._set_mark_visiblities(self.active_step in ('', 'ap', 'ext'))
self.aperture._set_mark_visiblities(self.active_step in ('', 'ap', 'extract'))
self.background._set_mark_visiblities(self.active_step == 'bg')
self.marks['bg_ext'].visible = self.active_step == 'bg'
self.marks['bg_extract'].visible = self.active_step == 'bg'

@property
def slice_plugin(self):
Expand Down Expand Up @@ -526,7 +526,7 @@ def extract(self, return_bg=False, add_data=True, **kwargs):

# stuff for exporting to file
self.extracted_spec = spec
self.extracted_available = True
self.extraction_available = True
fname_label = self.dataset_selected.replace("[", "_").replace("]", "")
self.filename = f"extracted_{selected_func}_{fname_label}.fits"

Expand Down Expand Up @@ -656,11 +656,11 @@ def marks(self):
return {}
# TODO: iterate over self.slice_indicator_viewers and handle adding/removing viewers
sv = self.slice_indicator_viewers[0]
marks = {'ext': PluginLine(sv, visible=self.is_active),
'bg_ext': PluginLine(sv,
marks = {'extract': PluginLine(sv, visible=self.is_active),
'bg_extract': PluginLine(sv,
line_style='dotted',
visible=self.is_active and self.active_step == 'bg')}
sv.figure.marks = sv.figure.marks + [marks['ext'], marks['bg_ext']]
sv.figure.marks = sv.figure.marks + [marks['extract'], marks['bg_extract']]
return marks

def _clear_marks(self):
Expand Down Expand Up @@ -695,19 +695,19 @@ def _live_update(self, event={}):
# should be separated so that the extraction can be wrapped in the
# @skip_if_no_updates_since_last_active decorator
try:
ext, bg_ext = self.extract(return_bg=True, add_data=False)
ext, bg_extract = self.extract(return_bg=True, add_data=False)
except (ValueError, Exception):
self._clear_marks()
return

self.marks['ext'].update_xy(self._preview_x_from_extracted(ext),
self.marks['extract'].update_xy(self._preview_x_from_extracted(ext),
self._preview_y_from_extracted(ext))
self.marks['ext'].visible = True
self.marks['extract'].visible = True

if bg_ext is None:
self.marks['bg_ext'].clear()
self.marks['bg_ext'].visible = False
if bg_extract is None:
self.marks['bg_extract'].clear()
self.marks['bg_extract'].visible = False
else:
self.marks['bg_ext'].update_xy(self._preview_x_from_extracted(bg_ext),
self._preview_y_from_extracted(bg_ext))
self.marks['bg_ext'].visible = self.active_step == 'bg'
self.marks['bg_extract'].update_xy(self._preview_x_from_extracted(bg_extract),
self._preview_y_from_extracted(bg_extract))
self.marks['bg_extract'].visible = self.active_step == 'bg'
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@

</div>

<div @mouseover="() => active_step='ext'">
<j-plugin-section-header :active="active_step==='ext'">Extract</j-plugin-section-header>
<div @mouseover="() => active_step='extract'">
<j-plugin-section-header :active="active_step==='extract'">Extract</j-plugin-section-header>

<v-row v-if="aperture_selected !== 'None' && !aperture_selected_validity.is_aperture">
<span class="v-messages v-messages__message text--secondary">
Expand Down

0 comments on commit e2de7c0

Please sign in to comment.