schrodinger.models.presets module¶
- class schrodinger.models.presets.Direction(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.Enum
- UP = -1¶
- DOWN = 1¶
- class schrodinger.models.presets.PanelPreset(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- serialized_panel: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- serialized_panelChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- serialized_panelReplaced¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- class schrodinger.models.presets.PresetManager(panel_name, model_class=None)¶
Bases:
object
- __init__(panel_name, model_class=None)¶
- model_class = None¶
- defineInputParams()¶
- defineIgnoredParams()¶
- savePreset(name: str, model: schrodinger.models.parameters.CompoundParam)¶
- savePresetToFile(fname: str, model: schrodinger.models.parameters.CompoundParam)¶
- exportPresets(export_fname: str)¶
Exports all presets to an option file at export_fname.
- importPresets(import_fname: str, model: schrodinger.models.parameters.CompoundParam)¶
Imports presets from an option file at import_fname. :raises JSONDecodeError: the opts file is not valid JSON or correct class data
- loadPreset(name: str, model: schrodinger.models.parameters.CompoundParam)¶
- loadPresetFromFile(fname: str, model: schrodinger.models.parameters.CompoundParam)¶
- deletePreset(name)¶
- setDefaultPreset(name)¶
- loadDefaultPreset(model)¶
- getAvailablePresets()¶
- getDefaultPreset()¶
- clearDefaultPreset()¶
- movePreset(name, direction)¶
- class schrodinger.models.presets.TaskPanelPresetManager(panel_name, model_class, panel_tasks)¶
Bases:
schrodinger.models.presets.PresetManager
A subclass of PresetManager that ignores the name and job config for tasks. The tasks are specified with the
panel_tasks
constructor argument which expects a list of abstract params of tasks onmodel_class
.- __init__(panel_name, model_class, panel_tasks)¶
- defineIgnoredParams()¶