mxcubecore.queue_entry.base_queue_entry#

All queue entries inherits the baseclass BaseQueueEntry which in turn inherits QueueEntryContainer. This makes it possible to arrange and execute queue entries in a hierarchical manner.

Functions

center_before_collect(view, dm, queue, ...)

mount_sample(view, data_model, ...)

Classes

BaseQueueEntry([view, data_model, ...])

Base class for queue entry objects.

BasketQueueEntry([view, data_model])

DelayQueueEntry([view, data_model])

QueueEntryContainer()

A QueueEntryContainer has a list of queue entries, classes inheriting BaseQueueEntry, and a Queue object.

QueueEntryStatusType(SUCCESS, WARNING, ...)

SampleQueueEntry([view, data_model])

Defines the behaviour of sample queue entries.

TaskGroupQueueEntry([view, data_model])

Exceptions

QueueAbortedException(message, origin)

QueueExecutionException(message, origin)

QueueSkipEntryException(message, origin)

class mxcubecore.queue_entry.base_queue_entry.BaseQueueEntry(view=None, data_model=None, view_set_queue_entry=True)[source]#

Bases: QueueEntryContainer

Base class for queue entry objects. Defines the overall interface and behaviour for a queue entry.

enqueue(queue_entry)[source]#

Method inherited from QueueEntryContainer, a derived class should newer need to override this method.

execute()[source]#

Execute method, should be overriden my subclasses, defines the main body of the procedure to be performed when the entry is executed.

The default executer calls excute on all child entries after this method but before post_execute.

get_data_model()[source]#
Returns:

The data model of this queue entry.

Return type:

TaskNode

get_view()[source]#
Returns the view:

Return type:

ViewItem

is_enabled()[source]#
Returns:

True if this item is enabled.

Return type:

bool

is_failed()[source]#

Returns True if failed

post_execute()[source]#

Procedure to be done after execute, and execute of all children of this entry.

pre_execute()[source]#

Procedure to be done before execute.

set_data_model(data_model)[source]#

Sets the model node of this queue entry to <data_model>

Parameters:

data_model (TaskNode) – The data model node.

set_enabled(state)[source]#

Enables or disables this entry, controls if this item should be executed (enabled) or not (disabled)

Parameters:

state (bool) – Enabled if state is True otherwise disabled.

set_view(view, view_set_queue_entry=True)[source]#

Sets the view of this queue entry to <view>. Makes the corresponding bidirectional connection if view_set_queue_entry is set to True. Which is normally case, it can be useful with ‘uni-directional’ connection in some rare cases.

Parameters:
  • view (ViewItem) – The view to associate with this entry

  • view_set_queue_entry (bool) – Bi- or uni-directional connection to view.

stop()[source]#

Stops the execution of this entry, should free external resources, cancel all pending processes and so on.

class mxcubecore.queue_entry.base_queue_entry.BasketQueueEntry(view=None, data_model=None)[source]#

Bases: BaseQueueEntry

class mxcubecore.queue_entry.base_queue_entry.DelayQueueEntry(view=None, data_model=None)[source]#

Bases: BaseQueueEntry

execute()[source]#

Execute method, should be overriden my subclasses, defines the main body of the procedure to be performed when the entry is executed.

The default executer calls excute on all child entries after this method but before post_execute.

exception mxcubecore.queue_entry.base_queue_entry.QueueAbortedException(message, origin)[source]#

Bases: QueueExecutionException

class mxcubecore.queue_entry.base_queue_entry.QueueEntryContainer[source]#

Bases: object

A QueueEntryContainer has a list of queue entries, classes inheriting BaseQueueEntry, and a Queue object. The Queue object controls/handles the execution of the queue entries.

dequeue(queue_entry)[source]#

Dequeues the QueueEntry <queue_entry> and returns the dequeued entry.

Throws ValueError if the queue_entry is not in the queue.

Parameters:

queue_entry (QueueEntry) – The queue entry to dequeue/remove.

Returns:

The dequeued entry.

Return type:

QueueEntry

get_container()[source]#
Returns:

The parent QueueEntryContainer.

Return type:

QueueEntryContainer

get_queue_controller()[source]#
Returns:

The queue controller

set_container(queue_entry_container)[source]#

Sets the parent queue entry to <queue_entry_container>

Parameters:

queue_entry_container (QueueEntryContainer) –

set_queue_controller(queue_controller)[source]#

Sets the queue controller, the object that controls execution of this QueueEntryContainer.

Parameters:

queue_controller (QueueController) – The queue controller object.

swap(queue_entry_a, queue_entry_b)[source]#

Swaps places between the two queue entries <queue_entry_a> and <queue_entry_b>.

Throws a ValueError if one of the entries does not exist in the queue.

Parameters:
  • queue_entry (QueueEntry) – Queue entry to swap

  • queue_entry – Queue entry to swap

class mxcubecore.queue_entry.base_queue_entry.QueueEntryStatusType(SUCCESS, WARNING, FAILED, SKIPPED, RUNNING, NOT_EXECUTED)#

Bases: tuple

FAILED#

Alias for field number 2

NOT_EXECUTED#

Alias for field number 5

RUNNING#

Alias for field number 4

SKIPPED#

Alias for field number 3

SUCCESS#

Alias for field number 0

WARNING#

Alias for field number 1

exception mxcubecore.queue_entry.base_queue_entry.QueueExecutionException(message, origin)[source]#

Bases: Exception

exception mxcubecore.queue_entry.base_queue_entry.QueueSkipEntryException(message, origin)[source]#

Bases: QueueExecutionException

class mxcubecore.queue_entry.base_queue_entry.SampleQueueEntry(view=None, data_model=None)[source]#

Bases: BaseQueueEntry

Defines the behaviour of sample queue entries. Mounting, launching centring and so on.

execute()[source]#

Execute method, should be overriden my subclasses, defines the main body of the procedure to be performed when the entry is executed.

The default executer calls excute on all child entries after this method but before post_execute.

post_execute()[source]#

Procedure to be done after execute, and execute of all children of this entry.

pre_execute()[source]#

Procedure to be done before execute.

class mxcubecore.queue_entry.base_queue_entry.TaskGroupQueueEntry(view=None, data_model=None)[source]#

Bases: BaseQueueEntry

execute()[source]#

Execute method, should be overriden my subclasses, defines the main body of the procedure to be performed when the entry is executed.

The default executer calls excute on all child entries after this method but before post_execute.

post_execute()[source]#

Procedure to be done after execute, and execute of all children of this entry.

pre_execute()[source]#

Procedure to be done before execute.

stop()[source]#

Stops the execution of this entry, should free external resources, cancel all pending processes and so on.