Open eteq opened 2 years ago
viz.plugins['Spectral Extraction']
. Since spectral extraction is a core-functionality to specviz2d (unlike other plugins in which the app should be able to function if they are removed), we could still consider a helper-level property as a shortcut to this.
This is a follow-on from #1554, which I should have put as a comment there but I missed the boat and didn't get in a review before it was merged.
The core issue is twofold:
viz.app.get_tray_item_from_name('spectral-extraction')
is a very hard to find way of accessing this functionality. It's more internally consistent, but it makes the "helper" not very helpful.import_*
andexport_*
, while descriptive, aren't necessarily intuitive in how a user would actually use it.So my proposal for the fix would be twofold:
viz.extraction
- probably that could just be a simple:import_trace
it could beload_trace_into_viewer
, and instead ofexport_extract
it could beget_extraction_object
.It might even make sense for this to be a whole layer of syntactic sugar - i.e.
viz.extraction.load_trace_into_viewer
could be a thin wrapper callingviz.app.get_tray_item_from_name('spectral-extraction').import_trace
, although that feels a bit like overkill to me (i.e., better to just decide which name of the methods is best and switch to that)🐱