From 578efa56315bde12acc38eca6044fd2b1ff2ae5d Mon Sep 17 00:00:00 2001 From: ioanaapapa Date: Fri, 9 Oct 2026 08:54:44 +0100 Subject: [PATCH 01/11] changed custom axes to axes and arg type to str. Added explanation --- CodeEntropy/config/argparse.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CodeEntropy/config/argparse.py b/CodeEntropy/config/argparse.py index 80fe63dd..44fb67b5 100644 --- a/CodeEntropy/config/argparse.py +++ b/CodeEntropy/config/argparse.py @@ -142,10 +142,17 @@ class ArgSpec: default=True, help="Use combined force-torque matrix for residue-level vibrational entropies", ), - "customised_axes": ArgSpec( - type=bool, - default=True, - help="Use bonded axes to rotate forces for united-atom vibrational entropies", + "axes": ArgSpec( + type=str, + default="local", + help="Axes to be used for residue and UA level rotations. If set to principal, " + "principal axes of residue are used for residue rotation and UA translation " + "and principal axes of UA are used for UA rotation. If set to topology, " + "axes are determined using the cached topology indices rather than repeating " + "MDAnalysis selections each frame. Residue level rotation and UA translation " + "use principal axes of the residue. UA rotation uses bond-derived axes. If set" + "to local, local custom axes are used. Residue rotation and UA translation use " + "local internal coordinate-derived axes. UA rotation uses bond-derived axes.", ), "search_type": ArgSpec( type=str, From b49ea82b71c3423911202d8436ed3db966ee466b Mon Sep 17 00:00:00 2001 From: ioanaapapa Date: Fri, 9 Oct 2026 08:58:35 +0100 Subject: [PATCH 02/11] changed custom axes to axes and arg type to str. Added explanation --- CodeEntropy/config/argparse.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CodeEntropy/config/argparse.py b/CodeEntropy/config/argparse.py index 44fb67b5..8e59852d 100644 --- a/CodeEntropy/config/argparse.py +++ b/CodeEntropy/config/argparse.py @@ -150,9 +150,10 @@ class ArgSpec: "and principal axes of UA are used for UA rotation. If set to topology, " "axes are determined using the cached topology indices rather than repeating " "MDAnalysis selections each frame. Residue level rotation and UA translation " - "use principal axes of the residue. UA rotation uses bond-derived axes. If set" - "to local, local custom axes are used. Residue rotation and UA translation use " - "local internal coordinate-derived axes. UA rotation uses bond-derived axes.", + "use principal axes of the residue. UA rotation uses bond-derived axes. If set " + "to local, local level-specific custom axes are used. Residue rotation and UA " + "translation use local internal coordinate-derived axes. " + "UA rotation uses bond-derived axes.", ), "search_type": ArgSpec( type=str, From 262933bf65f0ce0478c0c15fbba02c8f24c9baa0 Mon Sep 17 00:00:00 2001 From: ioanaapapa Date: Fri, 9 Oct 2026 18:52:11 +0100 Subject: [PATCH 03/11] changed build_ua_vectors and _get_residue_axes to the three axis options --- CodeEntropy/levels/nodes/covariance.py | 71 ++++++++++++++------------ 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/CodeEntropy/levels/nodes/covariance.py b/CodeEntropy/levels/nodes/covariance.py index 63db3140..e7837cd1 100644 --- a/CodeEntropy/levels/nodes/covariance.py +++ b/CodeEntropy/levels/nodes/covariance.py @@ -83,7 +83,7 @@ def run(self, ctx: FrameCtx) -> dict[str, Any]: fp = float(args.force_partitioning) combined = bool(getattr(args, "combined_forcetorque", False)) - customised_axes = bool(getattr(args, "customised_axes", False)) + axes = bool(getattr(args, "axes", False)) box = self._try_get_box(u) fragments = u.atoms.fragments @@ -114,7 +114,7 @@ def run(self, ctx: FrameCtx) -> dict[str, Any]: axes_topology=axes_topology, box=box, force_partitioning=fp, - customised_axes=customised_axes, + axes=axes, is_highest=("united_atom" == level_list[-1]), out_force=out_force, out_torque=out_torque, @@ -131,7 +131,7 @@ def run(self, ctx: FrameCtx) -> dict[str, Any]: axes_manager=axes_manager, axes_topology=axes_topology, box=box, - customised_axes=customised_axes, + axes=axes, force_partitioning=fp, is_highest=("residue" == level_list[-1]), out_force=out_force, @@ -178,7 +178,7 @@ def _process_united_atom( axes_topology: Any | None, box: np.ndarray | None, force_partitioning: float, - customised_axes: bool, + axes: bool, is_highest: bool, out_force: dict[str, dict[Any, Matrix]], out_torque: dict[str, dict[Any, Matrix]], @@ -205,7 +205,7 @@ def _process_united_atom( axes_topology: Optional cached axes topology generated during static setup. box: Optional periodic box vector. force_partitioning: Force partitioning factor for highest-level vectors. - customised_axes: Whether customised UA axes should be used. + axes: Whether customised UA axes should be used. is_highest: Whether united atom is the highest active level. out_force: Frame-local force second-moment accumulator, mutated in place. out_torque: Frame-local torque second-moment accumulator, mutated in place. @@ -257,7 +257,7 @@ def _process_united_atom( axes_topology=axes_topology, box=box, force_partitioning=force_partitioning, - customised_axes=customised_axes, + axes=axes, is_highest=is_highest, res_position=res_position, ) @@ -281,7 +281,7 @@ def _process_residue( axes_manager: Any, axes_topology: Any | None, box: np.ndarray | None, - customised_axes: bool, + axes: bool, force_partitioning: float, is_highest: bool, out_force: dict[str, dict[Any, Matrix]], @@ -301,7 +301,7 @@ def _process_residue( axes_manager: Axes helper used to build translation and rotation axes. axes_topology: Optional cached axes topology generated during static setup. box: Optional periodic box vector. - customised_axes: Whether customised residue axes should be used. + axes: Whether customised residue axes should be used. force_partitioning: Force partitioning factor for highest-level vectors. is_highest: Whether residue is the highest active level. out_force: Frame-local force second-moment accumulator, mutated in place. @@ -327,7 +327,7 @@ def _process_residue( axes_manager=axes_manager, axes_topology=axes_topology, box=box, - customised_axes=customised_axes, + axes=axes, force_partitioning=force_partitioning, is_highest=is_highest, ) @@ -447,7 +447,7 @@ def _build_ua_vectors( axes_topology: Any | None, box: np.ndarray | None, force_partitioning: float, - customised_axes: bool, + axes: str, is_highest: bool, res_position: int, ) -> tuple[list[np.ndarray], list[np.ndarray]]: @@ -463,7 +463,7 @@ def _build_ua_vectors( axes_topology: Optional cached axes topology generated during static setup. box: Optional periodic box vector. force_partitioning: Force partitioning factor for highest-level vectors. - customised_axes: Whether customised UA axes should be used. + axes: Type of axes that should be used. is_highest: Whether UA is the highest active level. res_position: Where the residue is in the residue group @@ -472,7 +472,7 @@ def _build_ua_vectors( """ force_vecs: list[np.ndarray] = [] torque_vecs: list[np.ndarray] = [] - + print(f"The axes are: {axes}") for ua_i, bead in enumerate(bead_groups): if res_position == -1: residue = residue_group.residues[0] @@ -481,10 +481,9 @@ def _build_ua_vectors( else: residue = residue_group - if customised_axes: - ua_topology = None - if axes_topology is not None: - ua_topology = axes_topology.ua.get((mol_id, local_res_i, ua_i)) + ua_topology = None + if axes == "topology": + ua_topology = axes_topology.ua.get((mol_id, local_res_i, ua_i)) if ua_topology is not None: trans_axes, rot_axes, center, moi = ( axes_manager.get_UA_axes_from_topology( @@ -495,14 +494,22 @@ def _build_ua_vectors( ) ) else: - # we don't use the topology + # custom local axes if no topology make_whole(residue_group) make_whole(bead) trans_axes, rot_axes, center, moi = axes_manager.get_UA_axes( residue_group, ua_i, res_position ) + elif axes == "local": + # we don't use the topology + make_whole(residue_group) + make_whole(bead) + trans_axes, rot_axes, center, moi = axes_manager.get_UA_axes( + residue_group, ua_i, res_position + ) else: + print("principal axes? :(") # principal axes make_whole(residue.atoms) make_whole(bead) @@ -542,7 +549,7 @@ def _build_residue_vectors( axes_manager: Any, axes_topology: Any | None, box: np.ndarray | None, - customised_axes: bool, + axes: str, force_partitioning: float, is_highest: bool, ) -> tuple[list[np.ndarray], list[np.ndarray]]: @@ -556,7 +563,7 @@ def _build_residue_vectors( axes_manager: Axes helper used to select axes, centres, and moments. axes_topology: Optional cached axes topology generated during static setup. box: Optional periodic box vector. - customised_axes: Whether customised residue axes should be used. + axes: Type of axes that should be used force_partitioning: Force partitioning factor for highest-level vectors. is_highest: Whether residue is the highest active level. @@ -579,7 +586,7 @@ def _build_residue_vectors( axes_manager=axes_manager, axes_topology=axes_topology, box=box, - customised_axes=customised_axes, + axes=axes, ) force_vecs.append( @@ -616,7 +623,7 @@ def _get_residue_axes( axes_manager: Any, axes_topology: Any | None, box: np.ndarray | None, - customised_axes: bool, + axes: bool, ) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: """Return axes, centre, and inertia data for a residue bead. @@ -631,25 +638,25 @@ def _get_residue_axes( axes_manager: Axes helper used to select axes, centres, and moments. axes_topology: Optional cached axes topology generated during static setup. box: Optional periodic box vector. - customised_axes: Whether customised residue axes should be used. + axes: Whether customised residue axes should be used. Returns: A tuple of translation axes, rotation axes, centre, and moments of inertia. """ - if customised_axes: + if axes != "principal": res = mol.residues[local_res_i] residue_topology = None - if axes_topology is not None: + if axes == "topology": residue_topology = axes_topology.residue.get((mol_id, local_res_i)) - if residue_topology is not None: - return axes_manager.get_residue_axes_from_topology( - u=u, - mol=mol, - residue_atoms=res.atoms, - topology=residue_topology, - box=box, - ) + if residue_topology is not None: + return axes_manager.get_residue_axes_from_topology( + u=u, + mol=mol, + residue_atoms=res.atoms, + topology=residue_topology, + box=box, + ) return axes_manager.get_residue_axes( mol, local_res_i, relative_res_i, residue=res.atoms From 708e11be764e4bf8c8161141ec14880803c98f57 Mon Sep 17 00:00:00 2001 From: ioanaapapa Date: Tue, 13 Oct 2026 14:09:34 +0100 Subject: [PATCH 04/11] debugging print statements --- CodeEntropy/levels/axes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CodeEntropy/levels/axes.py b/CodeEntropy/levels/axes.py index 04c59315..af7c22de 100644 --- a/CodeEntropy/levels/axes.py +++ b/CodeEntropy/levels/axes.py @@ -115,6 +115,7 @@ def get_residue_axes( ValueError: If the residue selection is empty. """ + print("THE LOCAL CUSTOM RESIDUE AXES") # TODO refine selection so that it will work for branched polymers index_prev = index + relative_index - 1 @@ -204,6 +205,7 @@ def get_residue_axes_from_topology( - center: Residue centre, shape ``(3,)``. - moment_of_inertia: Principal moments, shape ``(3,)``. """ + print("THE TOPOLOGY AXES") dimensions = ( np.asarray(box, dtype=float) if box is not None @@ -274,7 +276,7 @@ def get_UA_axes(self, data_container, index: int, res_position): ValueError: If axis construction fails. """ - + print("THE LOCAL UA AXES") index = int(index) # UA bead index heavy_atoms = data_container.select_atoms("mass 2 to 999") # use the same customPI trans axes as the residue level @@ -401,6 +403,7 @@ def get_UA_axes_from_topology( Raises: ValueError: If cached bonded-axis construction fails. """ + print("THE TOPOLOGY AXES") dimensions = ( np.asarray(box, dtype=float) if box is not None From 62db23de456dd6c1b25f45caf2d06f3073646d76 Mon Sep 17 00:00:00 2001 From: ioanaapapa Date: Mon, 19 Oct 2026 16:30:21 +0100 Subject: [PATCH 05/11] axes.py should remain unchanged --- CodeEntropy/levels/axes.py | 1178 ++++++++++++++++++++++++++++++++++++ 1 file changed, 1178 insertions(+) create mode 100644 CodeEntropy/levels/axes.py diff --git a/CodeEntropy/levels/axes.py b/CodeEntropy/levels/axes.py new file mode 100644 index 00000000..4a3fec59 --- /dev/null +++ b/CodeEntropy/levels/axes.py @@ -0,0 +1,1178 @@ +"""Axes utilities for entropy calculations. + +This module contains the :class:`AxesCalculator`, a geometry-focused helper used by +the entropy pipeline to compute translational and rotational axes, centres, and +moments of inertia at different hierarchy levels (residue / united-atom). +""" + +from __future__ import annotations + +import logging +from collections.abc import Sequence + +import numpy as np +from MDAnalysis.lib.mdamath import make_whole + +logger = logging.getLogger(__name__) + + +class AxesCalculator: + """Compute translation/rotation axes and inertia utilities used by entropy. + + Manages the structural and dynamic levels involved in entropy calculations. + This includes selecting relevant levels, computing axes for translation and + rotation, and handling bead-based representations of molecular systems. + + Provides utility methods to: + + - Extract averaged positions. + - Convert coordinates to spherical systems (future/legacy scope). + - Compute axes used to rotate forces around. + - Compute custom moments of inertia. + - Manipulate vectors under periodic boundary conditions (PBC). + - Construct custom moment-of-inertia tensors and principal axes. + + Notes: + This class deliberately does not: + + - Compute weighted forces/torques (that belongs in ForceTorqueCalculator). + - Build covariances. + - Compute entropies. + """ + + def __init__(self) -> None: + """Initialize the AxesCalculator. + + The original implementation stored a few placeholders for level-related + data (axes, bead counts, etc.). In the current design, AxesCalculator is a + stateless helper, but we keep the attributes for compatibility and + debugging/extension. + + Attributes: + data_container: Optional container used by legacy workflows. + _levels: Optional levels list (legacy/placeholder). + _trans_axes: Optional cached translation axes (legacy/placeholder). + _rot_axes: Optional cached rotation axes (legacy/placeholder). + _number_of_beads: Optional bead count (legacy/placeholder). + """ + self.data_container = None + self._levels = None + self._trans_axes = None + self._rot_axes = None + self._number_of_beads = None + + def get_residue_axes( + self, data_container, index: int, relative_index: int, residue=None + ): + """Compute residue-level translational and rotational axes. + + The translational and rotational axes at the residue level. + + - Identify the residue (either provided or selected by `resindex index`). + - Determine whether the residue is bonded to neighbouring residues + (previous/next in sequence) using MDAnalysis bonded selections. + - If there are *no* bonds to other residues: + * Use a custom principal axes, from a moment-of-inertia (MOI) tensor + that uses positions of heavy atoms only, but includes masses of + heavy atom + bonded hydrogens. + * Set translational axes equal to rotational axes (as per the original + code convention). + + - If bonded to only one other residue: + * Translational axes are principal axes of data_container. + * Find edge heavy atom (i.e. heavy atoms bonded to neighbour residue). + Compute rotation centre and axes as in get_terminal_axes. + Compute custom MOI, using all atoms positions and masses. + + - If bonded to at least two other residues: + * Translational axes are principal axes of data_container. + * Find edge heavy atoms (i.e. heavy atoms bonded to neighbour residues). + Compute rotation centre and axes as in get_non_terminal_axes. + Compute custom MOI, using all atoms positions and masses. + + + Args: + data_container (MDAnalysis.Universe or AtomGroup): + Molecule and trajectory data (the fragment/molecule container). + index (int): + Residue index (resindex) within `data_container`. + relative_index (int): + Index of first residue within 'data_container'. + This is used to obtain index in MDA Universe for atom selections. + residue (MDAnalysis.AtomGroup, optional): + If provided, this residue selection will be used rather than + selecting again. + + Returns: + Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: + - trans_axes: Translational axes array of shape (3, 3). + - rot_axes: Rotational axes array of shape (3, 3). + - center: Center of mass array of shape (3,). + - moment_of_inertia: Principal moments array of shape (3,). + + Raises: + ValueError: + If the residue selection is empty. + """ + # TODO refine selection so that it will work for branched polymers + + index_prev = index + relative_index - 1 + index_next = index + relative_index + 1 + print("THE CUSTOM RESIDUE AXES!!!") + + if residue is None: + residue = data_container.select_atoms(f"resindex {index + relative_index}") + # residue of interest + if len(residue) == 0: + raise ValueError( + f"Empty residue selection for resindex={index + relative_index}" + ) + + edge_atom_set = data_container.atoms.select_atoms( + f"resindex {index + relative_index} and " + f"(bonded resindex {index_prev} or " + f"resindex {index_next})" + ) + + if len(edge_atom_set) == 0: + rot_axes, moment_of_inertia = self.get_molecule_axes(residue) + trans_axes = rot_axes # per original convention + rot_center = np.array(residue.center_of_mass()) + else: + make_whole(data_container.atoms) + trans_axes = self.get_principal_axes_from_group(data_container.atoms) + if len(edge_atom_set) == 1: + edge_atom = edge_atom_set[0] + rot_center, rot_axes = self.get_terminal_axes( + residue=residue, + edge=edge_atom, + dimensions=data_container.dimensions[:3], + ) + else: + rot_center, rot_axes = self.get_non_terminal_axes( + residue=residue, + edges=edge_atom_set, + dimensions=data_container.dimensions[:3], + ) + moment_of_inertia = self.get_custom_residue_moment_of_inertia( + center_of_mass=rot_center, + positions=residue.atoms.positions, + masses=residue.atoms.masses, + custom_rot_axes=rot_axes, + dimensions=data_container.dimensions[:3], + ) + return trans_axes, rot_axes, rot_center, moment_of_inertia + + def get_residue_axes_from_topology( + self, + *, + u, + mol, + residue_atoms, + topology, + ): + """Compute residue axes using cached static topology. + + This is the cached-index equivalent of ``get_residue_axes``. It keeps + all frame-dependent numerical work frame-local, but avoids repeated + MDAnalysis selections for residue heavy atoms, UA masses, and neighbour + bond discovery. + + Args: + u: Current-frame universe used to resolve cached atom indices. + mol: Current-frame molecule fragment. + residue_atoms: AtomGroup for the residue in the current frame. + topology: Cached ``ResidueAxesTopology`` for this residue. + + Returns: + Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: + - trans_axes: Translational axes, shape ``(3, 3)``. + - rot_axes: Rotational axes, shape ``(3, 3)``. + - center: Residue centre, shape ``(3,)``. + - moment_of_inertia: Principal moments, shape ``(3,)``. + """ + center = residue_atoms.center_of_mass(unwrap=True) + + if not topology.has_neighbor_bonds: + rot_axes, moment_of_inertia = self.get_molecule_axes(residue_atoms) + trans_axes = rot_axes + else: + make_whole(mol.atoms) + trans_axes = self.get_principal_axes_from_group(mol.atoms) + rot_axes, moment_of_inertia = self.get_molecule_axes(residue_atoms) + center = residue_atoms.center_of_mass(unwrap=True) + + return trans_axes, rot_axes, center, moment_of_inertia + + def get_UA_axes(self, data_container, index: int, res_position): + """Compute united-atom-level translational and rotational axes. + + The translational and rotational axes at the united-atom level. + + This preserves the original behaviour and its rationale: + + - Translational axes: + Use the same approach as residue level rotational. + Identify residue of interest and neighbours, then select + edge heavy atoms (i.e. heavy atoms bonded to neighbour residues). + - If there are *no* bonds to other residues, use a custom principal axes + from a moment-of-inertia (MOI) tensor that uses positions of heavy atoms + only, but includes masses of heavy atom + bonded hydrogens. + - If bonded to only one other residue, see get_terminal_axes. + - If bonded to at least two other residues, see get_non_terminal_axes. + + - Rotational axes: + Identify heavy atoms in the residue/molecule of interest and choose + the `index`-th heavy atom (where index corresponds to the bead index). + Use bonded topology around that heavy atom to determine UA rotational + axes (see :meth:`get_bonded_axes`). Compute a custom MOI tensor. + + Args: + data_container (MDAnalysis.Universe or AtomGroup): + Molecule and trajectory data. + index (int): + Bead index (ordinal among heavy atoms). + res_position: where the residue of interest is + in data_container + Returns: + Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: + - trans_axes: Translational axes (3, 3). + - rot_axes: Rotational axes (3, 3). + - center: Rotation centre (3,) (heavy atom position). + - moment_of_inertia: (3,) moments for the UA around rot_axes. + + Raises: + IndexError: + If `index` does not correspond to an existing heavy atom. + ValueError: + If axis construction fails. + """ + print("THE CUSTOM UA AXES!!!") + + index = int(index) # UA bead index + heavy_atoms = data_container.select_atoms("mass 2 to 999") + # use the same trans axes as the residue level + if len(heavy_atoms) > 1: + if len(data_container.residues) == 1: + # only the one residue => use principal axes + residue = data_container + trans_center = data_container.atoms.center_of_mass(unwrap=True) + trans_axes = self.get_principal_axes_from_group(data_container.atoms) + else: + # residue of interest has at least one neighbour + if res_position == -1 or res_position == 1: + # look at a terminal residue + if res_position == -1: + # first residue + residue = data_container.residues[0] + resindex = residue.resindex + resindex_next = resindex + 1 + edge_atom_set = data_container.select_atoms( + f"resindex {resindex} and bonded resindex {resindex_next}" + ) + else: + # last residue + residue = data_container.residues[1] + resindex = residue.resindex + resindex_prev = resindex - 1 + edge_atom_set = data_container.select_atoms( + f"resindex {resindex} and bonded resindex {resindex_prev}" + ) + edge_atom = edge_atom_set[0] + trans_center, trans_axes = self.get_terminal_axes( + residue=residue, + edge=edge_atom, + dimensions=data_container.dimensions[:3], + ) + else: + # between 2 residues + residue = data_container.residues[1] + resindex = residue.resindex + resindex_next = resindex + 1 + resindex_prev = resindex - 1 + edge_atom_set = data_container.select_atoms( + f"resindex {resindex} and " + f"(bonded resindex {resindex_prev} or " + f"resindex {resindex_next})" + ) + trans_center, trans_axes = self.get_non_terminal_axes( + residue=residue, + edges=edge_atom_set, + dimensions=data_container.dimensions[:3], + ) + # look for heavy atoms in residue of interest + residue_heavy_atoms = residue.atoms.select_atoms("mass 2 to 999") + + heavy_atom_indices = [] + for atom in residue_heavy_atoms: + heavy_atom_indices.append(atom.index) + # we find the nth heavy atom + # where n is the bead index + heavy_atom_index = heavy_atom_indices[index] + heavy_atom = residue.atoms.select_atoms(f"index {heavy_atom_index}")[0] + rot_center = heavy_atom.position + rot_axes, moment_of_inertia = self.get_bonded_axes( + system=data_container, + atom=heavy_atom, + dimensions=data_container.dimensions[:3], + ) + + else: + # 1 heavy atom in the data_container + heavy_atom = heavy_atoms[0] + # trans and rot centres are centre of mass + rot_center = data_container.center_of_mass() + rot_axes, moment_of_inertia = self.get_bonded_axes( + system=data_container, + atom=heavy_atom, + dimensions=data_container.dimensions[:3], + ) + trans_center = rot_center + # principal axes + trans_axes = rot_axes + + if trans_axes is None: + raise ValueError("Unable to compute translation axes for UA bead.") + + if rot_axes is None or moment_of_inertia is None: + raise ValueError("Unable to compute bonded axes for UA bead.") + + logger.debug("Translational Axes: %s", trans_axes) + logger.debug("Rotational Axes: %s", rot_axes) + logger.debug("Translational center: %s", trans_center) + logger.debug("Rotational center: %s", rot_center) + logger.debug("Moment of Inertia: %s", moment_of_inertia) + + return trans_axes, rot_axes, rot_center, moment_of_inertia + + def get_UA_axes_from_topology( + self, + *, + u, + residue_atoms, + topology, + box: np.ndarray | None, + ): + """Compute UA axes using cached static topology. + + This is the cached-index equivalent of ``get_UA_axes``. It preserves the + frame-dependent numerical calculations, but avoids repeated MDAnalysis + selection strings for heavy atoms, bonded atoms, and UA masses. + + Args: + u: Current-frame universe. + residue_atoms: AtomGroup for the parent residue in the current frame. + topology: Cached ``UAAxesTopology`` for this UA bead. + box: Current periodic box lengths. If omitted, ``u.dimensions`` is used. + + Returns: + Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: + - trans_axes: Translational axes, shape ``(3, 3)``. + - rot_axes: Rotational axes, shape ``(3, 3)``. + - center: Rotation centre, shape ``(3,)``. + - moment_of_inertia: Principal moments, shape ``(3,)``. + + Raises: + ValueError: If cached bonded-axis construction fails. + """ + dimensions = ( + np.asarray(box, dtype=float) + if box is not None + else np.asarray(u.dimensions[:3], dtype=float) + ) + + heavy_atoms = u.atoms[topology.residue_heavy_indices] + heavy_atom = u.atoms[int(topology.heavy_atom_index)] + + if len(heavy_atoms) > 1: + trans_axes = self.get_principal_axes_from_group(residue_atoms) + else: + make_whole(residue_atoms) + trans_axes = self.get_principal_axes_from_group(residue_atoms) + + center = heavy_atom.position + rot_axes, moment_of_inertia = self.get_bonded_axes_from_topology( + u=u, + heavy_atom=heavy_atom, + topology=topology, + dimensions=dimensions, + ) + if rot_axes is None or moment_of_inertia is None: + raise ValueError("Unable to compute bonded axes for cached UA bead.") + + logger.debug("Translational Axes: %s", trans_axes) + logger.debug("Rotational Axes: %s", rot_axes) + logger.debug("Center: %s", center) + logger.debug("Moment of Inertia: %s", moment_of_inertia) + + return trans_axes, rot_axes, center, moment_of_inertia + + def get_bonded_axes_from_topology( + self, + *, + u, + heavy_atom, + topology, + dimensions: np.ndarray, + ): + """Compute UA bonded axes using cached bonded atom indices. + + This mirrors ``get_bonded_axes`` but receives precomputed bonded atom + memberships from ``UAAxesTopology`` instead of rediscovering them with + MDAnalysis selection strings inside the frame loop. + + Args: + u: Current-frame universe. + heavy_atom: Current-frame heavy atom for the UA bead. + topology: Cached ``UAAxesTopology`` for the UA bead. + dimensions: Simulation box lengths, shape ``(3,)``. + + Returns: + Tuple[np.ndarray | None, np.ndarray | None]: + - custom_axes: Custom rotation axes, shape ``(3, 3)``, or ``None``. + - custom_moment_of_inertia: Principal moments, shape ``(3,)``, or + ``None``. + """ + if not heavy_atom.mass > 1.1: + return None, None + + custom_moment_of_inertia = None + custom_axes = None + + heavy_bonded = u.atoms[topology.bonded_heavy_indices] + light_bonded = u.atoms[topology.bonded_light_indices] + ua = u.atoms[topology.ua_atom_indices] + ua_all = u.atoms[topology.ua_all_atom_indices] + + if len(heavy_bonded) == 0: + custom_axes, custom_moment_of_inertia = self.get_molecule_axes(ua_all) + + if len(heavy_bonded) == 1 and len(light_bonded) == 0: + custom_axes = self.get_bonded_vector_axes( + a=heavy_atom.position, + b_list=[heavy_bonded[0].position], + c=np.zeros(3), + dimensions=dimensions, + ) + + if len(heavy_bonded) == 1 and len(light_bonded) >= 1: + custom_axes = self.get_bonded_vector_axes( + a=heavy_atom.position, + b_list=[heavy_bonded[0].position], + c=light_bonded[0].position, + dimensions=dimensions, + ) + + if len(heavy_bonded) >= 2: + custom_axes = self.get_bonded_vector_axes( + a=heavy_atom.position, + b_list=heavy_bonded.positions, + c=heavy_bonded[1].position, + dimensions=dimensions, + ) + + if custom_axes is None: + return None, None + + if custom_moment_of_inertia is None: + custom_moment_of_inertia = self.get_custom_moment_of_inertia( + UA=ua, + custom_rotation_axes=custom_axes, + center_of_mass=heavy_atom.position, + dimensions=dimensions, + ) + + custom_axes = self.get_flipped_axes( + ua, + custom_axes, + heavy_atom.position, + dimensions, + ) + + return custom_axes, custom_moment_of_inertia + + def get_residue_custom_axes(self, edges, center): + """ + Compute rotation axes at the residue level, given + two edge atoms of the residue (E1+E2), + and the centre of geometry of backbone atoms + that are not edges (C). + x axis is O-E1 + y axis is O-C (perpendicular to O-E1 in the + same plane as E2) + z axis is perpendicular to the two other axes + + :: + + C + | + | + E1 ---- O --- E2 + + Args: + edges: (2,3) positions of two edge atoms + center: (3,) coordinates of the inner backbone + centre of geometry + + Returns: + rot_center: (3,) rotation centre, + lies on the E1-E2 vector + rot_axes: (3,3) rotation axes of residue + + Raises: + ValueError: If axes cannot be normalized due to degeneracy. + + """ + first_edge_centre_of_geometry_vector = center - edges[0] + # look for projection of E1-O onto E1-E2 (E1-C) + first_edge_second_edge_vector = edges[1] - edges[0] + first_edge_origin_vector = ( + np.dot(first_edge_second_edge_vector, first_edge_centre_of_geometry_vector) + / (np.linalg.norm(first_edge_second_edge_vector) ** 2) + ) * first_edge_second_edge_vector + x_axis = -first_edge_origin_vector + # O-C = O-E1 + E1-C + origin_centre_of_geometry_vector = ( + -first_edge_origin_vector + first_edge_centre_of_geometry_vector + ) + y_axis = origin_centre_of_geometry_vector + z_axis = np.cross(x_axis, y_axis) + unscaled_rot_axes = np.array((x_axis, y_axis, z_axis), dtype=float) + mod = np.sqrt(np.sum(unscaled_rot_axes**2, axis=1)) + if np.any(np.isclose(mod, 0.0)): + raise ValueError("Degenerate custom axes: cannot normalize (zero norm).") + rot_axes = unscaled_rot_axes / mod[:, np.newaxis] + rot_center = first_edge_origin_vector + edges[0] + return rot_center, rot_axes + + def get_terminal_axes(self, residue, edge, dimensions): + """ + Compute rotation axes at the residue level/translation axes at the UA level + for the terminal residues in a polymer, given the edge atom + (i.e. atom bonded to neighbour residue) and residue of interest. + Find all heavy atoms bonded to edge heavy atom and compute + their average position. Find all other heavy atoms in residue + and compute their average position. The three points are now used to + obtain determine residue rotational axes. (see get_residue_custom_axes) + If there are only two heavy atoms in the residue/all heavy atoms are bonded + to edge atom, x-axis is set along the vector between the + edge atom and average position of bonded atoms, y-axis is arbitrary + and z-axis is paralel to the two. This is the same as case 2 in get_bonded_axes. + If there no heavy atoms bonded to the edge atom (i.e. the edge atom is the only + heavy atom in the residue), centre is set on edge atom and axes are principal + axes. + + Args: + residue: MDAnalysis AtomGroup + edge: MDAnalysis atom + dimensions: (3,) dimensions of the simulation box + + Returns: + rot_center: (3,) rotation centre, + rot_axes: (3,3) rotation axes of residue + """ + heavy_atoms = residue.atoms.select_atoms("mass 2 to 999") + bonded_atoms = residue.atoms.select_atoms( + f"(mass 2 to 999) and bonded index {edge.index}" + ) + if len(bonded_atoms) == 0: + # there is only one heavy atom in the residue + rot_center = edge.position + rot_axes = self.get_principal_axes_from_group(residue.atoms) + else: + average_bonded = np.zeros(3) + for bonded_atom in bonded_atoms: + average_bonded += bonded_atom.position + average_bonded /= len(bonded_atoms) + # find the average position of all other heavy atoms in residue + other_atoms = [] + for atom in heavy_atoms: + if atom != edge and atom not in bonded_atoms: + other_atoms.append(atom) + if len(other_atoms) > 0: + average_other_atoms = np.zeros(3) + for atom in other_atoms: + average_other_atoms += atom.position + average_other_atoms /= len(other_atoms) + rot_center, rot_axes = self.get_residue_custom_axes( + [edge.position, average_other_atoms], average_bonded + ) + else: + rot_center = edge.position + rot_axes = self.get_bonded_vector_axes( + a=edge.position, + b_list=[average_bonded], + c=np.zeros(3), + dimensions=dimensions, + ) + return rot_center, rot_axes + + def get_non_terminal_axes(self, residue, edges, dimensions): + """ + Compute rotation axes at the residue level/ translation axes at + the UA level for the non-terminal residues in a linear polymer, given the + edge atoms (i.e. heavy atoms bonded to neighbour residues) and + residue of interest. Find the shortest chain between edge atoms: the backbone. + Edges + backbone average position determine the residue rotational axes. + (see get_residue_custom_axes). If the two edge heavy atoms + are bonded to each other (i.e. there is no backbone), x-axis is set + along the vector between the edge atom and average position of bonded + atoms, y-axis is arbitrary and z-axis is paralel to the two. This is the + same as case 2 in get_bonded_axes. + Args: + residue: MDAnalysis AtomGroup + edges: MDAnalysis AtomGroup + dimensions: (3,) dimensions of the simulation box + + Returns: + rot_center: (3,) rotation centre, + rot_axes: (3,3) rotation axes of residue + """ + backbone = self.get_chain(residue, edges[0], edges[1]) + backbone_center = np.zeros(3) + if len(backbone) > 0: + for heavy_atom in backbone: + backbone_center += heavy_atom.position + backbone_center /= len(backbone) + rot_center, rot_axes = self.get_residue_custom_axes( + edges.positions, backbone_center + ) + else: + rot_center = (edges[0].position + edges[1].position) / 2 + rot_axes = self.get_bonded_vector_axes( + a=rot_center, + b_list=[edges[0].position], + c=np.zeros(3), + dimensions=dimensions, + ) + return rot_center, rot_axes + + def get_bonded_axes(self, system, atom, dimensions: np.ndarray): + """ + Compute UA rotational axes from bonded topology around a heavy atom. + + For a given heavy atom, use its bonded atoms to get the axes for rotating + forces around. Few cases for choosing united atom axes, which are dependent + on the bonds to the atom: + + :: + + X -- H = bonded to zero or more light atom/s (case1) + + X -- R = bonded to one heavy atom (case2) + + R -- X -- H = bonded to one heavy and at least one light atom (case3) + + R1 -- X -- R2 = bonded to two heavy atoms (case4) + + R1 -- X -- R2 = bonded to more than two heavy atoms (case5) + | + R3 + + Note that axis2 is calculated by taking the cross product between axis1 and + the vector chosen for each case, dependent on bonding: + + - case1: if all the bonded atoms are hydrogens, use the principal axes. + + - case2: use XR vector as axis1, arbitrary axis2. + + - case3: use XR vector as axis1, vector XH to calculate axis2 + + - case4: use vector XR1 as axis1, and XR2 to calculate axis2 + + - case5: get the sum of all XR normalised vectors as axis1, then use vector + R1R2 to calculate axis2 + + axis3 is always the cross product of axis1 and axis2. + + Args: + system: + MDAnalysis selection containing all atoms in current frame. + atom: + MDAnalysis Atom for the heavy atom. + dimensions: + Simulation box dimensions (3,). + + Returns: + Tuple[np.ndarray | None, np.ndarray | None]: + - custom_axes: Custom axes (3, 3), or None if atom is not heavy. + - custom_moment_of_inertia: (3,) moment of inertia around axes. + + Notes: + If custom_moment_of_inertia is not produced by the chosen method, it is + computed using :meth:`get_custom_moment_of_inertia` with the heavy atom + as COM (matching original behaviour). + """ + # check atom is a heavy atom + if not atom.mass > 1.1: + return None, None + + custom_moment_of_inertia = None + custom_axes = None + + heavy_bonded, light_bonded = self.find_bonded_atoms(atom.index, system) + ua = atom + light_bonded + ua_all = atom + heavy_bonded + light_bonded + + # case1 + if len(heavy_bonded) == 0: + custom_axes, custom_moment_of_inertia = self.get_molecule_axes(ua_all) + + # case2 + if len(heavy_bonded) == 1 and len(light_bonded) == 0: + custom_axes = self.get_bonded_vector_axes( + a=atom.position, + b_list=[heavy_bonded[0].position], + c=np.zeros(3), + dimensions=dimensions, + ) + + # case3 + if len(heavy_bonded) == 1 and len(light_bonded) >= 1: + custom_axes = self.get_bonded_vector_axes( + a=atom.position, + b_list=[heavy_bonded[0].position], + c=light_bonded[0].position, + dimensions=dimensions, + ) + + # case4 (not used in original 2019 code; case5 used instead) + # case5 + if len(heavy_bonded) >= 2: + custom_axes = self.get_bonded_vector_axes( + a=atom.position, + b_list=heavy_bonded.positions, + c=heavy_bonded[1].position, + dimensions=dimensions, + ) + + if custom_axes is None: + return None, None + + if custom_moment_of_inertia is None: + custom_moment_of_inertia = self.get_custom_moment_of_inertia( + UA=ua, + custom_rotation_axes=custom_axes, + center_of_mass=atom.position, + dimensions=dimensions, + ) + + # flip axes to face correct way wrt COM + custom_axes = self.get_flipped_axes(ua, custom_axes, atom.position, dimensions) + + return custom_axes, custom_moment_of_inertia + + def find_bonded_atoms(self, atom_idx: int, system): + """Find bonded heavy and hydrogen atoms for a given atom. + + Args: + atom_idx: Atom index to find bonded atoms for. + system: MDAnalysis selection containing all atoms in current frame. + + Returns: + Tuple[AtomGroup, AtomGroup]: + - bonded_heavy_atoms: bonded heavy atoms (mass 2 to 999) + - bonded_H_atoms: bonded hydrogen atoms (mass 1 to 1.1) + """ + bonded_atoms = system.select_atoms(f"bonded index {atom_idx}") + bonded_heavy_atoms = bonded_atoms.select_atoms("mass 2 to 999") + bonded_H_atoms = bonded_atoms.select_atoms("mass 1 to 1.1") + return bonded_heavy_atoms, bonded_H_atoms + + def get_molecule_axes(self, molecule): + """Get principal axes and sorted principal moments. + + Compute the principal axes and moments of inertia for a molecule from its + moment of inertia tensor. + + - The molecule is made whole to ensure correct handling of PBC. The tensor + is taken after that, so it does not depend on where the molecule sits + relative to the periodic boundary. + - The moments are obtained by diagonalising the moment of inertia tensor. + - Eigenvalues are returned sorted from largest to smallest magnitude. + + Args: + molecule (MDAnalysis.core.groups.AtomGroup): + AtomGroup representing the molecule/bead. + + Returns: + Tuple[np.ndarray, np.ndarray]: + - principal_axes: (3, 3) axes. + - moment_of_inertia: (3,) moments sorted descending by absolute value. + """ + make_whole(molecule.atoms) + return self.get_principal_axes_from_tensor(molecule.moment_of_inertia()) + + def get_bonded_vector_axes( + self, + a: np.ndarray, + b_list: Sequence[np.ndarray], + c: np.ndarray, + dimensions: np.ndarray, + ) -> np.ndarray: + r"""Compute custom rotation axes from bonded vectors (PBC-aware). + + For atoms a, b_list and c, calculate the axis to rotate forces around: + + - axis1: use the normalised vector ab as axis1. If there is more than one + bonded heavy atom (HA), average over all the normalised vectors + calculated from b_list and use this as axis1. b_list contains all the + bonded heavy atom coordinates. + + - axis2: use the cross product of normalised vector ac and axis1 as axis2. + If there are more than two bonded heavy atoms, then use normalised vector + b[0]c to cross product with axis1. This gives the axis perpendicular + to axis1. + + - axis3: the cross product of axis1 and axis2, which is perpendicular to + axis1 and axis2. + + Args: + a: Central united-atom coordinates (3,). + b_list: Positions of heavy bonded atoms. + c: Coordinates of a second heavy atom or a hydrogen atom. + dimensions: Simulation box dimensions (3,). + + .. code-block:: text + + a 1 = norm_ab + / \ 2 = perpendicular to norm_ab and norm_ac (or bc if >2 HAs) + / \ 3 = perpendicular to 1 and 2 + b c + + Returns: + np.ndarray: (3, 3) array of the axes used to rotate forces. + + Raises: + ValueError: If axes cannot be normalized due to degeneracy. + """ + unscaled_axis1 = np.zeros(3, dtype=float) + for b in b_list: + ab_vector = self.get_vector(a, b, dimensions) + unscaled_axis1 += ab_vector + + if np.allclose(unscaled_axis1, 0.0): + raise ValueError("Degenerate axis1: summed bonded vectors are zero.") + + if len(b_list) >= 2: + ac_vector = self.get_vector(c, np.asarray(b_list)[0], dimensions) + else: + ac_vector = self.get_vector(c, a, dimensions) + + unscaled_axis2 = np.cross(ac_vector, unscaled_axis1) + unscaled_axis3 = np.cross(unscaled_axis2, unscaled_axis1) + + unscaled_custom_axes = np.array( + (unscaled_axis1, unscaled_axis2, unscaled_axis3), dtype=float + ) + mod = np.sqrt(np.sum(unscaled_custom_axes**2, axis=1)) + if np.any(np.isclose(mod, 0.0)): + raise ValueError("Degenerate custom axes: cannot normalize (zero norm).") + + scaled_custom_axes = unscaled_custom_axes / mod[:, np.newaxis] + return scaled_custom_axes + + def get_custom_residue_moment_of_inertia( + self, + center_of_mass: np.ndarray, + positions: np.ndarray, + masses: np.ndarray, + custom_rot_axes: np.ndarray, + dimensions: np.ndarray, + ): + """ + Compute moment of inertia around custom axes for a bead + formed of multiple UAs. + + Args: + center_of_mass: (3, ) COM for bead + positions: (N,3) positions of the atoms in the bead + masses: (N,) masses of the atoms in the bead + custom_rot_axes: (3,3) array of residue rotation axes + dimensions: (3,) simulation_box_dimensions + + Returns: + np.ndarray: (3,) moment of inertia array. + + """ + + translated_coords = self.get_vector(center_of_mass, positions, dimensions) + custom_moment_of_inertia = np.zeros(3, dtype=float) + + for coord, mass in zip(translated_coords, masses, strict=True): + axis_component = np.sum( + np.cross(custom_rot_axes, coord) ** 2 * mass, axis=1 + ) + custom_moment_of_inertia += axis_component + + return custom_moment_of_inertia + + def get_custom_moment_of_inertia( + self, + UA, + custom_rotation_axes: np.ndarray, + center_of_mass: np.ndarray, + dimensions: np.ndarray, + ) -> np.ndarray: + """Compute moment of inertia around custom axes for a UA. + + Get the moment of inertia (specifically used for the united atom level) + from a set of rotation axes and a given center of mass (COM is usually the + heavy atom position in a UA). + + Original behaviour preserved: + + - Uses PBC-aware translated coordinates. + - Sums contributions from each atom using the squared norm of (axis × r) + multiplied by mass. + - Removes the lowest MOI degree of freedom if the UA only has a single + bonded H (i.e. UA has 2 atoms total). + + Args: + UA: MDAnalysis AtomGroup for the UA (heavy + bonded H atoms). + custom_rotation_axes: (3, 3) array of rotation axes. + center_of_mass: (3,) COM for the UA (typically HA position). + dimensions: (3,) simulation box dimensions. + + Returns: + np.ndarray: (3,) moment of inertia array. + """ + translated_coords = self.get_vector(center_of_mass, UA.positions, dimensions) + custom_moment_of_inertia = np.zeros(3, dtype=float) + + for coord, mass in zip(translated_coords, UA.masses, strict=True): + axis_component = np.sum( + np.cross(custom_rotation_axes, coord) ** 2 * mass, axis=1 + ) + custom_moment_of_inertia += axis_component + + if len(UA) == 2: + order = custom_moment_of_inertia.argsort()[::-1] # descending order + custom_moment_of_inertia[order[-1]] = 0.0 + + return custom_moment_of_inertia + + def get_flipped_axes( + self, + UA, + custom_axes: np.ndarray, + center_of_mass: np.ndarray, + dimensions: np.ndarray, + ): + """Flip custom axes to a consistent direction with respect to the UA. + + For a given set of custom axes, ensure the axes are pointing in the + correct direction with respect to the heavy atom position and the chosen + center of mass. + + Args: + UA: MDAnalysis AtomGroup for the UA. + custom_axes: (3, 3) array of rotation axes. + center_of_mass: (3,) COM reference (usually HA position). + dimensions: (3,) simulation box dimensions. + + Returns: + np.ndarray: (3, 3) array of flipped/normalized axes. + """ + rr_axis = self.get_vector(UA[0].position, center_of_mass, dimensions) + + axis_norm = np.sqrt(np.sum(custom_axes**2, axis=1)) + custom_axes_flipped = custom_axes / axis_norm[:, np.newaxis] + + for i in range(3): + dot_prod = float(np.dot(custom_axes_flipped[i], rr_axis)) + if dot_prod < 0.0: + custom_axes_flipped[i] *= -1.0 + + return custom_axes_flipped + + def get_vector(self, a: np.ndarray, b: np.ndarray, dimensions: np.ndarray): + """Compute PBC-wrapped displacement vector(s). + + For vector of two coordinates over periodic boundary conditions (PBCs). + + Args: + a: (3,) or (N, 3) array of coordinates. + b: (3,) or (N, 3) array of coordinates. + dimensions: (3,) simulation box dimensions. + + Returns: + np.ndarray: Wrapped displacement vector(s) with broadcasted shape. + """ + delta = b - a + delta -= dimensions * np.round(delta / dimensions) + return delta + + def get_moment_of_inertia_tensor( + self, + center_of_mass: np.ndarray, + positions: np.ndarray, + masses: Sequence[float], + dimensions: np.ndarray, + ) -> np.ndarray: + """Compute a custom moment of inertia tensor. + + Calculate a custom moment of inertia tensor. + E.g., for cases where the mass list will contain masses of UAs rather than + individual atoms and the positions will be those for the UAs only + (excluding the H atoms coordinates). + + Args: + center_of_mass: (3,) chosen centre for the tensor. + positions: (N, 3) point positions. + masses: (N,) point masses corresponding to positions. + dimensions: (3,) simulation box dimensions. + + Returns: + np.ndarray: (3, 3) moment of inertia tensor. + """ + r = self.get_vector(center_of_mass, positions, dimensions) + r2 = np.sum(r**2, axis=1) + + masses_arr = np.asarray(list(masses), dtype=float) + moment_of_inertia_tensor = np.eye(3) * np.sum(masses_arr * r2) + moment_of_inertia_tensor -= np.einsum("i,ij,ik->jk", masses_arr, r, r) + + return moment_of_inertia_tensor + + def get_principal_axes_from_tensor( + self, + moment_of_inertia_tensor: np.ndarray, + degeneracy_rtol: float = 100 * np.finfo(np.float32).eps, + reference_vector: Sequence[float] = (1.0, 2.0, 3.0), + ) -> tuple[np.ndarray, np.ndarray]: + """Compute the principal axes and moments of a moment of inertia tensor. + + The eigenvectors of a symmetric tensor are only defined up to a sign, and, + for equal moments, up to a rotation within the degenerate eigenspace. The + axes are returned in a canonical form, so that a given tensor always + produces the same axes. The convention is: + + - Moments are sorted by descending absolute value. + - Within a degenerate eigenspace (moments equal to within + ``degeneracy_rtol`` of the largest), the basis is the eigenvectors of a + reference tensor built from ``reference_vector``, projected onto that + eigenspace. + - The first two axes are signed to have a positive projection onto + ``reference_vector``, and the third is their cross product. + + Args: + moment_of_inertia_tensor: (3, 3) symmetric inertia tensor. + degeneracy_rtol: Relative tolerance, with respect to the largest + moment, for treating moments as degenerate. The default is a + multiple of the float32 precision of the coordinates. + reference_vector: Fixed direction used to choose axis signs and the + basis within a degenerate eigenspace. Its components must be + distinct, so that no symmetric or axis-aligned direction is + perpendicular to it or ties on its components. + + Returns: + Tuple[np.ndarray, np.ndarray]: + - principal_axes: (3, 3) principal axes (rows). + - principal_moments: (3,) moments sorted by descending magnitude. + """ + principal_moments, eigenvectors = np.linalg.eigh(moment_of_inertia_tensor) + order = np.argsort(np.abs(principal_moments))[::-1] + principal_moments = principal_moments[order] + eigenvectors = eigenvectors[:, order] + + reference = np.asarray(reference_vector, dtype=float) + gaps = np.abs(np.diff(np.abs(principal_moments))) + boundaries = ( + np.flatnonzero(gaps > degeneracy_rtol * np.abs(principal_moments[0])) + 1 + ) + for subspace in np.split(np.arange(3), boundaries): + if len(subspace) > 1: + basis = eigenvectors[:, subspace] + _, rotation = np.linalg.eigh(basis.T @ np.diag(reference) @ basis) + eigenvectors[:, subspace] = basis @ rotation + + for axis in (0, 1): + if eigenvectors[:, axis] @ reference < 0: + eigenvectors[:, axis] *= -1 + + z_axis = np.cross(eigenvectors[:, 0], eigenvectors[:, 1]) + principal_axes = np.array([eigenvectors[:, 0], eigenvectors[:, 1], z_axis]) + return principal_axes, principal_moments + + def get_principal_axes_from_group(self, group) -> np.ndarray: + """Return the canonical principal axes (rows) of an atom group.""" + principal_axes, _ = self.get_principal_axes_from_tensor( + group.atoms.moment_of_inertia() + ) + return principal_axes + + def get_chain(self, residue, first, last): + """ + For a given MDAnalysis AtomGroup and two given heavy atoms + within that AtomGroup, return the + shortest path between the two atoms. + + Args: + residue: MDAnalysis AtomGroup representing + the residue/monomer of interest. + first: First heavy atom in the chain + last: Last heavy atom in the chain + + Returns: + chain: Array containing chain atoms. + """ + + chain = [] + # at the beggining we've only visited the first atom + visited_dict = {first: True} + # keep the previous atom to trace back the path + prev = {} + # queue of next heavy atoms to visit + next_to_visit = [first] + # all others heavy atoms in the residue, we have not yet visited + remaining_heavy_atoms = residue.atoms.select_atoms( + f"(mass 2 to 999) and not index {first.index}" + ) + for atom in remaining_heavy_atoms: + visited_dict[atom] = False + current = first + + while not visited_dict[last]: + # we haven't found a path to the last residue + next_to_visit.pop(0) + # we're visiting the current atom => we remove it from the queue + bonded_atoms = residue.atoms.select_atoms( + f"(mass 2 to 999) and bonded index {current.index}" + ) + + if last in bonded_atoms: + # we found a path to the last atom + visited_dict[last] = True + chain.append(last) + prev[last] = current + + else: + for bonded_atom in bonded_atoms: + # look for unvisited bonded atoms to the current atom we're visiting + if not visited_dict[bonded_atom]: + # we're going to want to visit the atoms + next_to_visit.append(bonded_atom) + prev[bonded_atom] = current + # we visit the next atom in the queue + current = next_to_visit[0] + visited_dict[current] = True + + # we track the previous atom back to the first atom now + current = last + chain = [last] + # subtract index of first atom in resid + # most likely will coincide with first + # but this will work even if it doesn't + # accout for in-residue index + # start from last atom in chain + while chain[-1] != first: + # we haven't yet returned to the first atom + current = prev[current] + chain.append(current) + + chain = np.flip(chain) + # only get in between residues + chain = chain[1:-1] + # accout for in-residue index + return chain From 730c1fc3fec1b373ca58438c184c7fe835bb0ce5 Mon Sep 17 00:00:00 2001 From: ioanaapapa Date: Mon, 19 Oct 2026 16:31:49 +0100 Subject: [PATCH 06/11] remove debugging print statements --- CodeEntropy/levels/axes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/CodeEntropy/levels/axes.py b/CodeEntropy/levels/axes.py index 4a3fec59..87d8832a 100644 --- a/CodeEntropy/levels/axes.py +++ b/CodeEntropy/levels/axes.py @@ -118,7 +118,6 @@ def get_residue_axes( index_prev = index + relative_index - 1 index_next = index + relative_index + 1 - print("THE CUSTOM RESIDUE AXES!!!") if residue is None: residue = data_container.select_atoms(f"resindex {index + relative_index}") @@ -247,7 +246,6 @@ def get_UA_axes(self, data_container, index: int, res_position): ValueError: If axis construction fails. """ - print("THE CUSTOM UA AXES!!!") index = int(index) # UA bead index heavy_atoms = data_container.select_atoms("mass 2 to 999") From 922b0583f63886e876ae5548145202e736781642 Mon Sep 17 00:00:00 2001 From: ioanaapapa Date: Tue, 20 Oct 2026 11:23:17 +0100 Subject: [PATCH 07/11] changed axes topology to be obtained when topology argument is used --- CodeEntropy/levels/nodes/axes_topology.py | 4 +-- CodeEntropy/levels/nodes/covariance.py | 33 ++++++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CodeEntropy/levels/nodes/axes_topology.py b/CodeEntropy/levels/nodes/axes_topology.py index 5197d752..a56dca1f 100644 --- a/CodeEntropy/levels/nodes/axes_topology.py +++ b/CodeEntropy/levels/nodes/axes_topology.py @@ -82,7 +82,7 @@ class BuildAxesTopologyNode: def run(self, shared_data: dict[str, Any]) -> dict[str, Any]: """Build cached axes topology and write it into shared data. - The cache is only populated when ``args.customised_axes`` is true. When + The cache is only populated when ``args.axes`` is equal to ``topology``. When customised axes are disabled, an empty cache is still written so later stages can read ``shared_data["axes_topology"]`` safely. @@ -97,7 +97,7 @@ def run(self, shared_data: dict[str, Any]) -> dict[str, Any]: args = shared_data["args"] topology = AxesTopology() - if not bool(getattr(args, "customised_axes", False)): + if str(getattr(args, "axes", "topology")): shared_data["axes_topology"] = topology return {"axes_topology": topology} diff --git a/CodeEntropy/levels/nodes/covariance.py b/CodeEntropy/levels/nodes/covariance.py index 20727d6f..da6589bf 100644 --- a/CodeEntropy/levels/nodes/covariance.py +++ b/CodeEntropy/levels/nodes/covariance.py @@ -472,7 +472,6 @@ def _build_ua_vectors( """ force_vecs: list[np.ndarray] = [] torque_vecs: list[np.ndarray] = [] - print(f"The axes are: {axes}") for ua_i, bead in enumerate(bead_groups): if res_position == -1: residue = residue_group.residues[0] @@ -484,6 +483,7 @@ def _build_ua_vectors( ua_topology = None if axes == "topology": ua_topology = axes_topology.ua.get((mol_id, local_res_i, ua_i)) + print(f"The ua topology is: {ua_topology}") if ua_topology is not None: trans_axes, rot_axes, center, moi = ( axes_manager.get_UA_axes_from_topology( @@ -493,6 +493,7 @@ def _build_ua_vectors( box=box, ) ) + print("We used the topology axes!") else: # custom local axes if no topology make_whole(residue_group) @@ -508,8 +509,7 @@ def _build_ua_vectors( residue_group, ua_i, res_position ) - else: - print("principal axes? :(") + elif axes == "principal": # principal axes make_whole(residue.atoms) make_whole(bead) @@ -640,17 +640,19 @@ def _get_residue_axes( Returns: A tuple of translation axes, rotation axes, centre, and moments of inertia. """ - if axes != "principal": + if axes == "topology" or axes == "local": res = mol.residues[local_res_i] + print(f"The axes topology is: {axes_topology}") residue_topology = None - if axes == "topology": + if axes == "topology" and axes_topology is not None: + # can use the cached axes topology residue_topology = axes_topology.residue.get((mol_id, local_res_i)) if residue_topology is not None: return axes_manager.get_residue_axes_from_topology( u=u, mol=mol, residue_atoms=res.atoms, topology=residue_topology ) - + # no topology or local axes argument return axes_manager.get_residue_axes( mol, local_res_i, relative_res_i, residue=res.atoms ) @@ -658,15 +660,16 @@ def _get_residue_axes( make_whole(mol.atoms) make_whole(bead) - trans_axes = axes_manager.get_principal_axes_from_group(mol.atoms) - rot_axes, moi = axes_manager.get_molecule_axes(bead) - center = bead.center_of_mass(unwrap=True) - return ( - np.asarray(trans_axes), - np.asarray(rot_axes), - np.asarray(center), - np.asarray(moi), - ) + if axes == "principal": + trans_axes = axes_manager.get_principal_axes_from_group(mol.atoms) + rot_axes, moi = axes_manager.get_molecule_axes(bead) + center = bead.center_of_mass(unwrap=True) + return ( + np.asarray(trans_axes), + np.asarray(rot_axes), + np.asarray(center), + np.asarray(moi), + ) def _get_polymer_axes( self, From f45c8cd2c0ec595e98410ed08c303758f648a71f Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Thu, 12 Nov 2026 09:30:42 +0000 Subject: [PATCH 08/11] fix(axes): build topology cache and validate axes option --- CodeEntropy/config/argparse.py | 12 ++++++++++++ CodeEntropy/levels/nodes/axes_topology.py | 2 +- CodeEntropy/levels/nodes/covariance.py | 8 +++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CodeEntropy/config/argparse.py b/CodeEntropy/config/argparse.py index 9265a6d0..781cdb98 100644 --- a/CodeEntropy/config/argparse.py +++ b/CodeEntropy/config/argparse.py @@ -514,6 +514,18 @@ def validate_inputs(self, u: Any, args: argparse.Namespace) -> None: self._check_input_temperature(args) self._check_input_force_partitioning(args) self._check_parallel_frame_options(args) + self._check_input_axes(args) + + @staticmethod + def _check_input_axes(args: argparse.Namespace) -> None: + """Check that the axes option is one of the supported values.""" + valid = ("principal", "topology", "local") + axes = str(args.axes).strip().lower() + if axes not in valid: + raise ValueError( + f"Invalid 'axes': {args.axes!r}. Must be one of {', '.join(valid)}." + ) + args.axes = axes @staticmethod def _check_input_start(u: Any, args: argparse.Namespace) -> None: diff --git a/CodeEntropy/levels/nodes/axes_topology.py b/CodeEntropy/levels/nodes/axes_topology.py index a56dca1f..63acfe79 100644 --- a/CodeEntropy/levels/nodes/axes_topology.py +++ b/CodeEntropy/levels/nodes/axes_topology.py @@ -97,7 +97,7 @@ def run(self, shared_data: dict[str, Any]) -> dict[str, Any]: args = shared_data["args"] topology = AxesTopology() - if str(getattr(args, "axes", "topology")): + if args.axes != "topology": shared_data["axes_topology"] = topology return {"axes_topology": topology} diff --git a/CodeEntropy/levels/nodes/covariance.py b/CodeEntropy/levels/nodes/covariance.py index da6589bf..4dabca10 100644 --- a/CodeEntropy/levels/nodes/covariance.py +++ b/CodeEntropy/levels/nodes/covariance.py @@ -83,7 +83,7 @@ def run(self, ctx: FrameCtx) -> dict[str, Any]: fp = float(args.force_partitioning) combined = bool(getattr(args, "combined_forcetorque", False)) - axes = str(getattr(args, "axes", False)) + axes = args.axes box = self._try_get_box(u) fragments = u.atoms.fragments @@ -517,6 +517,9 @@ def _build_ua_vectors( rot_axes, moi = axes_manager.get_molecule_axes(bead) center = bead.center_of_mass(unwrap=True) + else: + raise ValueError(f"Unknown axes option: {axes!r}") + force_vecs.append( self._ft.get_weighted_forces( bead=bead, @@ -657,6 +660,9 @@ def _get_residue_axes( mol, local_res_i, relative_res_i, residue=res.atoms ) + if axes != "principal": + raise ValueError(f"Unknown axes option: {axes!r}") + make_whole(mol.atoms) make_whole(bead) From 3066ccdbf7c7afe751fde928bc1483f05e564f79 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Thu, 12 Nov 2026 09:58:26 +0000 Subject: [PATCH 09/11] test(axes): update tests and configs for string axes option --- docs/source/getting_started.rst | 12 +- .../configs/benzaldehyde/axes_off.yaml | 2 +- .../regression/configs/benzene/axes_off.yaml | 2 +- .../configs/cyclohexane/axes_off.yaml | 2 +- tests/regression/configs/dna/axes_off.yaml | 2 +- .../configs/ethyl-acetate/axes_off.yaml | 2 +- .../regression/configs/methane/axes_off.yaml | 2 +- .../regression/configs/methanol/axes_off.yaml | 2 +- .../regression/configs/octonol/axes_off.yaml | 2 +- tests/regression/configs/water/axes_off.yaml | 2 +- .../CodeEntropy/config/argparse/conftest.py | 1 + .../argparse/test_argparse_validate_inputs.py | 28 ++++ .../levels/nodes/test_axes_topology.py | 25 ++- .../levels/nodes/test_covariance_node.py | 144 +++++++++++++++--- 14 files changed, 183 insertions(+), 45 deletions(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 609bae07..f601cec3 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -212,10 +212,14 @@ The ``top_traj_file`` argument is required; other arguments have default values. 2019 paper. - ``True`` - ``bool`` - * - ``--customised_axes`` - - Use custom bonded axes to get COM, MOI and PA that match the 2019 paper. - - ``True`` - - ``bool`` + * - ``--axes`` + - Axes used for residue and united-atom rotations. One of ``principal`` + (principal axes of the residue/UA), ``topology`` (bonded axes using cached + topology indices, matching the 2019 paper) or ``local`` (local internal + coordinate-derived axes for residues and UA translation, bonded axes for UA + rotation). + - ``local`` + - ``str`` * - ``--search_type`` - Method for finding neighbouring molecules. - ``RAD`` diff --git a/tests/regression/configs/benzaldehyde/axes_off.yaml b/tests/regression/configs/benzaldehyde/axes_off.yaml index a733dda0..26eb4ed8 100644 --- a/tests/regression/configs/benzaldehyde/axes_off.yaml +++ b/tests/regression/configs/benzaldehyde/axes_off.yaml @@ -12,4 +12,4 @@ run1: file_format: "MDCRD" kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/regression/configs/benzene/axes_off.yaml b/tests/regression/configs/benzene/axes_off.yaml index 301bc403..267b98eb 100644 --- a/tests/regression/configs/benzene/axes_off.yaml +++ b/tests/regression/configs/benzene/axes_off.yaml @@ -12,4 +12,4 @@ run1: file_format: "MDCRD" kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/regression/configs/cyclohexane/axes_off.yaml b/tests/regression/configs/cyclohexane/axes_off.yaml index de339292..c071bc05 100644 --- a/tests/regression/configs/cyclohexane/axes_off.yaml +++ b/tests/regression/configs/cyclohexane/axes_off.yaml @@ -12,4 +12,4 @@ run1: file_format: "MDCRD" kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/regression/configs/dna/axes_off.yaml b/tests/regression/configs/dna/axes_off.yaml index 4f5de407..9c6e17bc 100644 --- a/tests/regression/configs/dna/axes_off.yaml +++ b/tests/regression/configs/dna/axes_off.yaml @@ -8,4 +8,4 @@ run1: start: 0 end: 5 step: 2 - customised_axes: false + axes: principal diff --git a/tests/regression/configs/ethyl-acetate/axes_off.yaml b/tests/regression/configs/ethyl-acetate/axes_off.yaml index 6ffdad39..55105322 100644 --- a/tests/regression/configs/ethyl-acetate/axes_off.yaml +++ b/tests/regression/configs/ethyl-acetate/axes_off.yaml @@ -12,4 +12,4 @@ run1: file_format: "MDCRD" kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/regression/configs/methane/axes_off.yaml b/tests/regression/configs/methane/axes_off.yaml index 26c36569..b76f35be 100644 --- a/tests/regression/configs/methane/axes_off.yaml +++ b/tests/regression/configs/methane/axes_off.yaml @@ -13,4 +13,4 @@ run1: temperature: 112.0 kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/regression/configs/methanol/axes_off.yaml b/tests/regression/configs/methanol/axes_off.yaml index 50124731..47483633 100644 --- a/tests/regression/configs/methanol/axes_off.yaml +++ b/tests/regression/configs/methanol/axes_off.yaml @@ -12,4 +12,4 @@ run1: file_format: "MDCRD" kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/regression/configs/octonol/axes_off.yaml b/tests/regression/configs/octonol/axes_off.yaml index 361d3619..6b636e32 100644 --- a/tests/regression/configs/octonol/axes_off.yaml +++ b/tests/regression/configs/octonol/axes_off.yaml @@ -12,4 +12,4 @@ run1: file_format: "MDCRD" kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/regression/configs/water/axes_off.yaml b/tests/regression/configs/water/axes_off.yaml index 0cb2482d..b859d27a 100644 --- a/tests/regression/configs/water/axes_off.yaml +++ b/tests/regression/configs/water/axes_off.yaml @@ -12,4 +12,4 @@ run1: file_format: "MDCRD" kcal_force_units: True search_type: "grid" - customised_axes: false + axes: principal diff --git a/tests/unit/CodeEntropy/config/argparse/conftest.py b/tests/unit/CodeEntropy/config/argparse/conftest.py index adcabf07..0c3f8b59 100644 --- a/tests/unit/CodeEntropy/config/argparse/conftest.py +++ b/tests/unit/CodeEntropy/config/argparse/conftest.py @@ -35,6 +35,7 @@ def _make(**overrides): bin_width=30, temperature=298.0, force_partitioning=0.5, + axes="local", ) base.update(overrides) # validation functions only require attribute access; SimpleNamespace is ideal diff --git a/tests/unit/CodeEntropy/config/argparse/test_argparse_validate_inputs.py b/tests/unit/CodeEntropy/config/argparse/test_argparse_validate_inputs.py index 73ca005d..6fe60d63 100644 --- a/tests/unit/CodeEntropy/config/argparse/test_argparse_validate_inputs.py +++ b/tests/unit/CodeEntropy/config/argparse/test_argparse_validate_inputs.py @@ -273,3 +273,31 @@ def test_check_parallel_frame_options_raises_when_conda_exec_missing( match="'conda_exec' must be provided when using HPC Dask.", ): resolver._check_parallel_frame_options(args) + + +@pytest.mark.parametrize( + ("value", "expected"), + [ + ("principal", "principal"), + ("topology", "topology"), + ("local", "local"), + ("Topology", "topology"), + (" LOCAL ", "local"), + ], +) +def test_check_input_axes_accepts_and_normalises_valid_values( + resolver, make_args, value, expected +): + args = make_args(axes=value) + + resolver._check_input_axes(args) + + assert args.axes == expected + + +@pytest.mark.parametrize("value", ["topolgy", "", True, None]) +def test_check_input_axes_raises_for_invalid_values(resolver, make_args, value): + args = make_args(axes=value) + + with pytest.raises(ValueError, match="Invalid 'axes'"): + resolver._check_input_axes(args) diff --git a/tests/unit/CodeEntropy/levels/nodes/test_axes_topology.py b/tests/unit/CodeEntropy/levels/nodes/test_axes_topology.py index 2c319985..5f8bd86f 100644 --- a/tests/unit/CodeEntropy/levels/nodes/test_axes_topology.py +++ b/tests/unit/CodeEntropy/levels/nodes/test_axes_topology.py @@ -95,8 +95,8 @@ def __init__(self, fragments, atom_map): self.atoms = FakeAtoms(fragments=fragments, atom_map=atom_map) -def _args(*, customised_axes): - return SimpleNamespace(customised_axes=customised_axes) +def _args(*, axes): + return SimpleNamespace(axes=axes) def _single_molecule_universe(): @@ -164,9 +164,9 @@ def test_axes_topology_defaults_to_empty_mappings(): assert topology.residue == {} -def test_run_writes_empty_topology_when_customised_axes_disabled(): +def test_run_writes_empty_topology_when_axes_is_principal(): node = BuildAxesTopologyNode() - shared_data = {"args": _args(customised_axes=False)} + shared_data = {"args": _args(axes="principal")} result = node.run(shared_data) @@ -184,7 +184,7 @@ def test_run_builds_residue_topology_for_residue_levels(): neighbor_query = "(resindex -1 or resindex 1) and bonded resid 0" molecule._select_map[neighbor_query] = FakeAtomGroup([bonded_heavy]) shared_data = { - "args": _args(customised_axes=True), + "args": _args(axes="topology"), "reduced_universe": universe, "levels": [["residue"]], "beads": {(0, "residue"): [np.array([1, 2, 3, 4])]}, @@ -244,7 +244,7 @@ def test_run_builds_ua_topology_for_united_atom_levels(): _single_molecule_universe() ) shared_data = { - "args": _args(customised_axes=True), + "args": _args(axes="topology"), "reduced_universe": universe, "levels": [["united_atom"]], "beads": {(0, "united_atom", 0): [np.array([1, 2])]}, @@ -276,7 +276,7 @@ def test_run_ignores_molecules_without_united_atom_level(): node = BuildAxesTopologyNode() universe, _, _, _, _, _ = _single_molecule_universe() shared_data = { - "args": _args(customised_axes=True), + "args": _args(axes="topology"), "reduced_universe": universe, "levels": [["residue"]], "beads": {(0, "united_atom", 0): [np.array([1, 2])]}, @@ -413,3 +413,14 @@ def test_get_ua_masses_from_topology_returns_empty_list_for_light_atoms_only(): masses = BuildAxesTopologyNode._get_ua_masses_from_topology(atom_group) assert masses == [] + + +def test_run_writes_empty_topology_when_axes_is_local(): + node = BuildAxesTopologyNode() + shared_data = {"args": _args(axes="local")} + + result = node.run(shared_data) + + assert result["axes_topology"].ua == {} + assert result["axes_topology"].residue == {} + assert shared_data["axes_topology"] is result["axes_topology"] diff --git a/tests/unit/CodeEntropy/levels/nodes/test_covariance_node.py b/tests/unit/CodeEntropy/levels/nodes/test_covariance_node.py index ff02facd..302b0e79 100644 --- a/tests/unit/CodeEntropy/levels/nodes/test_covariance_node.py +++ b/tests/unit/CodeEntropy/levels/nodes/test_covariance_node.py @@ -74,12 +74,12 @@ def _args( *, force_partitioning=0.5, combined_forcetorque=False, - customised_axes=False, + axes="principal", ): return SimpleNamespace( force_partitioning=force_partitioning, combined_forcetorque=combined_forcetorque, - customised_axes=customised_axes, + axes=axes, ) @@ -100,7 +100,7 @@ def test_run_processes_all_levels_and_writes_frame_covariance(): "groups": {7: [0]}, "levels": [["united_atom", "residue", "polymer"]], "beads": {}, - "args": _args(combined_forcetorque=True, customised_axes=True), + "args": _args(combined_forcetorque=True, axes="topology"), "axes_manager": axes_manager, "axes_topology": axes_topology, } @@ -123,7 +123,7 @@ def test_run_processes_all_levels_and_writes_frame_covariance(): assert ua_kwargs["axes_manager"] is axes_manager assert ua_kwargs["axes_topology"] is axes_topology assert ua_kwargs["force_partitioning"] == 0.5 - assert ua_kwargs["customised_axes"] is True + assert ua_kwargs["axes"] == "topology" assert ua_kwargs["is_highest"] is False res_kwargs = node._process_residue.call_args.kwargs @@ -178,7 +178,7 @@ def test_process_united_atom_updates_outputs_and_molcount(): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=False, + axes="principal", is_highest=True, out_force=out_force, out_torque=out_torque, @@ -206,7 +206,7 @@ def test_process_united_atom_returns_when_no_beads_or_empty_atom_groups(): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=False, + axes="principal", is_highest=True, out_force=out_force, out_torque=out_torque, @@ -228,7 +228,7 @@ def test_process_united_atom_returns_when_no_beads_or_empty_atom_groups(): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=False, + axes="principal", is_highest=True, out_force=out_force, out_torque=out_torque, @@ -264,7 +264,7 @@ def test_process_residue_updates_outputs_and_combined_ft(): axes_manager="axes", axes_topology=None, box=None, - customised_axes=True, + axes="local", force_partitioning=0.5, is_highest=True, out_force=out_force, @@ -294,7 +294,7 @@ def test_process_residue_returns_when_no_beads_or_empty_groups(): axes_manager=None, axes_topology=None, box=None, - customised_axes=False, + axes="principal", force_partitioning=0.5, is_highest=True, out_force=out_force, @@ -316,7 +316,7 @@ def test_process_residue_returns_when_no_beads_or_empty_groups(): axes_manager=None, axes_topology=None, box=None, - customised_axes=False, + axes="principal", force_partitioning=0.5, is_highest=True, out_force=out_force, @@ -417,7 +417,7 @@ def test_process_polymer_returns_when_no_beads_or_empty_groups(): assert out_force["poly"] == {} -def test_build_ua_vectors_uses_customised_axes(): +def test_build_ua_vectors_uses_local_axes(): node = FrameCovarianceNode() axes_manager = MagicMock() axes_manager.get_UA_axes.return_value = ( @@ -440,7 +440,7 @@ def test_build_ua_vectors_uses_customised_axes(): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=True, + axes="local", is_highest=True, res_position=None, ) @@ -477,7 +477,7 @@ def test_build_ua_vectors_uses_cached_axes_topology_when_available(): axes_topology=axes_topology, box=None, force_partitioning=0.5, - customised_axes=True, + axes="topology", is_highest=True, res_position=None, ) @@ -494,7 +494,7 @@ def test_build_ua_vectors_uses_cached_axes_topology_when_available(): axes_manager.get_UA_axes.assert_not_called() -def test_build_ua_vectors_uses_molecule_axes_when_not_customised(): +def test_build_ua_vectors_uses_principal_axes(): node = FrameCovarianceNode() axes_manager = MagicMock() axes_manager.get_molecule_axes.return_value = ( @@ -516,7 +516,7 @@ def test_build_ua_vectors_uses_molecule_axes_when_not_customised(): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=False, + axes="principal", is_highest=False, res_position=None, ) @@ -545,7 +545,7 @@ def test_build_residue_vectors_uses_residue_axes(): axes_manager=axes_manager, axes_topology=None, box=None, - customised_axes=True, + axes="local", force_partitioning=0.5, is_highest=True, ) @@ -555,7 +555,7 @@ def test_build_residue_vectors_uses_residue_axes(): node._get_residue_axes.assert_called_once() -def test_get_residue_axes_customised_uses_cached_topology_when_available(): +def test_get_residue_axes_topology_uses_cached_topology_when_available(): node = FrameCovarianceNode() mol = FakeMolecule(n_residues=1) axes_manager = MagicMock() @@ -573,7 +573,7 @@ def test_get_residue_axes_customised_uses_cached_topology_when_available(): relative_res_i=0, axes_manager=axes_manager, axes_topology=axes_topology, - customised_axes=True, + axes="topology", ) assert result == expected @@ -583,7 +583,7 @@ def test_get_residue_axes_customised_uses_cached_topology_when_available(): axes_manager.get_residue_axes.assert_not_called() -def test_get_residue_axes_customised_delegates_to_axes_manager(): +def test_get_residue_axes_local_delegates_to_axes_manager(): node = FrameCovarianceNode() mol = FakeMolecule(n_residues=1) axes_manager = MagicMock() @@ -600,7 +600,7 @@ def test_get_residue_axes_customised_delegates_to_axes_manager(): relative_res_i=0, axes_manager=axes_manager, axes_topology=None, - customised_axes=True, + axes="local", ) == expected ) @@ -613,7 +613,7 @@ def test_get_residue_axes_customised_delegates_to_axes_manager(): ) -def test_get_residue_axes_molecule_uses_make_whole_and_molecule_axes(): +def test_get_residue_axes_principal_uses_make_whole_and_molecule_axes(): node = FrameCovarianceNode() mol = FakeMolecule(n_residues=1) bead = FakeAtomGroup("res") @@ -634,7 +634,7 @@ def test_get_residue_axes_molecule_uses_make_whole_and_molecule_axes(): relative_res_i=0, axes_manager=axes_manager, axes_topology=None, - customised_axes=False, + axes="principal", ) assert make_whole.call_count == 2 @@ -752,7 +752,7 @@ def _select_atoms(q): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=False, + axes="principal", is_highest=True, out_force=out_force, out_torque=out_torque, @@ -784,7 +784,7 @@ def test_build_ua_vectors_multiple_residues_first_residue(): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=True, + axes="local", is_highest=True, res_position=-1, ) @@ -816,10 +816,104 @@ def test_build_ua_vectors_multiple_residues_middle_residue(): axes_topology=None, box=None, force_partitioning=0.5, - customised_axes=True, + axes="local", is_highest=True, res_position=0, ) assert make_whole.call_count == 2 axes_manager.get_UA_axes.assert_called_once() + + +def test_build_ua_vectors_topology_falls_back_to_local_when_key_missing(): + node = FrameCovarianceNode() + axes_manager = MagicMock() + axes_manager.get_UA_axes.return_value = ( + np.eye(3), + 2.0 * np.eye(3), + np.ones(3), + np.array([1.0, 2.0, 3.0]), + ) + node._ft.get_weighted_forces = MagicMock(return_value=np.array([1.0, 0.0, 0.0])) + node._ft.get_weighted_torques = MagicMock(return_value=np.array([0.0, 1.0, 0.0])) + + with patch("CodeEntropy.levels.nodes.covariance.make_whole"): + node._build_ua_vectors( + u=FakeUniverse([]), + mol_id=0, + local_res_i=0, + bead_groups=[FakeAtomGroup("ua")], + residue_group=FakeAtomGroup("res"), + axes_manager=axes_manager, + axes_topology=SimpleNamespace(ua={}), + box=None, + force_partitioning=0.5, + axes="topology", + is_highest=True, + res_position=None, + ) + + axes_manager.get_UA_axes.assert_called_once() + axes_manager.get_UA_axes_from_topology.assert_not_called() + + +def test_build_ua_vectors_raises_for_unknown_axes(): + node = FrameCovarianceNode() + + with pytest.raises(ValueError, match="Unknown axes option"): + node._build_ua_vectors( + u=FakeUniverse([]), + mol_id=0, + local_res_i=0, + bead_groups=[FakeAtomGroup("ua")], + residue_group=FakeAtomGroup("res"), + axes_manager=MagicMock(), + axes_topology=None, + box=None, + force_partitioning=0.5, + axes="bogus", + is_highest=True, + res_position=None, + ) + + +def test_get_residue_axes_local_ignores_cached_topology(): + node = FrameCovarianceNode() + mol = FakeMolecule(n_residues=1) + axes_manager = MagicMock() + expected = (np.eye(3), np.eye(3), np.zeros(3), np.ones(3)) + axes_manager.get_residue_axes.return_value = expected + axes_topology = SimpleNamespace(residue={(0, 0): object()}) + + result = node._get_residue_axes( + u=FakeUniverse([mol]), + mol=mol, + mol_id=0, + bead=FakeAtomGroup("res"), + local_res_i=0, + relative_res_i=0, + axes_manager=axes_manager, + axes_topology=axes_topology, + axes="local", + ) + + assert result == expected + axes_manager.get_residue_axes_from_topology.assert_not_called() + + +def test_get_residue_axes_raises_for_unknown_axes(): + node = FrameCovarianceNode() + mol = FakeMolecule(n_residues=1) + + with pytest.raises(ValueError, match="Unknown axes option"): + node._get_residue_axes( + u=FakeUniverse([mol]), + mol=mol, + mol_id=0, + bead=FakeAtomGroup("res"), + local_res_i=0, + relative_res_i=0, + axes_manager=MagicMock(), + axes_topology=None, + axes="bogus", + ) From fa60f690f3d964876606122e3e6aceb8be576996 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Thu, 12 Nov 2026 15:42:39 +0000 Subject: [PATCH 10/11] fix(axes): pass AtomGroup for single-residue molecules in UA covariance --- CodeEntropy/levels/nodes/covariance.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CodeEntropy/levels/nodes/covariance.py b/CodeEntropy/levels/nodes/covariance.py index 4dabca10..8e203b56 100644 --- a/CodeEntropy/levels/nodes/covariance.py +++ b/CodeEntropy/levels/nodes/covariance.py @@ -237,7 +237,7 @@ def _process_united_atom( else: res_position = None - residue_group = res + residue_group = res.atoms bead_key = (mol_id, "united_atom", local_res_i) bead_idx_list = beads.get(bead_key, []) if not bead_idx_list: @@ -483,7 +483,6 @@ def _build_ua_vectors( ua_topology = None if axes == "topology": ua_topology = axes_topology.ua.get((mol_id, local_res_i, ua_i)) - print(f"The ua topology is: {ua_topology}") if ua_topology is not None: trans_axes, rot_axes, center, moi = ( axes_manager.get_UA_axes_from_topology( @@ -493,7 +492,6 @@ def _build_ua_vectors( box=box, ) ) - print("We used the topology axes!") else: # custom local axes if no topology make_whole(residue_group) @@ -645,7 +643,6 @@ def _get_residue_axes( """ if axes == "topology" or axes == "local": res = mol.residues[local_res_i] - print(f"The axes topology is: {axes_topology}") residue_topology = None if axes == "topology" and axes_topology is not None: # can use the cached axes topology From 36a4380c33233a044a56711e269b07c80c146b90 Mon Sep 17 00:00:00 2001 From: Ioana Papa Date: Thu, 12 Nov 2026 16:31:06 +0000 Subject: [PATCH 11/11] updated regression baselines for dna --- .../baselines/benzaldehyde/axes_off.json | 10 ++-- .../combined_forcetorque_false.json | 8 +-- .../baselines/benzaldehyde/default.json | 8 +-- .../baselines/benzaldehyde/frame_window.json | 8 +-- .../baselines/benzaldehyde/grouping_each.json | 16 ++--- .../baselines/benzaldehyde/rad.json | 8 +-- .../benzaldehyde/selection_subset.json | 10 ++-- .../baselines/benzene/axes_off.json | 6 +- .../benzene/combined_forcetorque_off.json | 10 ++-- .../regression/baselines/benzene/default.json | 8 +-- .../baselines/benzene/frame_window.json | 8 +-- .../baselines/benzene/grouping_each.json | 32 +++++----- tests/regression/baselines/benzene/rad.json | 8 +-- .../baselines/benzene/selection_subset.json | 10 ++-- .../baselines/cyclohexane/axes_off.json | 8 +-- .../cyclohexane/combined_forcetorque_off.json | 8 +-- .../baselines/cyclohexane/default.json | 4 +- .../baselines/cyclohexane/frame_window.json | 8 +-- .../baselines/cyclohexane/grouping_each.json | 22 +++---- .../regression/baselines/cyclohexane/rad.json | 4 +- .../cyclohexane/selection_subset.json | 10 ++-- tests/regression/baselines/dna/axes_off.json | 12 ++-- .../dna/combined_forcetorque_off.json | 16 ++--- tests/regression/baselines/dna/default.json | 10 ++-- .../baselines/dna/frame_window.json | 14 ++--- .../baselines/dna/grouping_each.json | 10 ++-- .../baselines/dna/selection_subset.json | 10 ++-- .../baselines/ethyl-acetate/axes_off.json | 8 +-- .../combined_forcetorque_off.json | 8 +-- .../baselines/ethyl-acetate/default.json | 8 +-- .../baselines/ethyl-acetate/frame_window.json | 6 +- .../ethyl-acetate/grouping_each.json | 28 ++++----- .../baselines/ethyl-acetate/rad.json | 8 +-- .../ethyl-acetate/selection_subset.json | 8 +-- .../baselines/methane/axes_off.json | 4 +- .../methane/combined_forcetorque_off.json | 6 +- .../regression/baselines/methane/default.json | 6 +- .../baselines/methane/frame_window.json | 6 +- .../baselines/methane/grouping_each.json | 58 +++++++++---------- tests/regression/baselines/methane/rad.json | 6 +- .../baselines/methane/selection_subset.json | 6 +- .../baselines/methanol/axes_off.json | 6 +- .../methanol/combined_forcetorque_off.json | 4 +- .../baselines/methanol/default.json | 6 +- .../baselines/methanol/frame_window.json | 2 +- .../baselines/methanol/grouping_each.json | 32 +++++----- tests/regression/baselines/methanol/rad.json | 6 +- .../baselines/methanol/selection_subset.json | 2 +- .../baselines/octonol/axes_off.json | 4 +- .../octonol/combined_forcetorque_off.json | 6 +- .../regression/baselines/octonol/default.json | 6 +- .../baselines/octonol/frame_window.json | 6 +- .../baselines/octonol/grouping_each.json | 34 +++++------ tests/regression/baselines/octonol/rad.json | 6 +- .../baselines/octonol/selection_subset.json | 8 +-- .../water/combined_forcetorque_off.json | 4 +- tests/regression/baselines/water/default.json | 4 +- .../baselines/water/frame_window.json | 4 +- .../baselines/water/grouping_each.json | 56 +++++++++--------- tests/regression/baselines/water/rad.json | 6 +- .../baselines/water/selection_subset.json | 4 +- .../regression/baselines/water/water_off.json | 4 +- 62 files changed, 331 insertions(+), 331 deletions(-) diff --git a/tests/regression/baselines/benzaldehyde/axes_off.json b/tests/regression/baselines/benzaldehyde/axes_off.json index eb7825b7..a1966c29 100644 --- a/tests/regression/baselines/benzaldehyde/axes_off.json +++ b/tests/regression/baselines/benzaldehyde/axes_off.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.06950663196232491, - "united_atom:Rovibrational": 35.19655714759134, - "residue:FTmat-Transvibrational": 86.64136384477892, - "residue:FTmat-Rovibrational": 62.24303760058521, + "united_atom:Transvibrational": 0.06950663196232494, + "united_atom:Rovibrational": 35.19655714759137, + "residue:FTmat-Transvibrational": 86.64136384477902, + "residue:FTmat-Rovibrational": 62.24303760058522, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 20.481571492615355 }, - "total": 204.63203671753317 + "total": 204.63203671753328 } } } diff --git a/tests/regression/baselines/benzaldehyde/combined_forcetorque_false.json b/tests/regression/baselines/benzaldehyde/combined_forcetorque_false.json index 0a348984..52ed55eb 100644 --- a/tests/regression/baselines/benzaldehyde/combined_forcetorque_false.json +++ b/tests/regression/baselines/benzaldehyde/combined_forcetorque_false.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.06817494136874551, - "united_atom:Rovibrational": 49.686697381523466, - "residue:Transvibrational": 69.24977659775257, + "united_atom:Transvibrational": 0.06950663196232494, + "united_atom:Rovibrational": 49.686697381523565, + "residue:Transvibrational": 69.24977659775254, "residue:Rovibrational": 69.73922011617867, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 20.481571492615355 }, - "total": 209.22544052943883 + "total": 209.22677222003247 } } } diff --git a/tests/regression/baselines/benzaldehyde/default.json b/tests/regression/baselines/benzaldehyde/default.json index b422b1a0..0f2e3cb7 100644 --- a/tests/regression/baselines/benzaldehyde/default.json +++ b/tests/regression/baselines/benzaldehyde/default.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 24.921822103314035, - "united_atom:Rovibrational": 27.950376507672594, - "residue:FTmat-Transvibrational": 71.231562004914, + "united_atom:Transvibrational": 24.94016991205995, + "united_atom:Rovibrational": 27.950376507672583, + "residue:FTmat-Transvibrational": 71.23156200491398, "residue:FTmat-Rovibrational": 60.43602521189648, "united_atom:Conformational": 7.522643899702263, "residue:Conformational": 0.0, "residue:Orientational": 59.43920971558428 }, - "total": 251.50163944308366 + "total": 251.51998725182955 } } } diff --git a/tests/regression/baselines/benzaldehyde/frame_window.json b/tests/regression/baselines/benzaldehyde/frame_window.json index 89afecfa..e60c1648 100644 --- a/tests/regression/baselines/benzaldehyde/frame_window.json +++ b/tests/regression/baselines/benzaldehyde/frame_window.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 37.90368186636453, - "united_atom:Rovibrational": 38.219068584436165, + "united_atom:Transvibrational": 37.96944566359015, + "united_atom:Rovibrational": 38.21906858443617, "residue:FTmat-Transvibrational": 74.05827280885852, - "residue:FTmat-Rovibrational": 58.53451127009362, + "residue:FTmat-Rovibrational": 58.5345112700936, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 20.481571492615355 }, - "total": 229.1971060223682 + "total": 229.26286981959382 } } } diff --git a/tests/regression/baselines/benzaldehyde/grouping_each.json b/tests/regression/baselines/benzaldehyde/grouping_each.json index ce584d8d..b586b427 100644 --- a/tests/regression/baselines/benzaldehyde/grouping_each.json +++ b/tests/regression/baselines/benzaldehyde/grouping_each.json @@ -27,14 +27,14 @@ "2": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.0022147884278620493, - "residue:FTmat-Transvibrational": 17.7650968672498, + "united_atom:Rovibrational": 0.002214788427862049, + "residue:FTmat-Transvibrational": 17.765096867249817, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 31.909265242174982 }, - "total": 49.67657689785264 + "total": 49.67657689785266 }, "3": { "components": { @@ -63,7 +63,7 @@ "5": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.010824819910336868, + "united_atom:Rovibrational": 0.01082481991033685, "residue:FTmat-Transvibrational": 11.176470961462535, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, @@ -76,25 +76,25 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.00018982532508837537, - "residue:FTmat-Transvibrational": 19.83851614381679, + "residue:FTmat-Transvibrational": 19.838516143816783, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 19.838705969141877 + "total": 19.83870596914187 }, "7": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.004033941970593011, - "residue:FTmat-Transvibrational": 19.06667852893644, + "residue:FTmat-Transvibrational": 19.066678528936453, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 19.070712470907033 + "total": 19.070712470907047 }, "8": { "components": { diff --git a/tests/regression/baselines/benzaldehyde/rad.json b/tests/regression/baselines/benzaldehyde/rad.json index c90914d9..d3c7f464 100644 --- a/tests/regression/baselines/benzaldehyde/rad.json +++ b/tests/regression/baselines/benzaldehyde/rad.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 24.921822103314035, - "united_atom:Rovibrational": 27.950376507672594, - "residue:FTmat-Transvibrational": 71.231562004914, + "united_atom:Transvibrational": 24.94016991205995, + "united_atom:Rovibrational": 27.950376507672583, + "residue:FTmat-Transvibrational": 71.23156200491398, "residue:FTmat-Rovibrational": 60.43602521189648, "united_atom:Conformational": 7.522643899702263, "residue:Conformational": 0.0, "residue:Orientational": 25.502722133228936 }, - "total": 217.56515186072832 + "total": 217.5834996694742 } } } diff --git a/tests/regression/baselines/benzaldehyde/selection_subset.json b/tests/regression/baselines/benzaldehyde/selection_subset.json index e3c767bb..e291ab52 100644 --- a/tests/regression/baselines/benzaldehyde/selection_subset.json +++ b/tests/regression/baselines/benzaldehyde/selection_subset.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.06817494136874551, - "united_atom:Rovibrational": 49.686697381523466, - "residue:FTmat-Transvibrational": 86.6413638447789, - "residue:FTmat-Rovibrational": 62.24303760058523, + "united_atom:Transvibrational": 0.06950663196232494, + "united_atom:Rovibrational": 49.686697381523565, + "residue:FTmat-Transvibrational": 86.64136384477902, + "residue:FTmat-Rovibrational": 62.24303760058522, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 20.481571492615355 }, - "total": 219.1208452608717 + "total": 219.1221769514655 } } } diff --git a/tests/regression/baselines/benzene/axes_off.json b/tests/regression/baselines/benzene/axes_off.json index b3d13ea7..8a64d32a 100644 --- a/tests/regression/baselines/benzene/axes_off.json +++ b/tests/regression/baselines/benzene/axes_off.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.17072733303436652, + "united_atom:Transvibrational": 0.17072733303436555, "united_atom:Rovibrational": 38.707686995757996, - "residue:FTmat-Transvibrational": 78.01138885368485, + "residue:FTmat-Transvibrational": 78.01138885368499, "residue:FTmat-Rovibrational": 47.127627321610596, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 164.0174305040878 + "total": 164.01743050408794 } } } diff --git a/tests/regression/baselines/benzene/combined_forcetorque_off.json b/tests/regression/baselines/benzene/combined_forcetorque_off.json index ddfc45b8..423041b3 100644 --- a/tests/regression/baselines/benzene/combined_forcetorque_off.json +++ b/tests/regression/baselines/benzene/combined_forcetorque_off.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.20056759662549248, - "united_atom:Rovibrational": 40.69581240789943, - "residue:Transvibrational": 60.73823316940173, - "residue:Rovibrational": 54.35470538676784, + "united_atom:Transvibrational": 0.17072733303436555, + "united_atom:Rovibrational": 40.6958124078994, + "residue:Transvibrational": 60.73823316940174, + "residue:Rovibrational": 54.35470538676782, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 155.9893185606945 + "total": 155.95947829710332 } } } diff --git a/tests/regression/baselines/benzene/default.json b/tests/regression/baselines/benzene/default.json index 19e98c33..f17f434f 100644 --- a/tests/regression/baselines/benzene/default.json +++ b/tests/regression/baselines/benzene/default.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 9.070682016770112, + "united_atom:Transvibrational": 9.040990618107475, "united_atom:Rovibrational": 27.534380126250213, - "residue:FTmat-Transvibrational": 73.34909170672572, - "residue:FTmat-Rovibrational": 61.127301914885564, + "residue:FTmat-Transvibrational": 73.34909170672569, + "residue:FTmat-Rovibrational": 61.12730191488555, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 41.58427729275938 }, - "total": 212.66573305739098 + "total": 212.6360416587283 } } } diff --git a/tests/regression/baselines/benzene/frame_window.json b/tests/regression/baselines/benzene/frame_window.json index 698a7e92..bd4ba3ed 100644 --- a/tests/regression/baselines/benzene/frame_window.json +++ b/tests/regression/baselines/benzene/frame_window.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 13.02795056227694, - "united_atom:Rovibrational": 34.98492056748487, + "united_atom:Transvibrational": 13.280184445138662, + "united_atom:Rovibrational": 34.98492056748486, "residue:FTmat-Transvibrational": 76.31666900908246, - "residue:FTmat-Rovibrational": 55.741216775589876, + "residue:FTmat-Rovibrational": 55.74121677558989, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 180.07075691443413 + "total": 180.32299079729586 } } } diff --git a/tests/regression/baselines/benzene/grouping_each.json b/tests/regression/baselines/benzene/grouping_each.json index 50d772d2..fa37d14f 100644 --- a/tests/regression/baselines/benzene/grouping_each.json +++ b/tests/regression/baselines/benzene/grouping_each.json @@ -3,32 +3,32 @@ "0": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.001760679467943202, - "residue:FTmat-Transvibrational": 19.578679589524224, + "united_atom:Rovibrational": 0.0017606794679432046, + "residue:FTmat-Transvibrational": 19.578679589524228, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 19.580440268992167 + "total": 19.58044026899217 }, "1": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.010093246924291217, - "residue:FTmat-Transvibrational": 15.715354239834072, + "residue:FTmat-Transvibrational": 15.71535423983408, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 15.089233620075317 }, - "total": 30.81468110683368 + "total": 30.81468110683369 }, "2": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.07511923174012403, - "residue:FTmat-Transvibrational": 20.399982464339512, + "residue:FTmat-Transvibrational": 20.39998246433951, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, @@ -40,13 +40,13 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.003820932771887749, - "residue:FTmat-Transvibrational": 10.296158411616519, + "residue:FTmat-Transvibrational": 10.29615841161652, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 10.299979344388406 + "total": 10.299979344388408 }, "4": { "components": { @@ -64,13 +64,13 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0015259047993877776, - "residue:FTmat-Transvibrational": 8.852995196433145, + "residue:FTmat-Transvibrational": 8.852995196433142, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 8.854521101232534 + "total": 8.85452110123253 }, "6": { "components": { @@ -99,26 +99,26 @@ "8": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.0006818502219972316, - "residue:FTmat-Transvibrational": 23.038667382549136, + "united_atom:Rovibrational": 0.0006818502219972305, + "residue:FTmat-Transvibrational": 23.038667382549118, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 23.039349232771134 + "total": 23.039349232771116 }, "9": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.004115086801073575, - "residue:FTmat-Transvibrational": 6.271361179467663, + "united_atom:Rovibrational": 0.004115086801073587, + "residue:FTmat-Transvibrational": 6.271361179467661, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 6.275476266268736 + "total": 6.2754762662687344 } } } diff --git a/tests/regression/baselines/benzene/rad.json b/tests/regression/baselines/benzene/rad.json index 8226a0e9..0d21b969 100644 --- a/tests/regression/baselines/benzene/rad.json +++ b/tests/regression/baselines/benzene/rad.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 9.070682016770112, + "united_atom:Transvibrational": 9.040990618107475, "united_atom:Rovibrational": 27.534380126250213, - "residue:FTmat-Transvibrational": 73.34909170672572, - "residue:FTmat-Rovibrational": 61.127301914885564, + "residue:FTmat-Transvibrational": 73.34909170672569, + "residue:FTmat-Rovibrational": 61.12730191488555, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 12.386543820026672 }, - "total": 183.46799958465826 + "total": 183.4383081859956 } } } diff --git a/tests/regression/baselines/benzene/selection_subset.json b/tests/regression/baselines/benzene/selection_subset.json index 773303fd..44aabc54 100644 --- a/tests/regression/baselines/benzene/selection_subset.json +++ b/tests/regression/baselines/benzene/selection_subset.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.20056759662549248, - "united_atom:Rovibrational": 40.69581240789943, - "residue:FTmat-Transvibrational": 78.01138885368493, - "residue:FTmat-Rovibrational": 47.12762732161061, + "united_atom:Transvibrational": 0.17072733303436555, + "united_atom:Rovibrational": 40.6958124078994, + "residue:FTmat-Transvibrational": 78.01138885368499, + "residue:FTmat-Rovibrational": 47.127627321610596, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 166.03539617982048 + "total": 166.00555591622935 } } } diff --git a/tests/regression/baselines/cyclohexane/axes_off.json b/tests/regression/baselines/cyclohexane/axes_off.json index ca81923b..afb36ef6 100644 --- a/tests/regression/baselines/cyclohexane/axes_off.json +++ b/tests/regression/baselines/cyclohexane/axes_off.json @@ -2,10 +2,10 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.8145817540775686, - "united_atom:Rovibrational": 20.92052981899091, - "residue:FTmat-Transvibrational": 82.1218739502184, - "residue:FTmat-Rovibrational": 62.175794643302766, + "united_atom:Transvibrational": 0.8145817540775693, + "united_atom:Rovibrational": 20.920529818990925, + "residue:FTmat-Transvibrational": 82.12187395021837, + "residue:FTmat-Rovibrational": 62.17579464330278, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 diff --git a/tests/regression/baselines/cyclohexane/combined_forcetorque_off.json b/tests/regression/baselines/cyclohexane/combined_forcetorque_off.json index 7f4f19c8..571fbdd9 100644 --- a/tests/regression/baselines/cyclohexane/combined_forcetorque_off.json +++ b/tests/regression/baselines/cyclohexane/combined_forcetorque_off.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.8699366681675057, - "united_atom:Rovibrational": 24.234154676578637, + "united_atom:Transvibrational": 0.8145817540775693, + "united_atom:Rovibrational": 24.23415467657864, "residue:Transvibrational": 69.3899494591254, - "residue:Rovibrational": 69.49919426165623, + "residue:Rovibrational": 69.49919426165621, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 163.99323506552776 + "total": 163.9378801514378 } } } diff --git a/tests/regression/baselines/cyclohexane/default.json b/tests/regression/baselines/cyclohexane/default.json index efe698a0..5d5b12b2 100644 --- a/tests/regression/baselines/cyclohexane/default.json +++ b/tests/regression/baselines/cyclohexane/default.json @@ -2,7 +2,7 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 11.686244565629414, + "united_atom:Transvibrational": 11.672404487784942, "united_atom:Rovibrational": 47.71088602161551, "residue:FTmat-Transvibrational": 71.01203031648771, "residue:FTmat-Rovibrational": 65.10323654742754, @@ -10,7 +10,7 @@ "residue:Conformational": 0.0, "residue:Orientational": 47.54362774624537 }, - "total": 244.34490440410107 + "total": 244.3310643262566 } } } diff --git a/tests/regression/baselines/cyclohexane/frame_window.json b/tests/regression/baselines/cyclohexane/frame_window.json index f6eca0da..e5ab08fd 100644 --- a/tests/regression/baselines/cyclohexane/frame_window.json +++ b/tests/regression/baselines/cyclohexane/frame_window.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 20.97191731367765, - "united_atom:Rovibrational": 73.96792995794401, - "residue:FTmat-Transvibrational": 77.65407670448464, + "united_atom:Transvibrational": 21.044217319916978, + "united_atom:Rovibrational": 73.96792995794397, + "residue:FTmat-Transvibrational": 77.65407670448462, "residue:FTmat-Rovibrational": 64.58400894214395, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 237.17793291825024 + "total": 237.25023292448952 } } } diff --git a/tests/regression/baselines/cyclohexane/grouping_each.json b/tests/regression/baselines/cyclohexane/grouping_each.json index 823401c4..85e95d94 100644 --- a/tests/regression/baselines/cyclohexane/grouping_each.json +++ b/tests/regression/baselines/cyclohexane/grouping_each.json @@ -16,25 +16,25 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.006057157987386287, - "residue:FTmat-Transvibrational": 15.634944714408803, + "residue:FTmat-Transvibrational": 15.634944714408794, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 15.64100187239619 + "total": 15.641001872396181 }, "2": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.00010095873425357108, - "residue:FTmat-Transvibrational": 19.890469700942866, + "united_atom:Rovibrational": 0.00010095873425357076, + "residue:FTmat-Transvibrational": 19.890469700942855, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 19.89057065967712 + "total": 19.89057065967711 }, "3": { "components": { @@ -52,25 +52,25 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0007550734967943642, - "residue:FTmat-Transvibrational": 19.29809809321369, + "residue:FTmat-Transvibrational": 19.29809809321366, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 19.298853166710483 + "total": 19.298853166710455 }, "5": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.02179378230989012, - "residue:FTmat-Transvibrational": 12.538529387394213, + "residue:FTmat-Transvibrational": 12.538529387394208, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 12.560323169704104 + "total": 12.560323169704098 }, "6": { "components": { @@ -100,13 +100,13 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.00022218804178093966, - "residue:FTmat-Transvibrational": 15.418016022831443, + "residue:FTmat-Transvibrational": 15.418016022831454, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 15.418238210873223 + "total": 15.418238210873234 }, "9": { "components": { diff --git a/tests/regression/baselines/cyclohexane/rad.json b/tests/regression/baselines/cyclohexane/rad.json index 7412a304..4910ceb8 100644 --- a/tests/regression/baselines/cyclohexane/rad.json +++ b/tests/regression/baselines/cyclohexane/rad.json @@ -2,7 +2,7 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 11.686244565629414, + "united_atom:Transvibrational": 11.672404487784942, "united_atom:Rovibrational": 47.71088602161551, "residue:FTmat-Transvibrational": 71.01203031648771, "residue:FTmat-Rovibrational": 65.10323654742754, @@ -10,7 +10,7 @@ "residue:Conformational": 0.0, "residue:Orientational": 14.049324060636614 }, - "total": 210.85060071849233 + "total": 210.83676064064787 } } } diff --git a/tests/regression/baselines/cyclohexane/selection_subset.json b/tests/regression/baselines/cyclohexane/selection_subset.json index 214e4495..4795b801 100644 --- a/tests/regression/baselines/cyclohexane/selection_subset.json +++ b/tests/regression/baselines/cyclohexane/selection_subset.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.8699366681675057, - "united_atom:Rovibrational": 24.234154676578637, - "residue:FTmat-Transvibrational": 82.12187395021834, - "residue:FTmat-Rovibrational": 62.175794643302766, + "united_atom:Transvibrational": 0.8145817540775693, + "united_atom:Rovibrational": 24.23415467657864, + "residue:FTmat-Transvibrational": 82.12187395021837, + "residue:FTmat-Rovibrational": 62.17579464330278, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 169.40175993826725 + "total": 169.34640502417736 } } } diff --git a/tests/regression/baselines/dna/axes_off.json b/tests/regression/baselines/dna/axes_off.json index a6149443..0aeb7ae6 100644 --- a/tests/regression/baselines/dna/axes_off.json +++ b/tests/regression/baselines/dna/axes_off.json @@ -3,10 +3,10 @@ "0": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 1.0595708621690758, + "united_atom:Rovibrational": 1.059570862169076, "residue:Transvibrational": 0.0, "residue:Rovibrational": 28.25555780171021, - "polymer:FTmat-Transvibrational": 48.10401202541479, + "polymer:FTmat-Transvibrational": 48.10401202541478, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 10.584542990557836, "residue:Conformational": 5.292271495278918, @@ -17,16 +17,16 @@ "1": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 1.3193251286991976, + "united_atom:Rovibrational": 1.3193251286991978, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 24.96199001531892, - "polymer:FTmat-Transvibrational": 57.35678551116437, + "residue:Rovibrational": 24.961990015318914, + "polymer:FTmat-Transvibrational": 57.356785511164354, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 5.292271495278918, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 93.68927748708911 + "total": 93.68927748708909 } } } diff --git a/tests/regression/baselines/dna/combined_forcetorque_off.json b/tests/regression/baselines/dna/combined_forcetorque_off.json index 8eba4e62..8ea17b2d 100644 --- a/tests/regression/baselines/dna/combined_forcetorque_off.json +++ b/tests/regression/baselines/dna/combined_forcetorque_off.json @@ -5,28 +5,28 @@ "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0021606790121284584, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 3.385663647984109, - "polymer:Transvibrational": 21.18266215491191, - "polymer:Rovibrational": 12.837576042626923, + "residue:Rovibrational": 6.3637630347972935, + "polymer:Transvibrational": 21.182662154911895, + "polymer:Rovibrational": 12.837576042626926, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 42.16696786116278 + "total": 45.14506724797596 }, "1": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.01846427765949588, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 2.437317643397837, - "polymer:Transvibrational": 16.607667396609134, - "polymer:Rovibrational": 12.304363914795605, + "residue:Rovibrational": 4.857506782930805, + "polymer:Transvibrational": 16.60766739660913, + "polymer:Rovibrational": 12.304363914795601, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 36.12671856908978 + "total": 38.54690770862275 } } } diff --git a/tests/regression/baselines/dna/default.json b/tests/regression/baselines/dna/default.json index c58bab0e..3da6bc34 100644 --- a/tests/regression/baselines/dna/default.json +++ b/tests/regression/baselines/dna/default.json @@ -5,28 +5,28 @@ "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0021606790121284584, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 3.385663647984109, - "polymer:FTmat-Transvibrational": 12.341104347192614, + "residue:Rovibrational": 6.3637630347972935, + "polymer:FTmat-Transvibrational": 12.341104347192616, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 20.487834010816563 + "total": 23.46593339762975 }, "1": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.01846427765949588, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 2.437317643397837, + "residue:Rovibrational": 4.857506782930805, "polymer:FTmat-Transvibrational": 11.110372533885974, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 18.325059791571018 + "total": 20.745248931103987 } } } diff --git a/tests/regression/baselines/dna/frame_window.json b/tests/regression/baselines/dna/frame_window.json index 6597f15f..705f06b2 100644 --- a/tests/regression/baselines/dna/frame_window.json +++ b/tests/regression/baselines/dna/frame_window.json @@ -5,28 +5,28 @@ "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 1.5821720528374947, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 28.25555780171021, - "polymer:FTmat-Transvibrational": 48.10401202541479, + "residue:Rovibrational": 35.50322605741718, + "polymer:FTmat-Transvibrational": 48.10401202541478, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 10.584542990557836, "residue:Conformational": 5.292271495278918, "polymer:Orientational": 4.758905336627712 }, - "total": 98.57746170242696 + "total": 105.8251299581339 }, "1": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 2.527793636620802, + "united_atom:Rovibrational": 2.5277936366208023, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 24.96199001531892, - "polymer:FTmat-Transvibrational": 57.35678551116437, + "residue:Rovibrational": 35.814481515013334, + "polymer:FTmat-Transvibrational": 57.356785511164354, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 5.292271495278918, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 94.89774599501071 + "total": 105.7502374947051 } } } diff --git a/tests/regression/baselines/dna/grouping_each.json b/tests/regression/baselines/dna/grouping_each.json index c58bab0e..3da6bc34 100644 --- a/tests/regression/baselines/dna/grouping_each.json +++ b/tests/regression/baselines/dna/grouping_each.json @@ -5,28 +5,28 @@ "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0021606790121284584, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 3.385663647984109, - "polymer:FTmat-Transvibrational": 12.341104347192614, + "residue:Rovibrational": 6.3637630347972935, + "polymer:FTmat-Transvibrational": 12.341104347192616, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 20.487834010816563 + "total": 23.46593339762975 }, "1": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.01846427765949588, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 2.437317643397837, + "residue:Rovibrational": 4.857506782930805, "polymer:FTmat-Transvibrational": 11.110372533885974, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 18.325059791571018 + "total": 20.745248931103987 } } } diff --git a/tests/regression/baselines/dna/selection_subset.json b/tests/regression/baselines/dna/selection_subset.json index c58bab0e..3da6bc34 100644 --- a/tests/regression/baselines/dna/selection_subset.json +++ b/tests/regression/baselines/dna/selection_subset.json @@ -5,28 +5,28 @@ "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0021606790121284584, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 3.385663647984109, - "polymer:FTmat-Transvibrational": 12.341104347192614, + "residue:Rovibrational": 6.3637630347972935, + "polymer:FTmat-Transvibrational": 12.341104347192616, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 20.487834010816563 + "total": 23.46593339762975 }, "1": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.01846427765949588, "residue:Transvibrational": 0.0, - "residue:Rovibrational": 2.437317643397837, + "residue:Rovibrational": 4.857506782930805, "polymer:FTmat-Transvibrational": 11.110372533885974, "polymer:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "polymer:Orientational": 4.758905336627712 }, - "total": 18.325059791571018 + "total": 20.745248931103987 } } } diff --git a/tests/regression/baselines/ethyl-acetate/axes_off.json b/tests/regression/baselines/ethyl-acetate/axes_off.json index 018483fb..13ef66a6 100644 --- a/tests/regression/baselines/ethyl-acetate/axes_off.json +++ b/tests/regression/baselines/ethyl-acetate/axes_off.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 1.4321699433975792, - "united_atom:Rovibrational": 78.4627303464341, + "united_atom:Transvibrational": 1.4321699433975796, + "united_atom:Rovibrational": 78.46273034643427, "residue:FTmat-Transvibrational": 75.78420694132267, - "residue:FTmat-Rovibrational": 56.746114081365306, + "residue:FTmat-Rovibrational": 56.74611408136529, "united_atom:Conformational": 7.90098624365273, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 220.3262075561724 + "total": 220.32620755617253 } } } diff --git a/tests/regression/baselines/ethyl-acetate/combined_forcetorque_off.json b/tests/regression/baselines/ethyl-acetate/combined_forcetorque_off.json index 4d86010d..190cab09 100644 --- a/tests/regression/baselines/ethyl-acetate/combined_forcetorque_off.json +++ b/tests/regression/baselines/ethyl-acetate/combined_forcetorque_off.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 1.4321328326710805, - "united_atom:Rovibrational": 82.3645515427813, + "united_atom:Transvibrational": 1.4321699433975796, + "united_atom:Rovibrational": 82.36455154278137, "residue:Transvibrational": 65.57695624379926, - "residue:Rovibrational": 63.88663153418148, + "residue:Rovibrational": 63.886631534181475, "united_atom:Conformational": 7.90098624365273, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 221.16125839708587 + "total": 221.16129550781244 } } } diff --git a/tests/regression/baselines/ethyl-acetate/default.json b/tests/regression/baselines/ethyl-acetate/default.json index 90101f88..cea30350 100644 --- a/tests/regression/baselines/ethyl-acetate/default.json +++ b/tests/regression/baselines/ethyl-acetate/default.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 19.80599222598891, - "united_atom:Rovibrational": 49.35007067210563, + "united_atom:Transvibrational": 19.82399246051919, + "united_atom:Rovibrational": 49.35007067210566, "residue:FTmat-Transvibrational": 68.26028353214792, - "residue:FTmat-Rovibrational": 61.12406274851272, + "residue:FTmat-Rovibrational": 61.12406274851274, "united_atom:Conformational": 8.175537881068413, "residue:Conformational": 0.0, "residue:Orientational": 65.33877737416202 }, - "total": 272.0547244339856 + "total": 272.07272466851595 } } } diff --git a/tests/regression/baselines/ethyl-acetate/frame_window.json b/tests/regression/baselines/ethyl-acetate/frame_window.json index 7287ef0e..23720a84 100644 --- a/tests/regression/baselines/ethyl-acetate/frame_window.json +++ b/tests/regression/baselines/ethyl-acetate/frame_window.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 28.00207772060564, + "united_atom:Transvibrational": 28.120829473571163, "united_atom:Rovibrational": 51.990361428188855, - "residue:FTmat-Transvibrational": 70.16639324274124, + "residue:FTmat-Transvibrational": 70.16639324274122, "residue:FTmat-Rovibrational": 55.25132347837054, "united_atom:Conformational": 8.635471458692102, "residue:Conformational": 0.0, "residue:Orientational": 3.8984476469128193 }, - "total": 217.94407497551117 + "total": 218.0628267284767 } } } diff --git a/tests/regression/baselines/ethyl-acetate/grouping_each.json b/tests/regression/baselines/ethyl-acetate/grouping_each.json index c3820d33..fb381b59 100644 --- a/tests/regression/baselines/ethyl-acetate/grouping_each.json +++ b/tests/regression/baselines/ethyl-acetate/grouping_each.json @@ -16,13 +16,13 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.1351925826754994, - "residue:FTmat-Transvibrational": 17.58337181094133, + "residue:FTmat-Transvibrational": 17.583371810941337, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 17.71856439361683 + "total": 17.718564393616838 }, "2": { "components": { @@ -39,7 +39,7 @@ "3": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.08920089761061602, + "united_atom:Rovibrational": 0.08920089761061613, "residue:FTmat-Transvibrational": 17.664637284726915, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, @@ -64,61 +64,61 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.02678845348921013, - "residue:FTmat-Transvibrational": 9.770969123148845, + "residue:FTmat-Transvibrational": 9.770969123148847, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 9.797757576638055 + "total": 9.797757576638057 }, "6": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.05229804005112911, - "residue:FTmat-Transvibrational": 13.223227450907878, + "residue:FTmat-Transvibrational": 13.223227450907883, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 13.275525490959007 + "total": 13.275525490959012 }, "7": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.29162538377256336, - "residue:FTmat-Transvibrational": 16.986059101527008, + "united_atom:Rovibrational": 0.29162538377256375, + "residue:FTmat-Transvibrational": 16.98605910152701, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 17.27768448529957 + "total": 17.277684485299574 }, "8": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0469384299833255, - "residue:FTmat-Transvibrational": 10.340489380549256, + "residue:FTmat-Transvibrational": 10.340489380549254, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 10.387427810532582 + "total": 10.38742781053258 }, "9": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.2807736872545627, - "residue:FTmat-Transvibrational": 12.114517418198748, + "residue:FTmat-Transvibrational": 12.114517418198744, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 12.39529110545331 + "total": 12.395291105453307 } } } diff --git a/tests/regression/baselines/ethyl-acetate/rad.json b/tests/regression/baselines/ethyl-acetate/rad.json index 8ad10dbd..3055430f 100644 --- a/tests/regression/baselines/ethyl-acetate/rad.json +++ b/tests/regression/baselines/ethyl-acetate/rad.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 19.80599222598891, - "united_atom:Rovibrational": 49.35007067210563, + "united_atom:Transvibrational": 19.82399246051919, + "united_atom:Rovibrational": 49.35007067210566, "residue:FTmat-Transvibrational": 68.26028353214792, - "residue:FTmat-Rovibrational": 61.12406274851272, + "residue:FTmat-Rovibrational": 61.12406274851274, "united_atom:Conformational": 8.175537881068413, "residue:Conformational": 0.0, "residue:Orientational": 30.739736508673403 }, - "total": 237.45568356849702 + "total": 237.4736838030273 } } } diff --git a/tests/regression/baselines/ethyl-acetate/selection_subset.json b/tests/regression/baselines/ethyl-acetate/selection_subset.json index b8278229..83c25b22 100644 --- a/tests/regression/baselines/ethyl-acetate/selection_subset.json +++ b/tests/regression/baselines/ethyl-acetate/selection_subset.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 1.4321328326710805, - "united_atom:Rovibrational": 82.3645515427813, + "united_atom:Transvibrational": 1.4321699433975796, + "united_atom:Rovibrational": 82.36455154278137, "residue:FTmat-Transvibrational": 75.78420694132267, - "residue:FTmat-Rovibrational": 56.746114081365306, + "residue:FTmat-Rovibrational": 56.74611408136529, "united_atom:Conformational": 7.90098624365273, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 224.2279916417931 + "total": 224.22802875251963 } } } diff --git a/tests/regression/baselines/methane/axes_off.json b/tests/regression/baselines/methane/axes_off.json index 0fc22845..358b54a2 100644 --- a/tests/regression/baselines/methane/axes_off.json +++ b/tests/regression/baselines/methane/axes_off.json @@ -3,11 +3,11 @@ "0": { "components": { "united_atom:Transvibrational": 45.40523701601797, - "united_atom:Rovibrational": 33.30477892995319, + "united_atom:Rovibrational": 33.304778929953194, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 78.71001594597115 + "total": 78.71001594597116 } } } diff --git a/tests/regression/baselines/methane/combined_forcetorque_off.json b/tests/regression/baselines/methane/combined_forcetorque_off.json index 701ae3c2..433731ec 100644 --- a/tests/regression/baselines/methane/combined_forcetorque_off.json +++ b/tests/regression/baselines/methane/combined_forcetorque_off.json @@ -2,12 +2,12 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 45.40523701601797, - "united_atom:Rovibrational": 33.24522051603422, + "united_atom:Transvibrational": 45.40523701601796, + "united_atom:Rovibrational": 33.30477892995318, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 78.6504575320522 + "total": 78.71001594597115 } } } diff --git a/tests/regression/baselines/methane/default.json b/tests/regression/baselines/methane/default.json index 73c2b928..d91068b0 100644 --- a/tests/regression/baselines/methane/default.json +++ b/tests/regression/baselines/methane/default.json @@ -2,12 +2,12 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 40.340343210751236, - "united_atom:Rovibrational": 33.78948111647672, + "united_atom:Transvibrational": 40.34034321075124, + "united_atom:Rovibrational": 33.79888366771756, "united_atom:Conformational": 0.0, "united_atom:Orientational": 3.596676624528629 }, - "total": 77.72650095175659 + "total": 77.73590350299743 } } } diff --git a/tests/regression/baselines/methane/frame_window.json b/tests/regression/baselines/methane/frame_window.json index 29a58057..59df6e6f 100644 --- a/tests/regression/baselines/methane/frame_window.json +++ b/tests/regression/baselines/methane/frame_window.json @@ -2,12 +2,12 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 40.53088385916688, - "united_atom:Rovibrational": 34.010057184978606, + "united_atom:Transvibrational": 40.53088385916687, + "united_atom:Rovibrational": 34.083785382276176, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 74.54094104414548 + "total": 74.61466924144304 } } } diff --git a/tests/regression/baselines/methane/grouping_each.json b/tests/regression/baselines/methane/grouping_each.json index f88386ba..3b30b124 100644 --- a/tests/regression/baselines/methane/grouping_each.json +++ b/tests/regression/baselines/methane/grouping_each.json @@ -2,93 +2,93 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 24.315699188266894, - "united_atom:Rovibrational": 21.048390124205607, + "united_atom:Transvibrational": 24.31569918826691, + "united_atom:Rovibrational": 21.061295966423344, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 45.3640893124725 + "total": 45.37699515469025 }, "1": { "components": { - "united_atom:Transvibrational": 23.766082670463092, - "united_atom:Rovibrational": 16.769636839671296, + "united_atom:Transvibrational": 23.766082670463124, + "united_atom:Rovibrational": 16.800440306419123, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 40.535719510134385 + "total": 40.56652297688225 }, "2": { "components": { - "united_atom:Transvibrational": 24.833896219788336, - "united_atom:Rovibrational": 16.996392060962336, + "united_atom:Transvibrational": 24.83389621978833, + "united_atom:Rovibrational": 17.003260478527494, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 41.83028828075067 + "total": 41.83715669831582 }, "3": { "components": { - "united_atom:Transvibrational": 6.672385707928321, - "united_atom:Rovibrational": 4.98637628279827, + "united_atom:Transvibrational": 6.672385707928316, + "united_atom:Rovibrational": 4.9586405844323584, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 11.65876199072659 + "total": 11.631026292360675 }, "4": { "components": { - "united_atom:Transvibrational": 6.880461178899528, - "united_atom:Rovibrational": 4.441585994100293, + "united_atom:Transvibrational": 6.880461178899529, + "united_atom:Rovibrational": 4.470055238791505, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 11.32204717299982 + "total": 11.350516417691034 }, "5": { "components": { - "united_atom:Transvibrational": 15.473092273577429, - "united_atom:Rovibrational": 7.7770834783347045, + "united_atom:Transvibrational": 15.473092273577443, + "united_atom:Rovibrational": 7.777651199214656, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 23.25017575191213 + "total": 23.2507434727921 }, "6": { "components": { - "united_atom:Transvibrational": 25.69416801099389, - "united_atom:Rovibrational": 6.731392483940263, + "united_atom:Transvibrational": 25.694168010993927, + "united_atom:Rovibrational": 6.727950082765377, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 32.42556049493415 + "total": 32.4221180937593 }, "7": { "components": { - "united_atom:Transvibrational": 10.533257828925983, - "united_atom:Rovibrational": 8.975639133015873, + "united_atom:Transvibrational": 10.533257828925992, + "united_atom:Rovibrational": 9.059251947808509, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 19.508896961941858 + "total": 19.592509776734502 }, "8": { "components": { - "united_atom:Transvibrational": 7.332978272264895, - "united_atom:Rovibrational": 3.0418502362906086, + "united_atom:Transvibrational": 7.332978272264892, + "united_atom:Rovibrational": 3.084945359076369, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 10.374828508555503 + "total": 10.41792363134126 }, "9": { "components": { "united_atom:Transvibrational": 4.023932761002867, - "united_atom:Rovibrational": 8.2893243836361, + "united_atom:Rovibrational": 8.271395156034107, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 12.313257144638968 + "total": 12.295327917036975 } } } diff --git a/tests/regression/baselines/methane/rad.json b/tests/regression/baselines/methane/rad.json index 09556453..1217168a 100644 --- a/tests/regression/baselines/methane/rad.json +++ b/tests/regression/baselines/methane/rad.json @@ -2,12 +2,12 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 40.340343210751236, - "united_atom:Rovibrational": 33.78948111647672, + "united_atom:Transvibrational": 40.34034321075124, + "united_atom:Rovibrational": 33.79888366771756, "united_atom:Conformational": 0.0, "united_atom:Orientational": 6.667209510980459 }, - "total": 80.79703383820842 + "total": 80.80643638944926 } } } diff --git a/tests/regression/baselines/methane/selection_subset.json b/tests/regression/baselines/methane/selection_subset.json index 701ae3c2..433731ec 100644 --- a/tests/regression/baselines/methane/selection_subset.json +++ b/tests/regression/baselines/methane/selection_subset.json @@ -2,12 +2,12 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 45.40523701601797, - "united_atom:Rovibrational": 33.24522051603422, + "united_atom:Transvibrational": 45.40523701601796, + "united_atom:Rovibrational": 33.30477892995318, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 78.6504575320522 + "total": 78.71001594597115 } } } diff --git a/tests/regression/baselines/methanol/axes_off.json b/tests/regression/baselines/methanol/axes_off.json index c6e811d0..1234ed92 100644 --- a/tests/regression/baselines/methanol/axes_off.json +++ b/tests/regression/baselines/methanol/axes_off.json @@ -3,9 +3,9 @@ "0": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 41.19579286890261, - "residue:FTmat-Transvibrational": 73.48764222316325, - "residue:FTmat-Rovibrational": 40.99443237927874, + "united_atom:Rovibrational": 41.19579286890262, + "residue:FTmat-Transvibrational": 73.48764222316323, + "residue:FTmat-Rovibrational": 40.99443237927875, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 diff --git a/tests/regression/baselines/methanol/combined_forcetorque_off.json b/tests/regression/baselines/methanol/combined_forcetorque_off.json index ec5d49d4..59f244fa 100644 --- a/tests/regression/baselines/methanol/combined_forcetorque_off.json +++ b/tests/regression/baselines/methanol/combined_forcetorque_off.json @@ -4,8 +4,8 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 49.59060714158679, - "residue:Transvibrational": 58.3765799106185, - "residue:Rovibrational": 47.76208369485248, + "residue:Transvibrational": 58.37657991061848, + "residue:Rovibrational": 47.76208369485249, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 diff --git a/tests/regression/baselines/methanol/default.json b/tests/regression/baselines/methanol/default.json index 13d47c84..0d8a94a8 100644 --- a/tests/regression/baselines/methanol/default.json +++ b/tests/regression/baselines/methanol/default.json @@ -4,13 +4,13 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 31.716834547723234, - "residue:FTmat-Transvibrational": 58.45579528462362, - "residue:FTmat-Rovibrational": 45.80649268055635, + "residue:FTmat-Transvibrational": 58.455795284623605, + "residue:FTmat-Rovibrational": 45.80649268055636, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 31.66363493251588 }, - "total": 167.6427574454191 + "total": 167.64275744541908 } } } diff --git a/tests/regression/baselines/methanol/frame_window.json b/tests/regression/baselines/methanol/frame_window.json index 05db0ffe..398de17f 100644 --- a/tests/regression/baselines/methanol/frame_window.json +++ b/tests/regression/baselines/methanol/frame_window.json @@ -5,7 +5,7 @@ "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 34.6755419354061, "residue:FTmat-Transvibrational": 65.8511444181186, - "residue:FTmat-Rovibrational": 42.017516849802064, + "residue:FTmat-Rovibrational": 42.01751684980207, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 diff --git a/tests/regression/baselines/methanol/grouping_each.json b/tests/regression/baselines/methanol/grouping_each.json index 35821b29..116f2f8e 100644 --- a/tests/regression/baselines/methanol/grouping_each.json +++ b/tests/regression/baselines/methanol/grouping_each.json @@ -16,13 +16,13 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.527531744140127, - "residue:FTmat-Transvibrational": 12.808272932286398, + "residue:FTmat-Transvibrational": 12.808272932286403, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 13.335804676426525 + "total": 13.33580467642653 }, "2": { "components": { @@ -39,7 +39,7 @@ "3": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 1.09131345956036, + "united_atom:Rovibrational": 1.0913134595603602, "residue:FTmat-Transvibrational": 5.016900125476648, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, @@ -52,73 +52,73 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 3.0175220560507166, - "residue:FTmat-Transvibrational": 5.639296933084347, + "residue:FTmat-Transvibrational": 5.639296933084344, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 8.656818989135065 + "total": 8.656818989135061 }, "5": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.7113434639378043, - "residue:FTmat-Transvibrational": 10.476269460749675, + "united_atom:Rovibrational": 0.7113434639378057, + "residue:FTmat-Transvibrational": 10.47626946074968, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 11.18761292468748 + "total": 11.187612924687485 }, "6": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 1.8814857352503533, - "residue:FTmat-Transvibrational": 7.044906752987788, + "residue:FTmat-Transvibrational": 7.044906752987785, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 8.926392488238141 + "total": 8.926392488238138 }, "7": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.31891831875623067, - "residue:FTmat-Transvibrational": 13.617054744168277, + "residue:FTmat-Transvibrational": 13.61705474416828, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 13.935973062924507 + "total": 13.93597306292451 }, "8": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 1.3866864927610842, - "residue:FTmat-Transvibrational": 17.47787792133663, + "residue:FTmat-Transvibrational": 17.47787792133662, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 18.864564414097714 + "total": 18.864564414097703 }, "9": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.3408829290752051, - "residue:FTmat-Transvibrational": 5.087852786920215, + "residue:FTmat-Transvibrational": 5.087852786920213, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 5.42873571599542 + "total": 5.428735715995418 } } } diff --git a/tests/regression/baselines/methanol/rad.json b/tests/regression/baselines/methanol/rad.json index 0cd0b3be..7bcd1849 100644 --- a/tests/regression/baselines/methanol/rad.json +++ b/tests/regression/baselines/methanol/rad.json @@ -4,13 +4,13 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 31.716834547723234, - "residue:FTmat-Transvibrational": 58.45579528462362, - "residue:FTmat-Rovibrational": 45.80649268055635, + "residue:FTmat-Transvibrational": 58.455795284623605, + "residue:FTmat-Rovibrational": 45.80649268055636, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 17.021167486252484 }, - "total": 153.0002899991557 + "total": 153.00028999915568 } } } diff --git a/tests/regression/baselines/methanol/selection_subset.json b/tests/regression/baselines/methanol/selection_subset.json index f84d0d6c..6f8400b2 100644 --- a/tests/regression/baselines/methanol/selection_subset.json +++ b/tests/regression/baselines/methanol/selection_subset.json @@ -4,7 +4,7 @@ "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 49.59060714158679, - "residue:FTmat-Transvibrational": 73.48764222316326, + "residue:FTmat-Transvibrational": 73.48764222316323, "residue:FTmat-Rovibrational": 40.99443237927875, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, diff --git a/tests/regression/baselines/octonol/axes_off.json b/tests/regression/baselines/octonol/axes_off.json index 4c275934..74e4d13e 100644 --- a/tests/regression/baselines/octonol/axes_off.json +++ b/tests/regression/baselines/octonol/axes_off.json @@ -2,8 +2,8 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.2813477461801644, - "united_atom:Rovibrational": 11.777756530643426, + "united_atom:Transvibrational": 0.28134774618016406, + "united_atom:Rovibrational": 11.777756530643423, "residue:FTmat-Transvibrational": 81.94518173835938, "residue:FTmat-Rovibrational": 59.553917441172246, "united_atom:Conformational": 16.83949354267619, diff --git a/tests/regression/baselines/octonol/combined_forcetorque_off.json b/tests/regression/baselines/octonol/combined_forcetorque_off.json index 136f507d..fdfcd03a 100644 --- a/tests/regression/baselines/octonol/combined_forcetorque_off.json +++ b/tests/regression/baselines/octonol/combined_forcetorque_off.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.2801426785866467, - "united_atom:Rovibrational": 19.154228264604267, + "united_atom:Transvibrational": 0.28134774618016406, + "united_atom:Rovibrational": 19.154228264604278, "residue:Transvibrational": 72.99206520550513, "residue:Rovibrational": 63.35835952854332, "united_atom:Conformational": 16.83949354267619, "residue:Conformational": 0.0, "residue:Orientational": 25.79114991860739 }, - "total": 198.4154391385229 + "total": 198.41664420611647 } } } diff --git a/tests/regression/baselines/octonol/default.json b/tests/regression/baselines/octonol/default.json index 39651d41..498899ef 100644 --- a/tests/regression/baselines/octonol/default.json +++ b/tests/regression/baselines/octonol/default.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 37.773345787136414, + "united_atom:Transvibrational": 37.830646174114975, "united_atom:Rovibrational": 84.26087853087442, "residue:FTmat-Transvibrational": 66.27397939927971, - "residue:FTmat-Rovibrational": 58.77768843093995, + "residue:FTmat-Rovibrational": 58.77768843093996, "united_atom:Conformational": 34.22940197506605, "residue:Conformational": 0.0, "residue:Orientational": 74.78356386019003 }, - "total": 356.0988579834866 + "total": 356.15615837046516 } } } diff --git a/tests/regression/baselines/octonol/frame_window.json b/tests/regression/baselines/octonol/frame_window.json index cac837a8..fce81eec 100644 --- a/tests/regression/baselines/octonol/frame_window.json +++ b/tests/regression/baselines/octonol/frame_window.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 71.9625416292299, - "united_atom:Rovibrational": 162.26463085986254, + "united_atom:Transvibrational": 72.30956129858235, + "united_atom:Rovibrational": 162.2646308598621, "residue:FTmat-Transvibrational": 76.77484314336978, "residue:FTmat-Rovibrational": 61.84803082754469, "united_atom:Conformational": 16.651144380045313, "residue:Conformational": 0.0, "residue:Orientational": 25.79114991860739 }, - "total": 415.2923407586596 + "total": 415.6393604280116 } } } diff --git a/tests/regression/baselines/octonol/grouping_each.json b/tests/regression/baselines/octonol/grouping_each.json index e47e9768..46795cdc 100644 --- a/tests/regression/baselines/octonol/grouping_each.json +++ b/tests/regression/baselines/octonol/grouping_each.json @@ -3,55 +3,55 @@ "0": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 6.942013165337589e-05, - "residue:FTmat-Transvibrational": 19.07133042108965, + "united_atom:Rovibrational": 6.94201316533759e-05, + "residue:FTmat-Transvibrational": 19.071330421089655, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 19.071399841221304 + "total": 19.071399841221307 }, "1": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.00013794104464519378, - "residue:FTmat-Transvibrational": 14.647060460207918, + "united_atom:Rovibrational": 0.00013794104464519418, + "residue:FTmat-Transvibrational": 14.647060460207905, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 45.863560270951176 }, - "total": 60.510758672203735 + "total": 60.51075867220373 }, "2": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.000775330395570017, - "residue:FTmat-Transvibrational": 12.849039746264511, + "united_atom:Rovibrational": 0.0007753303955700192, + "residue:FTmat-Transvibrational": 12.849039746264502, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 12.84981507666008 + "total": 12.849815076660072 }, "3": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0031285818933102097, - "residue:FTmat-Transvibrational": 21.847209491929362, + "residue:FTmat-Transvibrational": 21.847209491929384, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 21.850338073822673 + "total": 21.850338073822694 }, "4": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.0015070029381425056, + "united_atom:Rovibrational": 0.0015070029381425035, "residue:FTmat-Transvibrational": 12.367134537261949, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, @@ -75,26 +75,26 @@ "6": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 0.00028812747686091, - "residue:FTmat-Transvibrational": 16.651398255680164, + "united_atom:Rovibrational": 0.00028812747686091046, + "residue:FTmat-Transvibrational": 16.651398255680178, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 16.651686383157024 + "total": 16.65168638315704 }, "7": { "components": { "united_atom:Transvibrational": 0.0, "united_atom:Rovibrational": 0.0013568745282136598, - "residue:FTmat-Transvibrational": 15.814234753264742, + "residue:FTmat-Transvibrational": 15.814234753264744, "residue:FTmat-Rovibrational": 0.0, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, "residue:Orientational": 0.0 }, - "total": 15.815591627792955 + "total": 15.815591627792957 }, "8": { "components": { diff --git a/tests/regression/baselines/octonol/rad.json b/tests/regression/baselines/octonol/rad.json index 82602dbf..6b3e5f03 100644 --- a/tests/regression/baselines/octonol/rad.json +++ b/tests/regression/baselines/octonol/rad.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 37.773345787136414, + "united_atom:Transvibrational": 37.830646174114975, "united_atom:Rovibrational": 84.26087853087442, "residue:FTmat-Transvibrational": 66.27397939927971, - "residue:FTmat-Rovibrational": 58.77768843093995, + "residue:FTmat-Rovibrational": 58.77768843093996, "united_atom:Conformational": 34.22940197506605, "residue:Conformational": 0.0, "residue:Orientational": 28.084239413273323 }, - "total": 309.3995335365699 + "total": 309.45683392354846 } } } diff --git a/tests/regression/baselines/octonol/selection_subset.json b/tests/regression/baselines/octonol/selection_subset.json index 3ea7ff18..40aa2468 100644 --- a/tests/regression/baselines/octonol/selection_subset.json +++ b/tests/regression/baselines/octonol/selection_subset.json @@ -2,15 +2,15 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 0.2801426785866467, - "united_atom:Rovibrational": 19.154228264604267, - "residue:FTmat-Transvibrational": 81.9451817383594, + "united_atom:Transvibrational": 0.28134774618016406, + "united_atom:Rovibrational": 19.154228264604278, + "residue:FTmat-Transvibrational": 81.94518173835938, "residue:FTmat-Rovibrational": 59.553917441172246, "united_atom:Conformational": 16.83949354267619, "residue:Conformational": 0.0, "residue:Orientational": 25.79114991860739 }, - "total": 203.56411358400612 + "total": 203.56531865159963 } } } diff --git a/tests/regression/baselines/water/combined_forcetorque_off.json b/tests/regression/baselines/water/combined_forcetorque_off.json index f2c917b9..919fbe84 100644 --- a/tests/regression/baselines/water/combined_forcetorque_off.json +++ b/tests/regression/baselines/water/combined_forcetorque_off.json @@ -3,11 +3,11 @@ "0": { "components": { "united_atom:Transvibrational": 49.78087138438188, - "united_atom:Rovibrational": 18.241329771851756, + "united_atom:Rovibrational": 18.36089665595961, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 68.02220115623363 + "total": 68.14176804034149 } } } diff --git a/tests/regression/baselines/water/default.json b/tests/regression/baselines/water/default.json index 51df3454..21cf428f 100644 --- a/tests/regression/baselines/water/default.json +++ b/tests/regression/baselines/water/default.json @@ -3,11 +3,11 @@ "0": { "components": { "united_atom:Transvibrational": 43.71553411557926, - "united_atom:Rovibrational": 17.159953317592837, + "united_atom:Rovibrational": 17.296212342690918, "united_atom:Conformational": 0.0, "united_atom:Orientational": 32.193445593362114 }, - "total": 93.06893302653421 + "total": 93.2051920516323 } } } diff --git a/tests/regression/baselines/water/frame_window.json b/tests/regression/baselines/water/frame_window.json index 58329f9e..94cbdc40 100644 --- a/tests/regression/baselines/water/frame_window.json +++ b/tests/regression/baselines/water/frame_window.json @@ -3,11 +3,11 @@ "0": { "components": { "united_atom:Transvibrational": 46.361096977161964, - "united_atom:Rovibrational": 17.208799819818985, + "united_atom:Rovibrational": 17.251033524580485, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 63.56989679698095 + "total": 63.61213050174245 } } } diff --git a/tests/regression/baselines/water/grouping_each.json b/tests/regression/baselines/water/grouping_each.json index 3918248f..69111fcd 100644 --- a/tests/regression/baselines/water/grouping_each.json +++ b/tests/regression/baselines/water/grouping_each.json @@ -2,93 +2,93 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 14.945907953805566, - "united_atom:Rovibrational": 1.8947243953648225, + "united_atom:Transvibrational": 14.94590795380556, + "united_atom:Rovibrational": 1.9407679201410482, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 16.840632349170388 + "total": 16.886675873946608 }, "1": { "components": { - "united_atom:Transvibrational": 8.111522208287779, - "united_atom:Rovibrational": 0.960774796833424, + "united_atom:Transvibrational": 8.111522208287775, + "united_atom:Rovibrational": 0.9798912337680588, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 9.072297005121204 + "total": 9.091413442055835 }, "2": { "components": { - "united_atom:Transvibrational": 15.794973479687608, - "united_atom:Rovibrational": 4.606072530590255, + "united_atom:Transvibrational": 15.794973479687595, + "united_atom:Rovibrational": 4.469286093091963, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 20.401046010277863 + "total": 20.264259572779558 }, "3": { "components": { - "united_atom:Transvibrational": 9.462487265119444, - "united_atom:Rovibrational": 1.6509513986984763, + "united_atom:Transvibrational": 9.462487265119448, + "united_atom:Rovibrational": 1.6054615846390565, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 11.11343866381792 + "total": 11.067948849758505 }, "4": { "components": { - "united_atom:Transvibrational": 16.254161245740693, - "united_atom:Rovibrational": 1.3675973741107648, + "united_atom:Transvibrational": 16.25416124574069, + "united_atom:Rovibrational": 1.448700454979356, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 17.62175861985146 + "total": 17.702861700720046 }, "5": { "components": { - "united_atom:Transvibrational": 11.577798762033282, - "united_atom:Rovibrational": 7.351163568004953, + "united_atom:Transvibrational": 11.577798762033284, + "united_atom:Rovibrational": 7.238494591575326, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 18.928962330038235 + "total": 18.81629335360861 }, "6": { "components": { - "united_atom:Transvibrational": 10.172061262201797, - "united_atom:Rovibrational": 3.6715372968885003, + "united_atom:Transvibrational": 10.172061262201801, + "united_atom:Rovibrational": 4.08698229743822, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 13.843598559090298 + "total": 14.25904355964002 }, "7": { "components": { - "united_atom:Transvibrational": 13.499510451861937, - "united_atom:Rovibrational": 1.7029491215274863, + "united_atom:Transvibrational": 13.499510451861939, + "united_atom:Rovibrational": 1.6178142656646386, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 15.202459573389424 + "total": 15.117324717526577 }, "8": { "components": { "united_atom:Transvibrational": 16.597759171924586, - "united_atom:Rovibrational": 1.6190289365617612, + "united_atom:Rovibrational": 1.6676178150275733, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 18.216788108486348 + "total": 18.26537698695216 }, "9": { "components": { "united_atom:Transvibrational": 13.731375187064533, - "united_atom:Rovibrational": 5.650620990305764, + "united_atom:Rovibrational": 5.161816204002112, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 19.381996177370297 + "total": 18.893191391066644 } } } diff --git a/tests/regression/baselines/water/rad.json b/tests/regression/baselines/water/rad.json index 0a914b98..3ed89938 100644 --- a/tests/regression/baselines/water/rad.json +++ b/tests/regression/baselines/water/rad.json @@ -2,12 +2,12 @@ "groups": { "0": { "components": { - "united_atom:Transvibrational": 79.19311841965869, - "united_atom:Rovibrational": 50.750640399631905, + "united_atom:Transvibrational": 79.1931184196587, + "united_atom:Rovibrational": 50.922185291952886, "united_atom:Conformational": 0.0, "united_atom:Orientational": 22.760377489372107 }, - "total": 152.7041363086627 + "total": 152.8756812009837 } } } diff --git a/tests/regression/baselines/water/selection_subset.json b/tests/regression/baselines/water/selection_subset.json index f2c917b9..919fbe84 100644 --- a/tests/regression/baselines/water/selection_subset.json +++ b/tests/regression/baselines/water/selection_subset.json @@ -3,11 +3,11 @@ "0": { "components": { "united_atom:Transvibrational": 49.78087138438188, - "united_atom:Rovibrational": 18.241329771851756, + "united_atom:Rovibrational": 18.36089665595961, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 68.02220115623363 + "total": 68.14176804034149 } } } diff --git a/tests/regression/baselines/water/water_off.json b/tests/regression/baselines/water/water_off.json index f2c917b9..919fbe84 100644 --- a/tests/regression/baselines/water/water_off.json +++ b/tests/regression/baselines/water/water_off.json @@ -3,11 +3,11 @@ "0": { "components": { "united_atom:Transvibrational": 49.78087138438188, - "united_atom:Rovibrational": 18.241329771851756, + "united_atom:Rovibrational": 18.36089665595961, "united_atom:Conformational": 0.0, "united_atom:Orientational": 0.0 }, - "total": 68.02220115623363 + "total": 68.14176804034149 } } }