toil.batchSystems.registry¶
Attributes¶
Memoize a function result based on its parameters using this decorator. |
|
Functions¶
|
|
|
Adds a batch system to the registry for workflow or plugin-supplied batch systems. |
Get the names of all the availsble batch systems. |
|
|
Get a batch system class by name. |
|
Implement a fallback attribute getter to handle deprecated constants. |
|
Deprecated method to add a batch system. |
Return a snapshot of the plugin registry that can be restored to remove |
|
|
Restore the batch system registry state to a snapshot from |
Module Contents¶
- toil.batchSystems.registry.deprecated(new_function_name)[source]¶
- Parameters:
new_function_name (str)
- Return type:
Callable[Ellipsis, Any]
- toil.batchSystems.registry.memoize¶
Memoize a function result based on its parameters using this decorator.
For example, this can be used in place of lazy initialization. If the decorating function is invoked by multiple threads, the decorated function may be called more than once with the same arguments.
- toil.batchSystems.registry.logger¶
- toil.batchSystems.registry.add_batch_system_factory(key, class_factory)[source]¶
Adds a batch system to the registry for workflow or plugin-supplied batch systems.
- Parameters:
class_factory (Callable[[], Type[toil.batchSystems.abstractBatchSystem.AbstractBatchSystem]]) – A function that returns a batch system class (NOT an instance), which implements
toil.batchSystems.abstractBatchSystem.AbstractBatchSystem.key (str)
- toil.batchSystems.registry.get_batch_systems()[source]¶
Get the names of all the availsble batch systems.
- Return type:
Sequence[str]
- toil.batchSystems.registry.get_batch_system(key)[source]¶
Get a batch system class by name.
- Raises:
KeyError if the key is not the name of a batch system, and ImportError if the batch system’s class cannot be loaded.
- Parameters:
key (str)
- Return type:
Type[toil.batchSystems.abstractBatchSystem.AbstractBatchSystem]
- toil.batchSystems.registry.DEFAULT_BATCH_SYSTEM = 'single_machine'¶
- toil.batchSystems.registry.__getattr__(name)[source]¶
Implement a fallback attribute getter to handle deprecated constants.
- toil.batchSystems.registry.addBatchSystemFactory(key, batchSystemFactory)[source]¶
Deprecated method to add a batch system.
- Parameters:
key (str)
batchSystemFactory (Callable[[], Type[toil.batchSystems.abstractBatchSystem.AbstractBatchSystem]])
- toil.batchSystems.registry.save_batch_system_plugin_state()[source]¶
Return a snapshot of the plugin registry that can be restored to remove added plugins. Useful for testing the plugin system in-process with other tests.
- Return type:
Tuple[List[str], Dict[str, Callable[[], Type[toil.batchSystems.abstractBatchSystem.AbstractBatchSystem]]]]
- toil.batchSystems.registry.restore_batch_system_plugin_state(snapshot)[source]¶
Restore the batch system registry state to a snapshot from save_batch_system_plugin_state().
- Parameters:
snapshot (Tuple[List[str], Dict[str, Callable[[], Type[toil.batchSystems.abstractBatchSystem.AbstractBatchSystem]]]])