polymerist.genutils.fileutils.jsonio.serialize
Interfaces for extending what types of objects can be serialized to JSON
Attributes
Classes
Interface for defining how types which are not JSON serializable by default should be encoded and decoded |
|
For dynamically merging multiple TypeSerializer encoders and decoders |
|
For JSON-serializing OpenMM Quantities |
|
For JSON-serializing OpenMM Quantities |
|
For JSON-serializing of numpy n-dimensional arrays |
Functions
|
Factory for generating a TypeSerializer specific to an Enum type |
Module Contents
- polymerist.genutils.fileutils.jsonio.serialize.T
- polymerist.genutils.fileutils.jsonio.serialize.JSONSerializable
- class polymerist.genutils.fileutils.jsonio.serialize.TypeSerializer[source]
Bases:
abc.ABCInterface for defining how types which are not JSON serializable by default should be encoded and decoded
- python_type: ClassVar[Type[T]]
- class polymerist.genutils.fileutils.jsonio.serialize.MultiTypeSerializer(*type_sers: tuple[Type[TypeSerializer]])[source]
For dynamically merging multiple TypeSerializer encoders and decoders
- property type_sers: list[Type[TypeSerializer]]
Read-only wrapper for the internal registry of TypeSerializers
- add_type_serializer(obj: TypeSerializer | MultiTypeSerializer) None[source]
For type, instance, and uniqueness checking of Type
- class polymerist.genutils.fileutils.jsonio.serialize.PathSerializer[source]
Bases:
TypeSerializerFor JSON-serializing OpenMM Quantities
- class polymerist.genutils.fileutils.jsonio.serialize.QuantitySerializer[source]
Bases:
TypeSerializerFor JSON-serializing OpenMM Quantities
- class polymerist.genutils.fileutils.jsonio.serialize.NDArraySerializer[source]
Bases:
TypeSerializerFor JSON-serializing of numpy n-dimensional arrays
- polymerist.genutils.fileutils.jsonio.serialize.enum_serializer_factory(enumtype: enum.EnumType) TypeSerializer[source]
Factory for generating a TypeSerializer specific to an Enum type