Constants#
All of the constants in the pymmcore
library are in the top level
pymmcore
namespace, making it a bit difficult to know what type
or enumeration they refer to.
All of these constants are reimplemened in the pymmcore_plus
library
as enum.IntEnum
and are available in the pymmcore_plus
namespace.
For example, the integer corresponding to the AfterLoadSequence
action type
could be accessed as pymmcore.AfterLoadSequence
or
pymmcore_plus.ActionType.AfterLoadSequence
.
In [1]: import pymmcore
In [2]: pymmcore.AfterLoadSequence
Out[2]: 4
In [3]: from pymmcore_plus import ActionType
In [4]: ActionType.AfterLoadSequence
Out[4]: <ActionType.AfterLoadSequence: 4>
In [5]: int(ActionType.AfterLoadSequence)
Out[5]: 4
Additionally, it becomes easier to see what constants are available for each type or enumeration.
In [6]: list(ActionType)
Out[6]:
[
<ActionType.NoAction: 0>,
<ActionType.BeforeGet: 1>,
<ActionType.AfterSet: 2>,
<ActionType.IsSequenceable: 3>,
<ActionType.AfterLoadSequence: 4>,
<ActionType.StartSequence: 5>,
<ActionType.StopSequence: 6>
]
Lastly, many of the methods that return integers in pymmcore.CMMCore
have been re-implemented in pymmcore_plus.CMMCorePlus
to return the
appropriate enumeration.
import pymmcore
core = pymmcore.CMMCore()
# ... load config and devices
core.getDeviceType("Camera") # 2
import pymmcore_plus
core = pymmcore_plus.CMMCorePlus()
# ... load config and devices
core.getDeviceType("Camera") # <DeviceType.CameraDevice: 2>
ActionType
#
AfterLoadSequence = pymmcore.AfterLoadSequence
class-attribute
#
AfterSet = pymmcore.AfterSet
class-attribute
#
BeforeGet = pymmcore.BeforeGet
class-attribute
#
IsSequenceable = pymmcore.IsSequenceable
class-attribute
#
NoAction = pymmcore.NoAction
class-attribute
#
StartSequence = pymmcore.StartSequence
class-attribute
#
StopSequence = pymmcore.StopSequence
class-attribute
#
CFGCommand
#
ConfigGroup = pymmcore.g_CFGCommand_ConfigGroup
class-attribute
#
ConfigPixelSize = pymmcore.g_CFGCommand_ConfigPixelSize
class-attribute
#
Configuration = pymmcore.g_CFGCommand_Configuration
class-attribute
#
Delay = pymmcore.g_CFGCommand_Delay
class-attribute
#
Device = pymmcore.g_CFGCommand_Device
class-attribute
#
Equipment = pymmcore.g_CFGCommand_Equipment
class-attribute
#
FieldDelimiters = pymmcore.g_FieldDelimiters
class-attribute
#
FocusDirection = pymmcore.g_CFGCommand_FocusDirection
class-attribute
#
ImageSynchro = pymmcore.g_CFGCommand_ImageSynchro
class-attribute
#
Label = pymmcore.g_CFGCommand_Label
class-attribute
#
ParentID = pymmcore.g_CFGCommand_ParentID
class-attribute
#
PixelSizeAffine = pymmcore.g_CFGCommand_PixelSizeAffine
class-attribute
#
PixelSize_um = pymmcore.g_CFGCommand_PixelSize_um
class-attribute
#
Property = pymmcore.g_CFGCommand_Property
class-attribute
#
CFGGroup
#
DeviceDetectionStatus
#
DeviceDetectionStatus from device discovery.
CanCommunicate = pymmcore.CanCommunicate
class-attribute
#
Communication verified, parameters have been set to valid values.
CanNotCommunicate = pymmcore.CanNotCommunicate
class-attribute
#
Communication attributes are valid, but the device does not respond.
Misconfigured = pymmcore.Misconfigured
class-attribute
#
Some information needed to communicate with the device is invalid.
Unimplemented = pymmcore.Unimplemented
class-attribute
#
There is as yet no mechanism to programmatically detect the device.