besmarts.codecs.codec_native module¶
besmarts.codecs.codec_native
SMARTS and SMILES parsing using native BESMARTS formats
- class besmarts.codecs.codec_native.graph_codec_native(primitive_codecs: Dict[primitive_key, primitive_codec], atom_primitives: Sequence[primitive_key], bond_primitives: Sequence[primitive_key])[source]¶
Bases:
graph_codecThe native graph codec implements the SMARTS and SMILES encoders which can transform SMARTS primitives in binary form to string form.
To use this interface, supply a dictionary of primitive codecs that know how to encode/decode the primitives, and then supply the initial list of primitives that will be used when encoding SMARTS. Manipulating the lists controls which primitives are active.
- besmarts.codecs.codec_native.graph_load(lines, dtype=<class 'besmarts.core.arrays.bitvec'>)[source]¶
- besmarts.codecs.codec_native.primitive_codecs_get() Dict[primitive_key, primitive_codec][source]¶
Return the primitives that the BESMARTS native codec is aware of.
- Returns:
Dict[codecs.primitive_key, codecs.primitive_codec]
The map of primitive keys (e.g. “element”) and the respective codec that
can encode/decode into binary form
- besmarts.codecs.codec_native.primitive_codecs_get_atom() Dict[primitive_key, primitive_codec][source]¶
Return the node (atom) primitives that the BESMARTS native codec is aware of.
- besmarts.codecs.codec_native.primitive_codecs_get_bond() Dict[primitive_key, primitive_codec][source]¶
Return the edge (bond) primitives that the BESMARTS native codec is aware of.