task_registry

class pyrosetta.distributed.cluster.task_registry.ExtraArgs(*, decoy_ids: Optional[List[int]], protocols_key: str, timeout: Union[float, int], ignore_errors: bool, datetime_format: str, instance_id: str, compression: Optional[Union[str, bool]], with_nonce: bool, norm_task_options: bool, max_delay_time: Union[float, int], logging_level: str, socket_listener_address: Tuple[str, int], client_residue_type_set: Set[str])

Bases: object

Class for the value of the extra_args key in the UserArgs class.

decoy_ids: Optional[List[int]]
protocols_key: str
timeout: Union[float, int]
ignore_errors: bool
datetime_format: str
instance_id: str
compression: Optional[Union[str, bool]]
with_nonce: bool
norm_task_options: bool
max_delay_time: Union[float, int]
logging_level: str
socket_listener_address: Tuple[str, int]
client_residue_type_set: Set[str]
__init__(*, decoy_ids: Optional[List[int]], protocols_key: str, timeout: Union[float, int], ignore_errors: bool, datetime_format: str, instance_id: str, compression: Optional[Union[str, bool]], with_nonce: bool, norm_task_options: bool, max_delay_time: Union[float, int], logging_level: str, socket_listener_address: Tuple[str, int], client_residue_type_set: Set[str]) None

Method generated by attrs for class ExtraArgs.

class pyrosetta.distributed.cluster.task_registry.UserArgs(*, protocol_name: str, compressed_protocol: bytes, compressed_packed_pose: bytes, compressed_kwargs: bytes, pyrosetta_init_kwargs: Dict[str, Any], client_repr: str, extra_args: ExtraArgs, masked_key: bytes, task_id: str)

Bases: object

Class for the user_spawn_thread function argument.

protocol_name: str
compressed_protocol: bytes
compressed_packed_pose: bytes
compressed_kwargs: bytes
pyrosetta_init_kwargs: Dict[str, Any]
client_repr: str
extra_args: ExtraArgs
masked_key: bytes
task_id: str
__init__(*, protocol_name: str, compressed_protocol: bytes, compressed_packed_pose: bytes, compressed_kwargs: bytes, pyrosetta_init_kwargs: Dict[str, Any], client_repr: str, extra_args: ExtraArgs, masked_key: bytes, task_id: str) None

Method generated by attrs for class UserArgs.

class pyrosetta.distributed.cluster.task_registry.TaskRecord(*, clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any])

Bases: object

Class for PyRosettaCluster task registry entries.

clients_index: int
user_args: UserArgs
submit_kwargs: Dict[str, Any]
__init__(*, clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) None

Method generated by attrs for class TaskRecord.

pyrosetta.distributed.cluster.task_registry.UnpackedTaskRecord

A container for an unpacked PyRosettaCluster task registry entry.

alias of Tuple[int, UserArgs, Dict[str, Any]]

class pyrosetta.distributed.cluster.task_registry.TaskRegistryBase(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz')

Bases: object

Task registry base class for PyRosettaCluster.

instance_id: Optional[str]
compression: Optional[Union[str, bool]]
serializer: Serialization
seal(task_record: TaskRecord) bytes

Compress a task registry entry.

unseal(buffer: bytes) TaskRecord

Decompress a task registry entry.

deepcopy_user_args(user_args: UserArgs) UserArgs

Deep copy a UserArgs dataclass to break in-memory references to any objects that keep billiard subprocesses alive.

create_task_record(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) TaskRecord

Create a task record.

unpack_task_record(task_record: TaskRecord) Tuple[int, UserArgs, Dict[str, Any]]

Unpack a task record.

__init__(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz') None

Method generated by attrs for class TaskRegistryBase.

class pyrosetta.distributed.cluster.task_registry.DiskTaskRegistry(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz', task_registry_dir: str)

Bases: TaskRegistryBase

Task registry for on-disk PyRosettaCluster task arguments.

task_registry_dir: str
file_ext: str
_shard_key(key: str) str

Shard a Dask future key for a subdirectory name.

_get_task_file(key: str, makedirs: bool = False) str

Get a filename for a task record.

total_size() int

Return the total size of the on-disk task registry (in bytes).

set(key: str, **kwargs: Any) None

Set a task record into the on-disk task registry.

get(key: str, default: None = None) Optional[Tuple[int, UserArgs, Dict[str, Any]]]

Get an unpacked task record from the on-disk task registry.

pop(key: str) None

Remove a task record from the on-disk task registry.

clear() None

Clear all task records from the on-disk task registry.

__init__(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz', task_registry_dir: str) None

Method generated by attrs for class DiskTaskRegistry.

compression: Optional[Union[str, bool]]
create_task_record(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) TaskRecord

Create a task record.

deepcopy_user_args(user_args: UserArgs) UserArgs

Deep copy a UserArgs dataclass to break in-memory references to any objects that keep billiard subprocesses alive.

instance_id: Optional[str]
seal(task_record: TaskRecord) bytes

Compress a task registry entry.

serializer: Serialization
unpack_task_record(task_record: TaskRecord) Tuple[int, UserArgs, Dict[str, Any]]

Unpack a task record.

unseal(buffer: bytes) TaskRecord

Decompress a task registry entry.

class pyrosetta.distributed.cluster.task_registry.MemoryTaskRegistry(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz')

Bases: TaskRegistryBase

Task registry for in-memory PyRosettaCluster task arguments.

registry: Dict[str, bytes]
total_size() int

Return the total size of the in-memory task registry (in bytes).

set(key: str, **kwargs: Any) None

Set a task record into the in-memory task registry.

get(key: str, default: None = None) Optional[Tuple[int, UserArgs, Dict[str, Any]]]

Get an unpacked task record from the in-memory task registry.

pop(key: str) None

Remove a task record from the in-memory task registry.

__init__(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz') None

Method generated by attrs for class MemoryTaskRegistry.

clear() None

Clear all task records from the in-memory task registry.

compression: Optional[Union[str, bool]]
create_task_record(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) TaskRecord

Create a task record.

deepcopy_user_args(user_args: UserArgs) UserArgs

Deep copy a UserArgs dataclass to break in-memory references to any objects that keep billiard subprocesses alive.

instance_id: Optional[str]
seal(task_record: TaskRecord) bytes

Compress a task registry entry.

serializer: Serialization
unpack_task_record(task_record: TaskRecord) Tuple[int, UserArgs, Dict[str, Any]]

Unpack a task record.

unseal(buffer: bytes) TaskRecord

Decompress a task registry entry.