API
The Spyke Viewer API. It includes the global application configuration,
objects to access the main window and application and convenience functions.
-
spykeviewer.api.config
Global configuration options for Spyke Viewer. Single options can be set
by string like a dictionary (e.g.
spykeviewer.api.config['ask_plugin_path'] = False) or directly (e.g.
spykeviewer.api.config.ask_plugin_path = False).
They can be set in the Startup script, from the
console or even in plugins. However, some configuration options are only
effective when changed from the startup script.
The configurations options are:
- ask_plugin_path (bool)
- Ask about plugin paths if saving a file outside of the plugin paths.
Default: True
- save_plugin_before_starting (bool)
- Automatically save and reload a modified plugin before starting.
Default: True
- load_selection_on_start (bool)
- Load the selection that was automatically saved when shutting down
Spyke Viewer automatically on startup. This parameter is
only effective when set in the startup script. Default: True
- load_mode (int)
The initially selected loading mode. Possible values:
- 0
- Regular: Load all file contents on initial load.
- 1
- Lazy: Only load file structure. Data objects are loaded
automatically when requested and then discarded.
- 2
- Cached lazy: Only load file structure. Data objects are
loaded automatically when requested and then kept in
the object hierarchy so they only need to be loaded once.
This parameter is only effective when set in the startup script.
Default: 0
- autoselect_segments (bool)
- Select all visible segments by default. Default: False
- autoselect_channel_groups (bool)
- Select all visible channel groups by default. Default: False
- autoselect_channels (bool)
- Select all visible channels by default. Default: True
- autoselect_units (bool)
- Select all visible units by default. Default: False
- duplicate_channels (bool)
- Treat neo.core.RecordingChannel objects that are
referenced in multiple neo.core.RecordingChannelGroup
objects as separate objects for each reference. If False,
each channel will only be displayed (and returned by
spykeutils.plugin.data_provider.DataProvider) once,
for the first reference encountered. Default: False
- codecomplete_console_enter (bool)
- Use Enter key for code completion in console. This parameter is
only effective when set in the startup script. Default: True
- codecomplete_editor_enter (bool)
- Use Enter key for code completion in editor. This parameter is
only effective when set in the startup script. Default: True
- remote_script_parameters (list)
- Additional parameters for remote script. Use this if you have a custom
remote script that needs nonstandard parameters. The format is the same
as for subprocess.Popen, e.g.
['--param1', 'first value', '-p2', '2']. Default: []
-
spykeviewer.api.window
The main window of Spyke Viewer.
-
spykeviewer.api.app
The PyQt application object.
-
spykeviewer.api.start_plugin(name, current=None, selections=None)
Start first plugin with given name and return result of start()
method. Raises a SpykeException if not exactly one plugins with
this name exist.
Parameters: |
- name (str) – The name of the plugin. Should not include the
directory.
- current – A DataProvider to use as current selection. If
None, the regular current selection from the GUI is used.
- selections (list) – A list of DataProvider objects to use as
selections. If None, the regular selections from the GUI
are used.
|
-
spykeviewer.api.get_plugin(name)
Get plugin with the given name. Raises a SpykeException if
multiple plugins with this name exist. Returns None if no such
plugin exists.
Parameters: | name (str) – The name of the plugin. Should not include the
directory. |