TopologyDict#
molsysmt.TopologyDict is the native declarative dictionary representation of molecular topology in MolSysMT.
Overview and Role#
molsysmt.TopologyDict provides a lightweight, JSON-serializable dictionary schema wrapped by the TopologyDict dataclass. It represents atoms, residues, components, molecules, entities, chains, and covalent bonds without needing DataFrame instances.
Declarative Schema#
The underlying data dictionary of TopologyDict contains envelope headers and lists of primitive item dictionaries:
Top-Level Key |
Value Type |
Description |
|---|---|---|
|
String ( |
Framework format identifier tag. |
|
String ( |
Topology category classifier. |
|
String ( |
Schema specification version string. |
|
Dictionary |
User-defined topology provenance metadata. |
|
List of Dicts |
Atom item dictionaries containing |
|
List of Dicts |
Group dictionaries containing |
|
List of Dicts |
Component dictionaries containing |
|
List of Dicts |
Molecule dictionaries containing |
|
List of Dicts |
Entity dictionaries containing |
|
List of Dicts |
Chain dictionaries containing |
|
List of Dicts |
Covalent bond dictionaries specifying |
Usage and Workflow#
import molsysmt as msm
# 1. Convert native Topology to TopologyDict
top_dict = msm.convert(topology, to_form='molsysmt.TopologyDict')
# 2. Extract primitive dictionary data
data = top_dict.to_dict()
Invariants and Performance#
JSON Compatibility: Pure Python primitives (
dict,list,str,int) for straightforward JSON transport.Deep Copy Isolation:
top_dict.to_dict(copy=True)returns isolated dictionary copies.
API Documentation#
Detailed methods for molsysmt.TopologyDict are documented in the [molsysmt.Topology API Reference].