serialization¶
- class pyrosetta.bindings.scores.serialization.PoseScoreSerializer¶
Bases:
PoseScoreSerializerBase
Serialize and deserialize score values for CustomStringValueMetric SimpleMetric.
- Examples:
- Automatically serialize an arbitrary score value:
pose.cache[“foo”] = value
- Automatically deserialize an arbitrary score value:
value = pose.cache[“foo”]
- Manually serialize an arbitrary score value:
value = PoseScoreSerializer.maybe_encode(value)
- Manually deserialize an arbitrary score value:
value = PoseScoreSerializer.maybe_decode(value)
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- static bool_from_str(value)¶
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- class pyrosetta.bindings.scores.serialization.PoseScoreSerializerBase¶
Bases:
object
Base class for PoseScoreSerializer methods.
- static bool_from_str(value)¶
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶