Rosetta
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pyrosetta.distributed.cluster.serialization.Serialization Class Reference
Inheritance diagram for pyrosetta.distributed.cluster.serialization.Serialization:
Inheritance graph
[legend]

Public Member Functions

def __attrs_post_init__ (self)
 
def zlib_compress (cls, obj)
 
def requires_compression (func)
 
Union[NoReturn, None, bytescompress_packed_pose (self, Any packed_pose)
 
Union[NoReturn, None, PackedPosedecompress_packed_pose (self, Any compressed_packed_pose)
 
Union[NoReturn, bytescompress_kwargs (self, Any kwargs)
 
Union[NoReturn, Dict[Any, Any]] decompress_kwargs (self, bytes compressed_kwargs)
 
bytes compress_object (self, Any obj)
 
Any decompress_object (self, bytes compressed_obj)
 
Union[NoReturn, Dict[Any, Any]] deepcopy_kwargs (cls, Any kwargs)
 

Public Attributes

 encoder
 
 decoder
 

Static Public Attributes

 compression
 

Member Function Documentation

◆ __attrs_post_init__()

def pyrosetta.distributed.cluster.serialization.Serialization.__attrs_post_init__ (   self)

◆ compress_kwargs()

Union[NoReturn, bytes] pyrosetta.distributed.cluster.serialization.Serialization.compress_kwargs (   self,
Any  kwargs 
)
Compress a `dict` object with the `cloudpickle` and custom serialization modules.

Args:
    kwargs: the input `dict` object to compress.

Returns:
    A `bytes` object representing the compressed `dict` object.

Raises:
    `TypeError` if the 'kwargs' argument parameter is not of type `dict`.

References pyrosetta.distributed.cluster.serialization.Serialization.encoder.

◆ compress_object()

bytes pyrosetta.distributed.cluster.serialization.Serialization.compress_object (   self,
Any  obj 
)
Compress an object with the `cloudpickle` and custom serialization modules.

Args:
    obj: the input object to compress.

Returns:
    A `bytes` object representing the compressed object.

References pyrosetta.distributed.cluster.serialization.Serialization.encoder.

◆ compress_packed_pose()

Union[NoReturn, None, bytes] pyrosetta.distributed.cluster.serialization.Serialization.compress_packed_pose (   self,
Any  packed_pose 
)
Compress a `PackedPose` object with the custom serialization module. If the 'packed_pose' argument parameter
is `None`, then just return `None`.

Args:
    packed_pose: the input `PackedPose` object to compress. If `None`, then just return `None`.

Returns:
    A `bytes` object representing the compressed `PackedPose` object, or a `NoneType` object.

Raises:
    `TypeError` if the 'packed_pose' argument parameter is not of type `NoneType` or `PackedPose`.

References pyrosetta.distributed.cluster.serialization.Serialization.encoder, and pyrosetta.distributed.cluster.serialization.update_scores().

◆ decompress_kwargs()

Union[NoReturn, Dict[Any, Any]] pyrosetta.distributed.cluster.serialization.Serialization.decompress_kwargs (   self,
bytes  compressed_kwargs 
)
Decompress a `bytes` object with the custom serialization and `cloudpickle` modules.

Args:
    compressed_kwargs: the input `bytes` object to decompress.

Returns:
    A `dict` object representing the decompressed `bytes` object.

Raises:
    `TypeError` if the 'compressed_packed_pose' argument parameter is not of type `bytes`.

References pyrosetta.distributed.cluster.serialization.Serialization.decoder.

◆ decompress_object()

Any pyrosetta.distributed.cluster.serialization.Serialization.decompress_object (   self,
bytes  compressed_obj 
)
Decompress a `bytes` object with the custom serialization and `cloudpickle` modules.

Args:
    compressed_obj: the input `bytes` object to decompress.

Returns:
    An object representing the decompressed `bytes` object.

References pyrosetta.distributed.cluster.serialization.Serialization.decoder.

◆ decompress_packed_pose()

Union[NoReturn, None, PackedPose] pyrosetta.distributed.cluster.serialization.Serialization.decompress_packed_pose (   self,
Any  compressed_packed_pose 
)
Decompress a `bytes` object with the custom serialization and `cloudpickle` modules. If the 'compressed_packed_pose'
argument parameter is `None`, then just return `None`.

Args:
    compressed_packed_pose: the input `bytes` object to decompress. If `None`, then just return `None`.

Returns:
    A `PackedPose` object representing the decompressed `bytes` object, or a `NoneType` object.

Raises:
    `TypeError` if the 'compressed_packed_pose' argument parameter is not of type `NoneType` or `bytes`.

References pyrosetta.distributed.cluster.serialization.Serialization.decoder.

◆ deepcopy_kwargs()

Union[NoReturn, Dict[Any, Any]] pyrosetta.distributed.cluster.serialization.Serialization.deepcopy_kwargs (   cls,
Any  kwargs 
)
The `cloudpickle` module makes it possible to serialize Python constructs not supported
by the default `pickle` module from the Python standard library.

Args:
    kwargs: the `dict` object to be deep copied.

Returns:
    A deep copy of the `dict` object.

Raises:
    `TypeError` if the 'kwargs' argument parameter is not of type `dict`.

◆ requires_compression()

def pyrosetta.distributed.cluster.serialization.Serialization.requires_compression (   func)

◆ zlib_compress()

def pyrosetta.distributed.cluster.serialization.Serialization.zlib_compress (   cls,
  obj 
)

Member Data Documentation

◆ compression

pyrosetta.distributed.cluster.serialization.Serialization.compression
static
Initial value:
= attr.ib(
type=Optional[Union[str, bool]],
default="xz",
validator=attr.validators.optional(attr.validators.instance_of((str, bool))),
converter=_parse_compression,
)

Referenced by pyrosetta.distributed.cluster.serialization.Serialization.__attrs_post_init__(), and pyrosetta.distributed.cluster.core.PyRosettaCluster._run().

◆ decoder

pyrosetta.distributed.cluster.serialization.Serialization.decoder

◆ encoder

pyrosetta.distributed.cluster.serialization.Serialization.encoder

The documentation for this class was generated from the following file: