init_files

class pyrosetta.distributed.cluster.init_files.PackedPoseHasher(packed_pose: Optional[Union[Pose, PackedPose]] = None, include_cache: bool = False, include_comments: bool = False)

Bases: object

Digest the scientific state of a PackedPose or Pose object.

Warning: This class uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.

_encoding: str = 'utf-8'
_default_bytes: bytes = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
__init__(packed_pose: Optional[Union[Pose, PackedPose]] = None, include_cache: bool = False, include_comments: bool = False) None

Initialize the PackedPoseHasher class.

Warning: This method uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.

Args:
packed_pose: Pose | PackedPose | None

A PackedPose or Pose object to hash. If None, then other keyword arguments have no effect and a constant hash is returned from the PackedPoseHasher.digest method.

Default: None

include_cache: bool

A bool object specifying whether or not to include the Pose.cache entries.

Default: False

include_comments: bool

A bool object specifying whether or not to include the Pose comments entries.

Default: False

Returns:

None

digest() bytes

Digest the PackedPose or Pose object, otherwise return a default value.

encode_string(obj: str) bytes

Encode a string object into bytes.

update_hashmod(obj: Any) None

Update the hashmod with an input object.

add_coordinates() None

Update hashmod with residue numbers, residue names, atom numbers, atom names, and double precision atomic coordinate components of the Pose object.

add_cache() None

Update hashmod with serialized Pose.cache dictionary entries.

add_comments() None

Update hashmod with raw Pose comments.

class pyrosetta.distributed.cluster.init_files.InitFileSigner(input_packed_pose: Optional[Union[Pose, PackedPose]] = None, output_packed_pose: Optional[Union[Pose, PackedPose]] = None, metadata: Optional[Dict[str, Any]] = None)

Bases: object

Sign or verify PyRosetta initialization files by PyRosettaCluster.

Warning: This class uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.

_encoding: str = 'utf-8'
_prefix: bytes = b'PyRosettaCluster_init_file_signer'
__init__(input_packed_pose: Optional[Union[Pose, PackedPose]] = None, output_packed_pose: Optional[Union[Pose, PackedPose]] = None, metadata: Optional[Dict[str, Any]] = None) None

Initialize the InitFileSigner class.

Warning: This method uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.

_to_packed_pose_hash(packed_pose: Optional[Union[Pose, PackedPose]]) bytes

Hash a PackedPose object with Pose.cache and Pose comments included.

Warning: This method uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.

_to_encoding(obj: Any) bytes
_get_pose_digest(pkl: bytes) bytes
_join_bytes(*values: bytes) bytes
_setup_poses_pair(inp_pkl: bytes, out_pkl: bytes) bytes
_get_poses_digest(inp_pkl: bytes, out_pkl: bytes) bytes
_get_poses_hexdigest(inp_pkl: bytes, out_pkl: bytes) str
_get_pkg_data() bytes
_get_hmac_hexdigest(key: bytes, data: bytes) str
_get_init_key_and_msg() Tuple[bytes, bytes]
sign_sha256() str

Sign PyRosetta initialization file pose data.

sign_digest() str

Sign PyRosetta initialization file package data, pose data, and metadata.

sign() Dict[str, str]

Return a dict object with SHA256 and HMAC signature metadata.

verify_sha256(sha256: Optional[str]) bool

Verify PyRosetta initialization file pose data.

verify_signature(signature: Optional[str]) bool

Verify PyRosetta initialization file package data, pose data, and metadata.

verify(sha256: Optional[str], signature: Optional[str]) bool

Verify PyRosetta initialization file SHA256 and HMAC signature metadata.