psi.experiment package
Submodules
psi.experiment.api module
psi.experiment.dock_layout_serializer module
Conversion between enaml’s Atom-based dock layout tree and plain Python data (dict/list/str/int/bool/None) that can be round-tripped through YAML or JSON instead of pickle.
enaml.widgets.dock_area.DockArea.save_layout() returns a small, closed
tree of enaml.layout.dock_layout.LayoutNode subclasses (ItemLayout,
TabLayout, SplitLayout/HSplitLayout/VSplitLayout,
DockBarLayout, AreaLayout, DockLayout). These are Atom objects,
not plain containers, so they can’t be handed directly to yaml.dump.
The node grammar is fixed and small, so a hand-written recursive
converter is straightforward – see enaml/qt/docking/layout_saver.py
for the authoritative list of node types and fields this mirrors.
HSplitLayout/VSplitLayout are reconstructed as plain
SplitLayout – they are only convenience constructors that pin the
orientation field, which is what every consumer actually inspects (no
code in enaml isinstance-checks for the H/V subclasses specifically).
- psi.experiment.dock_layout_serializer.dock_layout_node_from_dict(d)[source]
Reverse of dock_layout_node_to_dict.
- psi.experiment.dock_layout_serializer.dock_layout_node_to_dict(node)[source]
Recursively convert a LayoutNode tree into plain dict/list data.
psi.experiment.experiment_commands module
Command handlers for the experiment manifest.
These functions implement layout and preference persistence plus assorted
window-management commands declared in psi.experiment.manifest. They
are kept in a plain Python module so they can be imported and tested without
the Enaml import machinery.
psi.experiment.paradigm_description module
psi.experiment.plugin module
psi.experiment.util module
- psi.experiment.util.set_application_icon(icon=None)[source]
Make an icon the default for every window of the running application.
Setting the icon on the main window alone is not enough. A dialog built without a parent – such as the popup reporting how an experiment ended, or the error shown when an experiment fails to start – is a top-level window with a taskbar button of its own, and without an application-wide default it shows Qt’s generic window icon. On Windows the taskbar can then show that generic icon for the whole group of psi windows.
- Parameters:
icon (enaml Icon, optional) – The icon to use. Defaults to main_icon, psi’s own icon.
Notes
Call once the Qt application exists (in psi, as soon as the enaml UI plugin has started). Does nothing if there is no application yet. Windows that set their own icon keep it.
psi.experiment.workspace module
- class psi.experiment.workspace.ExperimentWorkspace(parent=None, **kwargs)[source]
Bases:
Workspace- dock_area
A value which allows objects of a given type or types.
Values will be tested using the PyObject_TypeCheck C API call. This call is equivalent to type(obj) in cls.mro(). It is less flexible but can be faster than Instance. Use Instance when allowing you need a tuple of types or (abstract) types relying on custom __isinstancecheck__ and Typed when the value type is explicit.
If optional is True, the value of a Typed may be set to None, otherwise None is not considered as a valid value.