[docs]classBackendStatus(Enum):"""BackendStatus of a target. A target is unknown to the backend if it has not been submitted or the target has completed and thus isn't being tracked anymore by the backend. A target is submitted if it has been successfully submitted to the backend and is pending execution. A target is running if it is currently being executed by the backend. """UNKNOWN=0SUBMITTED=1RUNNING=2COMPLETED=3FAILED=4CANCELLED=5
[docs]deflist_backends():"""Return the names of all registered backends."""returnset(discover_backends().keys())
[docs]defcreate_backend(name,working_dir,config):"""Return backend class for the backend given by `name`. Returns the backend class registered with `name`. Note that the *class* is returned, not the instance, since not all uses requires initialization of the backend (e.g. accessing the backends' log manager), and initialization of the backend may be expensive. :arg str name: Path to a workflow file, optionally specifying a workflow object in that file. """backend_args=config.get_namespace(f"backend.{name}")backend_cls,_=discover_backends()[name]returnbackend_cls(working_dir=working_dir,**backend_args)