CodeEntropy.levels.nodes.axes_topology module¶
Build static axes-topology metadata for frame covariance calculations.
This module caches topology-only atom-index relationships needed by customised axes calculations. The cache avoids repeated MDAnalysis selection parsing inside the frame-local covariance loop while preserving frame-dependent positions, forces, centres, axes, torques, and moments of inertia.
- class CodeEntropy.levels.nodes.axes_topology.AxesTopology(ua: dict[tuple[int, int, int], ~CodeEntropy.levels.nodes.axes_topology.UAAxesTopology] = <factory>, residue: dict[tuple[int, int], ~CodeEntropy.levels.nodes.axes_topology.ResidueAxesTopology] = <factory>)[source]¶
Bases:
objectCached axes topology for frame covariance calculations.
- Variables:
ua (dict[tuple[int, int, int], CodeEntropy.levels.nodes.axes_topology.UAAxesTopology]) – Mapping from
(mol_id, local_residue_id, ua_id)to cached united-atom axes topology.residue (dict[tuple[int, int], CodeEntropy.levels.nodes.axes_topology.ResidueAxesTopology]) – Mapping from
(mol_id, local_residue_id)to cached residue axes topology.
- residue: dict[tuple[int, int], ResidueAxesTopology]¶
- ua: dict[tuple[int, int, int], UAAxesTopology]¶
- class CodeEntropy.levels.nodes.axes_topology.BuildAxesTopologyNode[source]¶
Bases:
objectBuild static customised-axes topology before frame covariance execution.
- run(shared_data: dict[str, Any]) dict[str, Any][source]¶
Build cached axes topology and write it into shared data.
The cache is only populated when
args.customised_axesis true. When customised axes are disabled, an empty cache is still written so later stages can readshared_data["axes_topology"]safely.- Parameters:
shared_data – Shared workflow data containing
argsand, when customised axes are enabled,reduced_universe,levels, andbeads.- Returns:
Dict containing the cached
axes_topologyobject.
- class CodeEntropy.levels.nodes.axes_topology.ResidueAxesTopology(residue_heavy_indices: ndarray, residue_ua_masses: ndarray, has_neighbor_bonds: bool)[source]¶
Bases:
objectStatic topology required to compute customised residue axes.
- Variables:
residue_heavy_indices (numpy.ndarray) – Heavy atom indices in the residue.
residue_ua_masses (numpy.ndarray) – UA masses for heavy atoms in the residue.
has_neighbor_bonds (bool) – Whether the residue is bonded to a neighbouring residue according to the original customised residue-axis selection.
- has_neighbor_bonds: bool¶
- residue_heavy_indices: ndarray¶
- residue_ua_masses: ndarray¶
- class CodeEntropy.levels.nodes.axes_topology.UAAxesTopology(heavy_atom_index: int, ua_atom_indices: ndarray, ua_all_atom_indices: ndarray, bonded_heavy_indices: ndarray, bonded_light_indices: ndarray, residue_heavy_indices: ndarray, residue_ua_masses: ndarray)[source]¶
Bases:
objectStatic topology required to compute customised united-atom axes.
- Variables:
heavy_atom_index (int) – Reduced-universe atom index for the UA heavy atom.
ua_atom_indices (numpy.ndarray) – Atom indices for the UA heavy atom and its bonded hydrogens/light atoms.
ua_all_atom_indices (numpy.ndarray) – Atom indices for the UA heavy atom, bonded heavy atoms, and bonded hydrogens/light atoms.
bonded_heavy_indices (numpy.ndarray) – Heavy atoms bonded to the UA heavy atom.
bonded_light_indices (numpy.ndarray) – Hydrogens/light atoms bonded to the UA heavy atom.
residue_heavy_indices (numpy.ndarray) – Heavy atoms in the parent residue.
residue_ua_masses (numpy.ndarray) – UA masses for heavy atoms in the parent residue.
- bonded_heavy_indices: ndarray¶
- bonded_light_indices: ndarray¶
- heavy_atom_index: int¶
- residue_heavy_indices: ndarray¶
- residue_ua_masses: ndarray¶
- ua_all_atom_indices: ndarray¶
- ua_atom_indices: ndarray¶