API reference

Submodules

hyperspyui._elements module

List of elements

Data processed from wikipedias periodic table template page (fall 2014)

hyperspyui.actionable module

Created on Mon Nov 17 11:35:52 2014

@author: Vidar Tonaas Fauske

class hyperspyui.actionable.Actionable

Bases: PyQt4.QtCore.QObject

Base class for simple action management utilities. Manages actions dict, and adds actions through add_action().

add_action(key, title, on_trig)
add_separator()

hyperspyui.bindinglist module

Created on Mon Oct 27 23:17:25 2014

@author: Vidar Tonaas Fauske

class hyperspyui.bindinglist.BindingList(target=None, *args, **kwargs)

Bases: list

A list that has been extended to sync other lists or collections to changes in its contents. By custom targets, it can also be used to trigger events on addition/removal. Only append and remove actions are required, as extend, insert and pop can be inferred (insert loses order however), but for reasons of speed, it is recommended to supply all if they are available. Supported targets for add_target are types ‘list’ and ‘QListWidget’.

add_custom(target, append, insert, extend, remove, pop)
add_target(target)
append(object)
extend(iterable)
insert(index, object)
pop(index=-1)
remove(value)
remove_target(target)
set_target(target)
hyperspyui.bindinglist.bin_(QTextStream) → QTextStream
hyperspyui.bindinglist.hex_(QTextStream) → QTextStream
hyperspyui.bindinglist.oct_(QTextStream) → QTextStream

hyperspyui.exceptions module

Created on Mon Dec 08 23:57:48 2014

@author: Vidar Tonaas Fauske

exception hyperspyui.exceptions.ProcessCanceled

Bases: Exception

hyperspyui.hooksignal module

Created on Sat Feb 28 17:52:42 2015

@author: Vidar Tonaas Fauske

class hyperspyui.hooksignal.HookedSignal(data, **kwds)

Bases: hyperspy.signal.BaseSignal

plot(*args, **kwargs)
hyperspyui.hooksignal.connect_plotted(callback, userdata=None)

Call to subscribe to Signal plot events. ‘callback’ is called on the event. The Signal being plotted is passed as the first argument, then follows the arguments passed to plot(). If userdata is not None is is passed as a keyword argument, otherwise, it is left out. Plotted event are called just after the plot call is executed.

hyperspyui.hooksignal.connect_plotting(callback)

Call to subscribe to Signal plot events. ‘callback’ is called on the event. The Signal being plotted is passed as the first argument, then follows the arguments passed to plot(). Plotting event are called just before the plot call is executed.

hyperspyui.hooksignal.dehook_signal()

Call this function to remove hooks from Signal

hyperspyui.hooksignal.disconnect_plotted(callback)

Disconnect callback from subscription.

hyperspyui.hooksignal.disconnect_plotting(callback)

Disconnect callback from subscription.

hyperspyui.hooksignal.hook_signal()

Call this function to enable hooks of Signal

hyperspyui.hooktraitsui module

Created on Sun Nov 23 17:10:41 2014

@author: Vidar Tonaas Fauske

class hyperspyui.hooktraitsui.HookedDialog(ui, parent, *args, **kwargs)

Bases: traitsui.qt4.ui_base._StickyDialog

closeEvent(e)
deleteLater()
hyperspyui.hooktraitsui.connect_closed(callback, userdata=None)

Call to subscribe to traitsui dialog closing events. ‘callback’ is called on the event, with the ‘userdata’ as it’s first parameter if it is not None; otherwise this parameter is not included in the parameter list. The only other parameter is the dialog reference. ‘Closed’ events are called just after the dialog is actually closed, and cannot be aborted. Is not fired if the dialog is deleted before it is closed. (See destroyed event)

hyperspyui.hooktraitsui.connect_closing(callback, userdata=None)

Call to subscribe to traitsui dialog closing events. ‘callback’ is called on the event, with the ‘userdata’ as it’s first parameter if it is not None; otherwise this parameter is not included in the parameter list. The only other parameter is the dialog reference. ‘Closing’ events are called before the dialog is actually closed, and might be aborted. Is not fired if the dialog is deleted before it is closed. (See destroyed event)

hyperspyui.hooktraitsui.connect_created(callback, userdata=None)

Call to subscribe to traitsui dialog created events. ‘callback’ is called on the event, with the ‘userdata’ as it’s first parameter if it is not None; otherwise this parameter is not included in the parameter list. The other parameters (listed in order) are the dialog reference, traitsui’s ‘ui’ parameter, and the parent of the dialog. ‘Created’ events are called just after the dialog is actually created.

hyperspyui.hooktraitsui.connect_creating(callback, userdata=None)

Call to subscribe to traitsui dialog creating events. ‘callback’ is called on the event, with the ‘userdata’ as it’s first parameter if it is not None; otherwise this parameter is not included in the parameter list. The other parameters (listed in order) are the dialog reference, traitsui’s ‘ui’ parameter, and the parent of the dialog. ‘Creating’ events are called just before the dialog is actually created.

hyperspyui.hooktraitsui.connect_destroyed(callback, userdata=None)

Call to subscribe to traitsui dialog destroyed events. ‘callback’ is called on the event, with the ‘userdata’ as it’s first parameter if it is not None; otherwise this parameter is not included in the parameter list. The only other parameter is the dialog reference.

hyperspyui.hooktraitsui.dehook_traitsui()

Call this function to remove hooks from traitsui

hyperspyui.hooktraitsui.disconnect_closed(callback)

Disconnect callback from subscription.

hyperspyui.hooktraitsui.disconnect_closing(callback)

Disconnect callback from subscription.

hyperspyui.hooktraitsui.disconnect_created(callback)

Disconnect callback from subscription.

hyperspyui.hooktraitsui.disconnect_creating(callback)

Disconnect callback from subscription.

hyperspyui.hooktraitsui.disconnect_destroyed(callback)

Disconnect callback from subscription.

hyperspyui.hooktraitsui.hook_traitsui()

Call this function to enable hooking of traitsui events

hyperspyui.info module

Created on Thu Nov 27 01:38:42 2014

@author: Vidar Tonaas Fauske

hyperspyui.launch module

hyperspyui.mainwindow module

Created on Fri Oct 24 16:46:35 2014

@author: Vidar Tonaas Fauske

class hyperspyui.mainwindow.MainWindow(parent=None)

Bases: hyperspyui.mainwindowhyperspy.MainWindowHyperspy

Main window of the application. Top layer in application stack. Is responsible for adding default actions, and filling the menus and toolbars. Also creates the default widgets. Any button-actions should also be accessible as a slot, such that other things can connect into it, and so that it is accessible from the console’s ‘ui’ variable.

close_all_signals()
close_signal(uisignals=None)
create_default_actions()
create_menu()
create_toolbars()
create_tools()
create_widgetbar()
handleSecondInstance(argv)

A second instance was launched and suppressed. Process the arguments that were passed to the new instance.

load_complete
new_editor()
on_settings_changed()
on_subwin_activated(mdi_figure)
parse_args(argv=None)

Parse command line arguments, either from sys.argv, or from parameter ‘argv’.

select_x_signals(x, titles=None, wrap_col=4)

Displays a blocking dialog prompting the user to select ‘x’ signals. Over each selection box, the title as defined by ‘titles’ is displayed.

set_signal_dtype(data_type, signal=None, clip=False)
set_signal_type(signal_type, signal=None)
Changes the signal type using a combination of hyperspy.Signal.:
  • set_signal_type()
  • set_signal_origin()
  • and by converting with as_signal1D() and as_signal2D()
show_plugin_manager()
signal_types = OrderedDict([('Signal', <class 'hyperspyui.hooksignal.HookedSignal'>), ('1D Signal', <class 'hyperspy._signals.signal1d.Signal1D'>), ('2D Signal', <class 'hyperspy._signals.signal2d.Signal2D'>), ('EELS', <class 'hyperspy._signals.eels.EELSSpectrum'>), ('EDS SEM', <class 'hyperspy._signals.eds_sem.EDSSEMSpectrum'>), ('EDS TEM', <class 'hyperspy._signals.eds_tem.EDSTEMSpectrum'>), ('Complex Signal 1D', <class 'hyperspy._signals.complex_signal1d.ComplexSignal1D'>), ('Complex Signal 2D', <class 'hyperspy._signals.complex_signal2d.ComplexSignal2D'>), ('Dielectric Function', <class 'hyperspy._signals.dielectric_function.DielectricFunction'>)])
hyperspyui.mainwindow.bin_(QTextStream) → QTextStream
hyperspyui.mainwindow.hex_(QTextStream) → QTextStream
hyperspyui.mainwindow.oct_(QTextStream) → QTextStream

hyperspyui.mainwindowbase module

Created on Mon Oct 27 21:17:42 2014

@author: Vidar Tonaas Fauske

class hyperspyui.mainwindowbase.MainWindowBase(parent=None)

Bases: PyQt4.QtGui.QMainWindow

Base layer in application stack. Should handle the connection to our custom matplotlib backend, and manage the Figures. As such, it does not know anything about hyperspy, and can readily be reused for other projects. Should also set up basic UI with utilities, and relevant functions for inhereting classes to override.

check_action_selections(mdi_figure=None)
closeEvent(event)
create_console()
create_default_actions()

Create default actions that can be used for e.g. toolbars and menus, or triggered manually.

create_menu()
create_toolbars()

Override to create toolbars and toolbar buttons on UI construction. It is called after create_default_action(), so add_toolbar_button() can be used to add previously defined acctions.

create_tools()

Override to create tools on UI construction.

create_ui()
create_widgetbar()

The widget bar itself is created and managed implicitly by Qt. Override this function to add widgets on UI construction.

cur_dir
edit_settings()

Shows a dialog for editing the application and plugins settings.

handleSecondInstance(argv)
init_plugins()
low_process_priority
on_console_executed(response)

Override when inherited to perform actions after executing, given the ‘response’ returned.

on_console_executing(source)

Override when inherited to perform actions before exectuing ‘source’.

on_destroy_figure(figure, userdata=None)

Callback for MPL backend.

on_new_figure(figure, userdata=None)

Callback for MPL backend.

on_settings_changed()

Callback for SettingsDialog, or anything else that updates settings and need to apply the change.

on_subwin_activated(mdi_figure)
plugins
reset_geometry()
select_tool(tool)
toolbar_button_size
hyperspyui.mainwindowbase.bin_(QTextStream) → QTextStream
hyperspyui.mainwindowbase.hex_(QTextStream) → QTextStream
hyperspyui.mainwindowbase.lowpriority()

Set the priority of the process to below-normal.

hyperspyui.mainwindowbase.myexcepthook(exctype, value, traceback)
hyperspyui.mainwindowbase.normalpriority()

Set the priority of the process to below-normal.

hyperspyui.mainwindowbase.oct_(QTextStream) → QTextStream
hyperspyui.mainwindowbase.tr(text)

hyperspyui.mainwindowhyperspy module

Created on Tue Nov 04 13:37:08 2014

@author: Vidar Tonaas Fauske

class hyperspyui.mainwindowhyperspy.MainWindowHyperspy(parent=None)

Bases: hyperspyui.mainwindowutillayer.MainWindowActionRecorder

Fifth layer in the application stack. Should integrate hyperspy basics, such as UI wrappings for hyperspy classes (Signal and Model), file I/O, etc.

add_model(signal=None, *args, **kwargs)

Add a default model for the given/selected signal. Returns the newly created ModelWrapper.

cancel_progressbar
create_menu()
create_statusbar()

Creates extra status bar controls, e.g. coordinate tracking.

create_widgetbar()
dragEnterEvent(event)
dropEvent(event)
edit_hspy_settings()
static get_accepted_extensions()
get_selected_component()

Returns the selected component

get_selected_model()

Returns the selected model

get_selected_model_wrapper()

Returns the selected model

get_selected_plot()

Returns the selected signal; a string specifying whether the active window is “navtigation” plot, “signal” plot or “other”; and finally the active window.

get_selected_signal()
get_selected_signals()
get_selected_wrapper(error_on_multiple=False)
get_selected_wrappers()
get_signal_filepath_suggestion(signal, default_ext=None)
load(filenames=None)

Load ‘filenames’, or if ‘filenames’ is None, open a dialog to let the user interactively browse for files. It then load these files using hyperspy.io.load and wraps them and adds them to self.signals.

load_stack(filenames=None, stack_axis=None)
make_component(comp_type)
on_console_executed(response)
on_console_executing(source)
on_progressbar_finished(pid)
on_progressbar_update(pid, value, txt=None)
on_progressbar_wanted(pid, maxval, label)
on_signal_plotted(signal, *args, **kwargs)
on_signal_plotting(signal, *args, **kwargs)
save(signals=None, filenames=None)
select_model(win, action)

Model selection callback for actions that are only valid for selected Models.

select_signal(win, action)

Signal selection callback for actions that are only valid for selected Signals.

set_mouse_coords_status(indices, values, units, intensity=None)

Display mouse coordinates both in indices and data space values.

‘units’ must be the same size as ‘values’

set_navigator_coords_status(coords)

Displays ‘coords’ as the navigator coordinates.

class hyperspyui.mainwindowhyperspy.TrackEventFilter

Bases: PyQt4.QtCore.QObject

Qt Event filter for tracking the mouse position in the application.

eventFilter(receiver, event)
track
hyperspyui.mainwindowhyperspy.bin_(QTextStream) → QTextStream
hyperspyui.mainwindowhyperspy.hex_(QTextStream) → QTextStream
hyperspyui.mainwindowhyperspy.oct_(QTextStream) → QTextStream

hyperspyui.mainwindowutillayer module

Created on Sat Feb 21 16:05:41 2015

@author: Vidar Tonaas Fauske

class hyperspyui.mainwindowutillayer.MainWindowActionRecorder(parent=None)

Bases: hyperspyui.mainwindowutillayer.MainWindowUtils

Adds recorder functionality.

on_console_executing(source)
record_action(key)
record_code(code)
class hyperspyui.mainwindowutillayer.MainWindowUtils(parent=None)

Bases: hyperspyui.mainwindowbase.MainWindowBase

Adds UI utility functions to the main window, including traitsui dialog capture.

add_action(key, label, callback, tip=None, icon=None, shortcut=None, selection_callback=None)

Create and add a QAction to self.actions[key]. ‘label’ is used as the short description of the action, and ‘tip’ as the long description. The tip is typically shown in the statusbar. The callback is called when the action is triggered(). The optional ‘icon’ should either be a QIcon, or a path to an icon file, and is used to depict the action on toolbar buttons and in menus.

If selection_callback is supplied, it is called whenever the currently selected signal/figure changes. This allows the callback to enable/disable the action to reflect whether the selected figure/signal is supported for the action.

add_menuitem(category, action, label=None)

Add the supplied ‘action’ as a menu entry. If the menu defined by ‘cateogry’ does not exist, it will be created in self.menus[category].

If the label argument is not supplied, category will be used.

add_tool(tool, selection_callback=None)
add_toolbar_button(category, action)

Add the supplied ‘action’ as a toolbar button. If the toolbar defined by ‘cateogry’ does not exist, it will be created in self.toolbars[category].

add_widget(widget, floating=None)

Add the passed ‘widget’ to the main window. If the widget is not a QDockWidget, it will be wrapped in one. The QDockWidget is returned. The widget is also added to the window menu self.windowmenu, so that it’s visibility can be toggled.

The parameter ‘floating’ specifies whether the widget should be made floating. If None, the value of the setting ‘default_widget_floating’ is used.

capture_traits_dialog(callback)
get_figure_filepath_suggestion(figure, deault_ext=None)

Get a suggestion for a file path for saving figure.

make_icon(icon)

Create an icon that coheres to the internal standard for icons.

icon: {string | QIcon}

If icon is a path, it loads the file. If the path does not correspond to a valid file, it is checked if it is a valid path relative to the ‘images’ folder of the package.

After loading, SVG files will be run through SmartColorSVGIconEngine to adapt suitable icons to the current palette. If a QIcon is passed directly, it is also sent through SmartColorSVGIconEngine.

on_traits_destroyed(dialog)
on_traits_dialog(dialog, ui, parent)
prompt_files(extension_filter=None, path=None, exists=True, title=None, def_filter=None)
remove_tool(tool)
remove_toolbar_button(category, action)
save_figure(figure=None)

Save the matplotlib figure. If a figure is not passed, it tries to save whichever is active (using activeSubWindow() of the MDI area).

set_status(msg)

Display ‘msg’ in window’s statusbar.

show_okcancel_dialog(title, widget, modal=True)

Show a dialog with the passed widget and OK and cancel buttons.

hyperspyui.mainwindowutillayer.bin_(QTextStream) → QTextStream
hyperspyui.mainwindowutillayer.hex_(QTextStream) → QTextStream
hyperspyui.mainwindowutillayer.oct_(QTextStream) → QTextStream

hyperspyui.mdi_mpl_backend module

Created on Fri Oct 31 14:22:53 2014

@author: Vidar Tonaas Fauske

hyperspyui.mdi_mpl_backend.FigureManager

alias of FigureManagerMdi

class hyperspyui.mdi_mpl_backend.FigureManagerMdi(canvas, num)

Bases: matplotlib.backend_bases.FigureManagerBase

Public attributes

canvas : The FigureCanvas instance num : The Figure number toolbar : The qt.QToolBar window : The FigureWindow

Our MPL figure manager class. Much of the code is copied from MPL Qt4 backend, but adapted for our needs.

destroy(*args)
full_screen_toggle()
get_window_title()
resize(width, height)

set the canvas size in pixels

set_window_title(title)
show()
class hyperspyui.mdi_mpl_backend.FigureWindow(*args, **kwargs)

Bases: PyQt4.QtGui.QMdiSubWindow

A basic MDI sub-window, but with a closing signal, and an activate QAction, which allows for switching between all FigureWindows (e.g. by a Windows-menu). An exclusive, static action group makes sure only one window can be active at the time. If you want to split the windows into different groups that can be treated separately, you will need to create your own QActionGroups.

activateAction()

Returns a QAction that will activate the window with setActiveSubWindow as long as it has an mdiArea set. If not, it will use activateWindow to try to make it the active window.

activeFigureActionGroup = <PyQt4.QtGui.QActionGroup object at 0x000001C7ECE063A8>
closeEvent(event)
closing
setWindowTitle(title)
hyperspyui.mdi_mpl_backend.connect_on_destroy(callback, userdata=None)

Call to subscribe to destroying MPL figure events. ‘callback’ is called on the event, with the figure as it’s first parameter, and ‘userdata’ as it’s second parameter if it is not None. If it’s None, only one parameter is passed.

hyperspyui.mdi_mpl_backend.connect_on_new_figure(callback, userdata=None)

Call to subscribe to new MPL figure events. ‘callback’ is called on the event, with the figure as it’s first parameter, and ‘userdata’ as it’s second parameter if it is not None. If it’s None, only one parameter is passed.

hyperspyui.mdi_mpl_backend.disconnect_on_destroy(callback)

Disconnect callback from subscription.

hyperspyui.mdi_mpl_backend.disconnect_on_new_figure(callback)

Disconnect callback from subscription.

hyperspyui.mdi_mpl_backend.new_figure_manager(num, *args, **kwargs)

Create a new figure manager instance. MPL backend function.

hyperspyui.mdi_mpl_backend.new_figure_manager_given_figure(num, figure)

Create a new figure manager instance for the given figure. MPL backend function.

hyperspyui.modelwrapper module

Created on Tue Nov 04 16:25:54 2014

@author: Vidar Tonaas Fauske

class hyperspyui.modelwrapper.ModelWrapper(model, signal_wrapper, name)

Bases: hyperspyui.actionable.Actionable

add_component(component)
added
component_added(component)
component_removed(component)
fit(*args, **kwargs)
fit_component(component)
multifit(*args, **kwargs)
plot()
record_code(code)
remove_component(component)
removed
set_lowloss(signal=None)
set_signal_range(*args, **kwargs)
smartfit(*args, **kwargs)
toggle_fine_structure()
update_components()

Updates internal compoenent list to match model’s list (called e.g. after console execute and in constructor)

update_plot()
hyperspyui.modelwrapper.tr(text)

hyperspyui.overrides module

Created on Fri Dec 19 03:43:51 2014

@author: Vidar Tonaas Fauske

hyperspyui.overrides.override_hyperspy()

hyperspyui.plugincreator module

Created on Sat Feb 21 12:04:06 2015

@author: Vidar Tonaas Fauske

hyperspyui.plugincreator.create_plugin_code(code, name, category=None, menu=False, toolbar=False, icon=None)

Create a plugin with an action that will execute ‘code’ when triggered. If ‘menu’ and/or ‘toolbar’ is True, the corresponding items will be added for the action.

hyperspyui.plugincreator.create_plugin_file(code, name, category=None, menu=False, toolbar=False, filename=None)

Create a plugin with an action that will execute ‘code’ when triggered. If ‘menu’ and/or ‘toolbar’ is True, the corresponding items will be added for the action.

hyperspyui.plugincreator.indent(lines, amount, ch=' ')
hyperspyui.plugincreator.suggest_plugin_filename(name)

hyperspyui.pluginmanager module

Created on Sat Dec 13 00:41:15 2014

@author: Vidar Tonaas Fauske

class hyperspyui.pluginmanager.PluginManager(main_window)

Bases: object

create_actions()
create_menu()
create_toolbars()
create_tools()
create_widgets()
disable_plugin(name)

Disable plugin functionality. Also unloads plugin.

discover()

Auto-discover all plugins defined in plugin directory.

enable_plugin(name, value=True)

Enable/disable plugin functionality. Also loads/unloads plugin. If enabling and the plugin is already loaded, this will reload the plugin.

enabled

Returns a read-only dictionary showing the enabled/disabled state of all plugins.

init_plugins()
load(plugin_type)
load_from_file(path)
reload(plugin)
unload(plugin)
warn(f_name, p_name, category=<class 'RuntimeWarning'>)
class hyperspyui.pluginmanager.ReadOnlyDict

Bases: dict

pop(*args, **kwargs)
update(*args, **kwargs)

hyperspyui.recorder module

Created on Sat Feb 21 12:03:33 2015

@author: Vidar Tonaas Fauske

class hyperspyui.recorder.Recorder

Bases: PyQt4.QtCore.QObject

add_action(action_key)
add_code(code)
record
static step_to_code(step)
to_code()
to_plugin(name, category=None, menu=False, toolbar=False, icon=None)

hyperspyui.settings module

Created on Sat Dec 27 14:21:00 2014

@author: Vidar Tonaas Fauske

class hyperspyui.settings.Settings(parent=None, group=None)

Bases: object

static clear_defaults()

Clear all settings in defaults group. Should only be run once during application start, as it will undo any defaults that have been set.

get_enum_hint(key)

Returns the possible enum hint values if set, otherwise None.

get_or_prompt(key, options, title='Prompt', descr='')

Gets the setting specified by key. If it is not set, prompts the user to select one option out of several. The prompt includes a checkbox to remember the answer (“Remember this setting”).

The option parameter should be a list of two-tuples, specifying an ordered list of option values, and labels.

read(d, group=None, settings=None)
static restore_from_defaults()

Clears all settings (except “defaults” group) and restores all settings from the defaults group.

restore_key_default(key)

Restore a given setting to its default value.

set_default(key, value)

Sets default value by writing into defaults group.

set_enum_hint(key, options)

Indicate possible values for a setting.

The options are not strictly enforced, but can be used to indicate valid values to the user. A typical usecase is to allow the use of a combobox in a dialog to pick a value.

write(d, group=None, settings=None)
hyperspyui.settings.bin_(QTextStream) → QTextStream
hyperspyui.settings.hex_(QTextStream) → QTextStream
hyperspyui.settings.oct_(QTextStream) → QTextStream

hyperspyui.signalwrapper module

Created on Fri Oct 24 18:27:15 2014

@author: Vidar Tonaas Fauske

class hyperspyui.signalwrapper.SignalWrapper(signal, mainwindow, name=None)

Bases: hyperspyui.actionable.Actionable

add_figure(fig)
add_model(model)
as_signal1D(axis=0)
as_signal2D(axis=(0, 1))
close()
closing
keep_on_close
make_model(*args, **kwargs)
model_added
model_removed
nav_closing()
plot(*args, **kwargs)
remove_figure(fig)
remove_model(model)
replot()
sig_closing()
switch_signal(new_signal)

Switch the signal wrapped by this wrapper. To complete the switch, the signal should also be replotted if previously plotted. For performance reasons this is left as the responsibility of the caller.

update()
update_figures()

hyperspyui.singleapplication module

Created on Thu Nov 27 03:01:19 2014

@author: Vidar Tonaas Fauske

class hyperspyui.singleapplication.SingleApplication(argv, key)

Bases: PyQt4.QtGui.QApplication

isRunning()
messageAvailable
class hyperspyui.singleapplication.SingleApplicationWithMessaging(argv, key)

Bases: hyperspyui.singleapplication.SingleApplication

handleMessage()
sendMessage(message)
hyperspyui.singleapplication.get_app(key)

hyperspyui.smartcolorsvgiconengine module

Created on Wed Jul 29 18:09:56 2015

@author: vidarton

class hyperspyui.smartcolorsvgiconengine.SmartColorSVGIconEngine(use_qt_disabled=False, other=None)

Bases: PyQt4.QtGui.QIconEngineV2

This class is basically a port to Python from the code for Qt’s QSvgIconEnginePlugin. On top of this has been added the ability to exchange colors in the icons. It’s also possible in the future to do more advanced XML pro-processing. Note: Some of the more esoteric uses of QIcon might not be fully tested for yet.

actualSize(size, mode, state)
addFile(fileName, size, mode, state)
addPixmap(pixmap, mode, state)
clone()
key()
paint(painter, rect, mode, state)
pixmap(size, mode, state)
read(ds_in)
serial_gen = 0
write(ds_out)
hyperspyui.smartcolorsvgiconengine.bin_(QTextStream) → QTextStream
hyperspyui.smartcolorsvgiconengine.hex_(QTextStream) → QTextStream
hyperspyui.smartcolorsvgiconengine.oct_(QTextStream) → QTextStream

hyperspyui.threaded module

Created on Mon Nov 17 14:16:41 2014

@author: Vidar Tonaas Fauske

class hyperspyui.threaded.ProgressThreaded(parent, run, finished=None, label=None, cancellable=False, title='Processing', modal=True, generator_N=None)

Bases: hyperspyui.threaded.Threaded

close()
display()
class hyperspyui.threaded.Threaded(parent, run, finished=None)

Bases: PyQt4.QtCore.QObject

Executes a user provided function in a new thread, and pops up a QProgressBar until it finishes. To have an updating progress bar, have the provided function be a generator, and yield completion rate in percent (int from 0 to 100).

add_to_pool(instance)
errorString(error)
pool = []
remove_from_pool(instance)
run()
class hyperspyui.threaded.Worker(run)

Bases: PyQt4.QtCore.QObject

error
finished
process()
progress
hyperspyui.threaded.bin_(QTextStream) → QTextStream
hyperspyui.threaded.hex_(QTextStream) → QTextStream
hyperspyui.threaded.oct_(QTextStream) → QTextStream
hyperspyui.threaded.tr(text)

hyperspyui.tools module

Created on Sun Dec 07 03:06:55 2014

@author: Vidar Tonaas Fauske

hyperspyui.uiprogressbar module

Created on Wed Nov 26 19:11:19 2014

@author: Vidar Tonaas Fauske

class hyperspyui.uiprogressbar.UIProgressBar(*args, **kwargs)

Bases: tqdm._tqdm.tqdm

Connector between hyperspy process with a progressbar, and the UI. See also the doc for wrap() for more details.

cancel(pid)

Slot for the UI to call if it wants to cancel the process. Thread safe.

close()
finish()

Used to tell the progress is finished. Called by hyperspy side.

static format_string(n, total, elapsed, rate=None)
uid = 1
update(n=1)

Updates the progress bar to a new value. Called by the hyperspy side. Not safe to call from UI.

classmethod write(s, file=<colorama.ansitowin32.StreamWrapper object at 0x000001C7ECC5AF98>, end='\n')

Print a message via tqdm_gui (just an alias for print)

hyperspyui.uiprogressbar.reset_progressbar()
hyperspyui.uiprogressbar.takeover_progressbar()

Replace hyperspy.external.progressbar.progressbar() with uiprogressbar.wrap(). The main_window will be connected to all the events whenever a progressbar is created.

hyperspyui.util module

Created on Mon Oct 27 18:47:05 2014

@author: Vidar Tonaas Fauske

class hyperspyui.util.AttributeDict(obj={})

Bases: dict

A dict subclass that exposes its items as attributes.

static delattr(ns, name)
classmethod from_mapping(ns, names=None)
classmethod from_object(obj, names=None)
classmethod from_sequence(seq, names=None)
static getattr(ns, name)
static hasattr(ns, name)
static setattr(ns, name, value)
class hyperspyui.util.Namespace(obj={})

Bases: hyperspyui.util.AttributeDict

A dict subclass that exposes its items as attributes.

Warning: Namespace instances do not have direct access to the dict methods.

class hyperspyui.util.SignalTypeFilter(signal_type, ui, space=None)

Bases: object

hyperspyui.util.create_add_component_actions(parent, callback, prefix='', postfix='')
hyperspyui.util.crosshair_cursor()
hyperspyui.util.debug_trace()

Set a tracepoint in the Python debugger that works with Qt

hyperspyui.util.dict_rlu(dictionary, value)

Reverse dictionary lookup.

hyperspyui.util.dummy_context_manager(*args, **kwargs)
hyperspyui.util.fig2image_plot(fig, signals)
hyperspyui.util.fig2sig(fig, signals)
hyperspyui.util.fig2win(fig, windows)
hyperspyui.util.load_cursor(filename, hotX=-1, hotY=-1)
hyperspyui.util.lstrip(string, prefix)
hyperspyui.util.tr(text)
hyperspyui.util.win2fig(window)
hyperspyui.util.win2sig(window, signals=None, plotting_signal=None)

Module contents

Created on Mon Nov 17 12:30:07 2014

@author: Vidar Tonaas Fauske