schrodinger.application.job_monitor.job_monitor_models module¶
- class schrodinger.application.job_monitor.job_monitor_models.RequestedStatus(value)¶
Bases:
enum.EnumAn enumeration.
- NONE = 1¶
- STOP = 2¶
- CANCEL = 3¶
- class schrodinger.application.job_monitor.job_monitor_models.DownloadStatus(value)¶
Bases:
enum.EnumAn enumeration.
- NONE = 1¶
- READY_TO_DOWNLOAD = 2¶
- DOWNLOADING = 3¶
- DOWNLOADED = 4¶
- class schrodinger.application.job_monitor.job_monitor_models.JobModel(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParamModel class containing all job details that are relevant to the panel
- job_name: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- job_id: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- parent_job_id: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- sub_job_ids: List[str]¶
A Param to represent lists. Values of this param will have a
mutatedsignal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_classkeyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
- program: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- host: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- directory: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- job_started: float¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- project_name: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progress: float¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- files: List[str]¶
A Param to represent lists. Values of this param will have a
mutatedsignal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_classkeyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
- logfiles: List[str]¶
A Param to represent lists. Values of this param will have a
mutatedsignal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_classkeyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
- current_progress: float¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- last_updated: int¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- relative_id: int¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- job_index: int¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- launch_time: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- requested_status: schrodinger.application.job_monitor.job_monitor_models.RequestedStatus¶
- property is_top_level_job¶
Top level jobs are jobs which are started by user as opposed to being spawned by another job
- property is_active¶
Return whether the job is active.
- property is_null_job¶
- static fromJobObject(job)¶
Convert a Job object into a JobModel, with the necessary info taken from the job record
- Parameters
job (schrodinger.job.jobcontrol.Job) – The backend job object
- Returns
A Job model with the info needed by GUI
- Return type
- property is_downloaded¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, bool) bool¶
- block_signal_propagation()¶
- childEvent(self, QChildEvent)¶
- children(self) List[QObject]¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, QMetaMethod)¶
- current_progressChanged¶
- current_progressReplaced¶
- customEvent(self, QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: QObject = None) [signal]
- directoryChanged¶
- directoryReplaced¶
- disconnect(QMetaObject.Connection) bool¶
- disconnect(self) None
- disconnectNotify(self, QMetaMethod)¶
- download_statusChanged¶
- download_statusReplaced¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray]¶
- event(self, QEvent) bool¶
- eventFilter(self, QObject, QEvent) bool¶
- filesChanged¶
- filesReplaced¶
- findChild(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject¶
- findChild(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]¶
- findChildren(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, Tuple, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls, e.g.cls.name, notcls.coord.x.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- hostChanged¶
- hostReplaced¶
- inherits(self, str) bool¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, QMetaMethod) bool¶
- isWidgetType(self) bool¶
- isWindowType(self) bool¶
- job_idChanged¶
- job_idReplaced¶
- job_indexChanged¶
- job_indexReplaced¶
- job_nameChanged¶
- job_nameReplaced¶
- job_startedChanged¶
- job_startedReplaced¶
- killTimer(self, int)¶
- last_updatedChanged¶
- last_updatedReplaced¶
- launch_timeChanged¶
- launch_timeReplaced¶
- logfilesChanged¶
- logfilesReplaced¶
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject¶
- moveToThread(self, QThread)¶
- objectName(self) str¶
- objectNameChanged¶
objectNameChanged(self, str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()will return[foo, bar, atom, coord]where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject¶
- parent_job_idChanged¶
- parent_job_idReplaced¶
- programChanged¶
- programReplaced¶
- project_nameChanged¶
- project_nameReplaced¶
- property(self, str) Any¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, PYQT_SIGNAL) int¶
- relative_idChanged¶
- relative_idReplaced¶
- removeEventFilter(self, QObject)¶
- requested_statusChanged¶
- requested_statusReplaced¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject¶
- senderSignalIndex(self) int¶
- setObjectName(self, str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, QObject)¶
- setProperty(self, str, Any) bool¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParamto matchvalue.- Parameters
value – The value to set this
CompoundParamto. It should be the same type as thisCompoundParam.kwargs – For internal use only.
- signalsBlocked(self) bool¶
- skip_eq_check()¶
- startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- statusChanged¶
- statusReplaced¶
- sub_job_idsChanged¶
- sub_job_idsReplaced¶
- thread(self) QThread¶
- timerEvent(self, QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam. The returned dictionary is fully nested and contains noCompoundParaminstancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(str, disambiguation: str = None, n: int = - 1) str¶
- valueChanged¶
- schrodinger.application.job_monitor.job_monitor_models.get_null_job()¶
Get a null job model. The null job model’s job_id is None. The parent job of all top-level jobs is a null job. Null jobs should not be changed, and will raise an exception if they are. :return: A new null job object :rtype: JobModel
- class schrodinger.application.job_monitor.job_monitor_models.JobMonitorPanelModel(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam- top_level_jobs: List[schrodinger.application.job_monitor.job_monitor_models.JobModel]¶
A list param that contains
CompoundParaminstances. Signals will be emitted any time an item in the list changes or the contents of the list itself change. See_SignalContainerand_PLPSignalContainerfor information on specific signals.
- current_top_level_job: schrodinger.application.job_monitor.job_monitor_models.JobModel¶
Model class containing all job details that are relevant to the panel
- current_job: schrodinger.application.job_monitor.job_monitor_models.JobModel¶
Model class containing all job details that are relevant to the panel
- subjobs: List[schrodinger.application.job_monitor.job_monitor_models.JobModel]¶
A list param that contains
CompoundParaminstances. Signals will be emitted any time an item in the list changes or the contents of the list itself change. See_SignalContainerand_PLPSignalContainerfor information on specific signals.
- current_project_name: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- is_curr_project_scratch: bool¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- active_jobs_only: bool¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- current_project_jobs_only: bool¶
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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- status: 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
valueChangedsignal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- filtersInvalidated¶
- __init__(*args, **kwargs)¶
- updateJobs(job_models)¶
Updates the panel model with the given job models. If the JobModel is not already in _job_dict, add it.
- deleteJobs(job_ids)¶
Remove the deleted jobs from the model
- Parameters
job_ids (list[str]) – Delete jobs’ ids
- setCurrentTopLevelJob(job_model)¶
Set the top level job. Called when you double click on a job/row in the job table on the Jobs List pane. Used to populate to top level job bar.
- Parameters
job_model (JobModel) – The new top level job model
- setCurrentJob(job_model)¶
Set the current job being viewed in the Job Detail pane and add its subjobs to the subjobs PLP. Used to populate job info widget and subjobs table
- Parameters
job_model (JobModel) – The new current job model
- setTopLevelJobs(jobs)¶
Set the current top level jobs to be viewed and update the relative IDs of these jobs.
- Parameters
jobs (list[schrodinger.job.jobcontrol.Job]) – the list of top level jobs
- updateRelativeID(jobs_to_update)¶
Update the model with the relative IDs for the jobs being viewed in the current state.
- Parameters
jobs_to_update (list[schrodinger.job.jobcontrol.Job]) – the list of jobs to be updated with the relative id
- getJob(job_id)¶
Get job by job id
- Parameters
job_id (str) – Job id of reqested job
- Returns
The job model with the given job id
- Return type
JobModel or NoneType
- getParentJob(job_model)¶
Get the parent job of the given job model
- getAllTopLevelJobs()¶
Get a list of all top level jobs tracked by the panel. A job is considered top level if its parent id is None
- Returns
All top level jobs, i.e. all jobs
- Return type
list[JobModel]
- property on_jobs_list¶
The GUI is on the Jobs List Pane when current_job or current_top_level_job is a null job
- showJobsList()¶
The GUI is on the Jobs List Pane when current_job or current_top_level_job is a null job
- setJobDownloadStatus(job_id, status)¶
Set the ‘download_status’ to job_model of the given job.
- Parameters
job_id (str) – The job id.
status (member of'DownloadStatus enum.) – Download status.
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- active_jobs_onlyChanged¶
- active_jobs_onlyReplaced¶
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, bool) bool¶
- block_signal_propagation()¶
- childEvent(self, QChildEvent)¶
- children(self) List[QObject]¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, QMetaMethod)¶
- current_jobChanged¶
- current_jobReplaced¶
- current_project_jobs_onlyChanged¶
- current_project_jobs_onlyReplaced¶
- current_project_nameChanged¶
- current_project_nameReplaced¶
- current_top_level_jobChanged¶
- current_top_level_jobReplaced¶
- customEvent(self, QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: QObject = None) [signal]
- disconnect(QMetaObject.Connection) bool¶
- disconnect(self) None
- disconnectNotify(self, QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray]¶
- event(self, QEvent) bool¶
- eventFilter(self, QObject, QEvent) bool¶
- findChild(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject¶
- findChild(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]¶
- findChildren(self, Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, Tuple, QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls, e.g.cls.name, notcls.coord.x.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, str) bool¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, QMetaMethod) bool¶
- isWidgetType(self) bool¶
- isWindowType(self) bool¶
- is_curr_project_scratchChanged¶
- is_curr_project_scratchReplaced¶
- killTimer(self, int)¶
- metaObject(self) QMetaObject¶
- moveToThread(self, QThread)¶
- objectName(self) str¶
- objectNameChanged¶
objectNameChanged(self, str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()will return[foo, bar, atom, coord]where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject¶
- property(self, str) Any¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, PYQT_SIGNAL) int¶
- removeEventFilter(self, QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject¶
- senderSignalIndex(self) int¶
- setObjectName(self, str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, QObject)¶
- setProperty(self, str, Any) bool¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParamto matchvalue.- Parameters
value – The value to set this
CompoundParamto. It should be the same type as thisCompoundParam.kwargs – For internal use only.
- signalsBlocked(self) bool¶
- skip_eq_check()¶
- startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- statusChanged¶
- statusReplaced¶
- subjobsChanged¶
- subjobsReplaced¶
- thread(self) QThread¶
- timerEvent(self, QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam. The returned dictionary is fully nested and contains noCompoundParaminstancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- top_level_jobsChanged¶
- top_level_jobsReplaced¶
- tr(str, disambiguation: str = None, n: int = - 1) str¶
- valueChanged¶