diff --git a/CodeEntropy/entropy/nodes/vibrational.py b/CodeEntropy/entropy/nodes/vibrational.py index 40cabced..015749e9 100644 --- a/CodeEntropy/entropy/nodes/vibrational.py +++ b/CodeEntropy/entropy/nodes/vibrational.py @@ -75,6 +75,7 @@ def run(self, shared_data: MutableMapping[str, Any], **_: Any) -> dict[str, Any] groups = shared_data["groups"] levels = shared_data["levels"] fragments = shared_data["reduced_universe"].atoms.fragments + flexible = shared_data["flexible_dihedrals"] gid2i = self._get_group_id_to_index(shared_data) @@ -109,6 +110,7 @@ def run(self, shared_data: MutableMapping[str, Any], **_: Any) -> dict[str, Any] residues=rep_mol.residues, force_ua=force_cov["ua"], torque_ua=torque_cov["ua"], + flexible_ua=flexible["ua"], ua_frame_counts=ua_frame_counts, reporter=reporter, n_frames_default=shared_data.get("n_frames", 0), @@ -123,11 +125,18 @@ def run(self, shared_data: MutableMapping[str, Any], **_: Any) -> dict[str, Any] if level in ("residue", "polymer"): gi = gid2i[group_id] + if level == "residue": + flexible_res = flexible["res"][group_id] + else: + flexible_res = 0 # No polymer level flexible dihedrals + if combined and highest and ft_cov is not None: ft_key = "res" if level == "residue" else "poly" ftmat = self._get_indexed_matrix(ft_cov.get(ft_key, []), gi) - pair = self._compute_ft_entropy(ve=ve, temp=temp, ftmat=ftmat) + pair = self._compute_ft_entropy( + ve=ve, temp=temp, ftmat=ftmat, flexible=flexible_res + ) self._store_results(results, group_id, level, pair) self._log_molecule_level_results( reporter, group_id, level, pair, use_ft_labels=True @@ -143,6 +152,7 @@ def run(self, shared_data: MutableMapping[str, Any], **_: Any) -> dict[str, Any] temp=temp, fmat=fmat, tmat=tmat, + flexible=flexible_res, highest=highest, ) self._store_results(results, group_id, level, pair) @@ -217,6 +227,7 @@ def _compute_united_atom_entropy( residues: Any, force_ua: Mapping[CovKey, Any], torque_ua: Mapping[CovKey, Any], + flexible_ua: Any, ua_frame_counts: Mapping[CovKey, int], reporter: Any | None, n_frames_default: int, @@ -235,6 +246,7 @@ def _compute_united_atom_entropy( residues: Residue container/sequence for the representative molecule. force_ua: Mapping from (group_id, residue_id) to force covariance matrix. torque_ua: Mapping from (group_id, residue_id) to torque covariance matrix. + flexible: Data about number of flexible dihedrals ua_frame_counts: Mapping from (group_id, residue_id) to frame counts. reporter: Optional reporter object supporting add_residue_data calls. n_frames_default: Fallback frame count if per-residue count missing. @@ -250,12 +262,14 @@ def _compute_united_atom_entropy( key = (group_id, res_id) fmat = force_ua.get(key) tmat = torque_ua.get(key) + flexible = flexible_ua.get(key) pair = self._compute_force_torque_entropy( ve=ve, temp=temp, fmat=fmat, tmat=tmat, + flexible=flexible, highest=highest, ) @@ -290,6 +304,7 @@ def _compute_force_torque_entropy( temp: float, fmat: Any, tmat: Any, + flexible: int, highest: bool, ) -> EntropyPair: """Compute vibrational entropy from separate force and torque covariances. @@ -322,10 +337,10 @@ def _compute_force_torque_entropy( return EntropyPair(trans=0.0, rot=0.0) s_trans = ve.vibrational_entropy_calculation( - f, "force", temp, highest_level=highest + f, "force", temp, highest_level=highest, flexible=flexible ) s_rot = ve.vibrational_entropy_calculation( - t, "torque", temp, highest_level=highest + t, "torque", temp, highest_level=highest, flexible=flexible ) return EntropyPair(trans=float(s_trans), rot=float(s_rot)) @@ -335,6 +350,7 @@ def _compute_ft_entropy( ve: VibrationalEntropy, temp: float, ftmat: Any, + flexible: int, ) -> EntropyPair: """Compute vibrational entropy from a combined force-torque covariance matrix. @@ -360,10 +376,10 @@ def _compute_ft_entropy( return EntropyPair(trans=0.0, rot=0.0) s_trans = ve.vibrational_entropy_calculation( - ft, "forcetorqueTRANS", temp, highest_level=True + ft, "forcetorqueTRANS", temp, highest_level=True, flexible=flexible ) s_rot = ve.vibrational_entropy_calculation( - ft, "forcetorqueROT", temp, highest_level=True + ft, "forcetorqueROT", temp, highest_level=True, flexible=flexible ) return EntropyPair(trans=float(s_trans), rot=float(s_rot)) diff --git a/CodeEntropy/entropy/vibrational.py b/CodeEntropy/entropy/vibrational.py index 17779bc7..3e02a01a 100644 --- a/CodeEntropy/entropy/vibrational.py +++ b/CodeEntropy/entropy/vibrational.py @@ -68,6 +68,7 @@ def vibrational_entropy_calculation( matrix_type: MatrixType, temp: float, highest_level: bool, + flexible: int, ) -> float: """Compute vibrational entropy for the given covariance matrix. @@ -101,11 +102,17 @@ def vibrational_entropy_calculation( Raises: ValueError: If matrix_type is unknown. """ - components = self._entropy_components(matrix, temp) + components = self._entropy_components(matrix, matrix_type, flexible, temp) total = self._sum_components(components, matrix_type, highest_level) return float(total) - def _entropy_components(self, matrix: np.ndarray, temp: float) -> np.ndarray: + def _entropy_components( + self, + matrix: np.ndarray, + matrix_type: str, + flexible: int, + temp: float, + ) -> np.ndarray: """Compute per-mode entropy components from a covariance matrix. Args: @@ -116,7 +123,12 @@ def _entropy_components(self, matrix: np.ndarray, temp: float) -> np.ndarray: Array of entropy components (J/mol/K) for each valid mode. """ lambdas = self._matrix_eigenvalues(matrix) + logger.debug("lambdas: %s", lambdas) lambdas = self._convert_lambda_units(lambdas) + logger.debug("lambdas converted units: %s", lambdas) + if matrix_type == "force" and flexible > 0: + lambdas = self._flexible_dihedral(lambdas, flexible) + logger.debug("lambdas flexible halved: %s", lambdas) freqs = self._frequencies_from_lambdas(lambdas, temp) if freqs.size == 0: @@ -149,6 +161,26 @@ def _convert_lambda_units(self, lambdas: np.ndarray) -> np.ndarray: """ return self._run_manager.change_lambda_units(lambdas) + def _flexible_dihedral(self, lambdas: np.ndarray, flexible: int) -> np.ndarray: + """Force halving for flexible dihedrals. + + If N flexible dihedrals, halve the forces for the N largest eigenvalues. + The matrix has force^2 so use factor of 0.25 for eigenvalues. + + Args: + lambdas: Eigenvalues + flexible: the number of flexible dihedrals in the molecule + + Returns: + reduced lambdas + """ + halved = sorted(lambdas, reverse=True) + for i in range(flexible): + halved[i] = 0.25 * halved[i] + lambdas = halved + + return lambdas + def _frequencies_from_lambdas(self, lambdas: np.ndarray, temp: float) -> np.ndarray: """Convert eigenvalues to frequencies with robust filtering. diff --git a/CodeEntropy/levels/dihedrals.py b/CodeEntropy/levels/dihedrals.py index 7075e04d..0b402789 100644 --- a/CodeEntropy/levels/dihedrals.py +++ b/CodeEntropy/levels/dihedrals.py @@ -44,7 +44,7 @@ def build_conformational_states( step: int, bin_width: float, progress: _RichProgressSink | None = None, - ) -> tuple[dict[UAKey, list[str]], list[list[str]]]: + ) -> tuple[dict[UAKey, list[str]], list[list[str]], dict[UAKey, int], list[int]]: """Build conformational state labels from trajectory dihedrals. This method constructs discrete conformational state descriptors used in @@ -72,7 +72,7 @@ def build_conformational_states( and advance(). Returns: - tuple: (states_ua, states_res) + tuple: (states_ua, states_res, flexible_ua, flexible_res) - states_ua: Dict mapping (group_id, local_residue_id) -> list of state labels (strings) across the analyzed trajectory. @@ -87,6 +87,8 @@ def build_conformational_states( number_groups = len(groups) states_ua: dict[UAKey, list[str]] = {} states_res: list[list[str]] = [[] for _ in range(number_groups)] + flexible_ua: dict[UAKey, int] = {} + flexible_res: list[int] = [0] * number_groups task: TaskID | None = None if progress is not None: @@ -149,12 +151,14 @@ def build_conformational_states( level_list=levels[molecules[0]], states_ua=states_ua, states_res=states_res, + flexible_ua=flexible_ua, + flexible_res=flexible_res, ) if progress is not None and task is not None: progress.advance(task) - return states_ua, states_res + return states_ua, states_res, flexible_ua, flexible_res def _collect_dihedrals_for_group( self, mol: Any, level_list: list[str] @@ -268,6 +272,7 @@ def _collect_peaks_for_group( if level == "united_atom": for res_id in range(len(dihedrals_ua)): if len(dihedrals_ua[res_id]) == 0: + # No dihedrals means no peaks peaks_ua[res_id] = [] else: peaks_ua[res_id] = self._identify_peaks( @@ -282,6 +287,7 @@ def _collect_peaks_for_group( elif level == "residue": if len(dihedrals_res) == 0: + # No dihedrals means no peaks peaks_res = [] else: peaks_res = self._identify_peaks( @@ -353,7 +359,9 @@ def _identify_peaks( peaks = self._find_histogram_peaks(popul=popul, bin_value=bin_value) peak_values.append(peaks) - logger.debug(f"Dihedral: {dihedral_index}, Peak Values: {peak_values}") + logger.debug( + f"Dihedral: {dihedral_index}Peak Values: {peak_values[dihedral_index]}" + ) return peak_values @@ -404,6 +412,8 @@ def _assign_states_for_group( level_list: list[str], states_ua: dict[UAKey, list[str]], states_res: list[list[str]], + flexible_ua: dict[UAKey, list[int]], + flexible_res: list[int], ) -> None: """Assign UA and residue states for a group into output containers.""" for level in level_list: @@ -412,8 +422,9 @@ def _assign_states_for_group( key = (group_id, res_id) if len(dihedrals_ua[res_id]) == 0: states_ua[key] = [] + flexible_ua[key] = 0 else: - states_ua[key] = self._assign_states( + states_ua[key], flexible_ua[key] = self._assign_states( data_container=data_container, molecules=molecules, dihedrals=dihedrals_ua[res_id], @@ -426,8 +437,9 @@ def _assign_states_for_group( elif level == "residue": if len(dihedrals_res) == 0: states_res[group_id] = [] + flexible_res[group_id] = 0 else: - states_res[group_id] = self._assign_states( + states_res[group_id], flexible_res[group_id] = self._assign_states( data_container=data_container, molecules=molecules, dihedrals=dihedrals_res, @@ -467,6 +479,7 @@ def _assign_states( List of state labels (strings). """ states: list[str] = [] + num_flexible = 0 for molecule in molecules: conformations: list[list[Any]] = [] @@ -477,16 +490,29 @@ def _assign_states( for dihedral_index in range(len(dihedrals)): conformation: list[Any] = [] + + # Check for flexible dihedrals + if len(peaks[dihedral_index]) > 1 and molecule == 0: + num_flexible += 1 + + # Get conformations for timestep in range(number_frames): value = dihedral_results.results.angles[timestep][dihedral_index] + # We want postive values in range 0 to 360 to make + # the peak assignment. + # works using the fact that dihedrals have circular symmetry + # (i.e. -15 degrees = +345 degrees) if value < 0: value += 360 + # Find the peak closest to the dihedral value distances = [abs(value - peak) for peak in peaks[dihedral_index]] conformation.append(np.argmin(distances)) conformations.append(conformation) + # Concatenate all the dihedrals in the molecule into the state + # for the frame. mol_states = [ state for state in ( @@ -501,4 +527,6 @@ def _assign_states( states.extend(mol_states) logger.debug(f"States: {states}") - return states + logger.debug(f"Number of flexible dihedrals: {num_flexible}") + + return states, num_flexible diff --git a/CodeEntropy/levels/neighbors.py b/CodeEntropy/levels/neighbors.py index bde516c3..a91b3950 100644 --- a/CodeEntropy/levels/neighbors.py +++ b/CodeEntropy/levels/neighbors.py @@ -95,7 +95,8 @@ def get_neighbors(self, universe, levels, groups, search_type): len(molecules) * number_frames ) logger.debug( - "group: {group_id}number neighbors {average_number_neighbors[group_id]}" + f"group: {group_id}" + f"number neighbors {average_number_neighbors[group_id]}" ) return average_number_neighbors @@ -233,14 +234,13 @@ def _get_linear(self, rdkit_mol, number_heavy): Returns: linear (bool): True if molecule linear """ - rdkit_heavy = Chem.RemoveHs(rdkit_mol) - linear = False if number_heavy == 1: linear = False elif number_heavy == 2: linear = True else: + rdkit_heavy = Chem.RemoveHs(rdkit_mol) sp_count = 0 for x in rdkit_heavy.GetAtoms(): if x.GetHybridization() == Chem.HybridizationType.SP: diff --git a/CodeEntropy/levels/nodes/conformations.py b/CodeEntropy/levels/nodes/conformations.py index 5e379ca3..89eb63a5 100644 --- a/CodeEntropy/levels/nodes/conformations.py +++ b/CodeEntropy/levels/nodes/conformations.py @@ -15,6 +15,7 @@ SharedData = dict[str, Any] ConformationalStates = dict[str, Any] +FlexibleStates = dict[str, Any] @dataclass(frozen=True) @@ -39,10 +40,13 @@ class ComputeConformationalStatesNode: Produces: shared_data["conformational_states"] = {"ua": states_ua, "res": states_res} + shared_data["flexible_dihedrals"] = {"ua: flexible_ua, "res": flexible_res} Where: - states_ua is a dict keyed by (group_id, local_residue_id) - states_res is a list-like structure indexed by group_id (or equivalent) + - flexible_ua is a dict keyed by (group_id, local_residue_id) + - flexible_res is a list-like structure indexed by group_id (or equivalent) """ def __init__(self, universe_operations: Any) -> None: @@ -79,22 +83,33 @@ def run( cfg = self._build_config(shared_data) - states_ua, states_res = self._dihedral_analysis.build_conformational_states( - data_container=u, - levels=levels, - groups=groups, - start=cfg.start, - end=cfg.end, - step=cfg.step, - bin_width=cfg.bin_width, - progress=progress, + states_ua, states_res, flexible_ua, flexible_res = ( + self._dihedral_analysis.build_conformational_states( + data_container=u, + levels=levels, + groups=groups, + start=cfg.start, + end=cfg.end, + step=cfg.step, + bin_width=cfg.bin_width, + progress=progress, + ) ) + # Get state information into shared_data conformational_states: ConformationalStates = { "ua": states_ua, "res": states_res, } shared_data["conformational_states"] = conformational_states + + # Get flexible_dihedral data into shared_data + flexible_states: FlexibleStates = { + "ua": flexible_ua, + "res": flexible_res, + } + shared_data["flexible_dihedrals"] = flexible_states + return {"conformational_states": conformational_states} @staticmethod diff --git a/CodeEntropy/levels/search.py b/CodeEntropy/levels/search.py index af172988..0e54e772 100644 --- a/CodeEntropy/levels/search.py +++ b/CodeEntropy/levels/search.py @@ -236,5 +236,6 @@ def get_grid_neighbors(self, universe, mol_id, highest_level): # Make sure that the neighbors list does not include # residues from the central molecule neighbors = search - fragment.residues + neighbors = neighbors.atoms return neighbors.fragindices diff --git a/tests/regression/baselines/benzaldehyde.json b/tests/regression/baselines/benzaldehyde.json index 54103991..9bd42510 100644 --- a/tests/regression/baselines/benzaldehyde.json +++ b/tests/regression/baselines/benzaldehyde.json @@ -1,12 +1,12 @@ { "args": { "top_traj_file": [ - "/home/tdo96567/BioSim/CodeEntropy/tests/data/benzaldehyde/molecules.top", - "/home/tdo96567/BioSim/CodeEntropy/tests/data/benzaldehyde/trajectory.crd" + "/home/ogo12949/CodeEntropy/.testdata/benzaldehyde/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/benzaldehyde/trajectory.crd" ], - "force_file": "/home/tdo96567/BioSim/CodeEntropy/tests/data/benzaldehyde/forces.frc", + "force_file": "/home/ogo12949/CodeEntropy/.testdata/benzaldehyde/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,30 +14,32 @@ "bin_width": 30, "temperature": 298.0, "verbose": false, - "output_file": "/tmp/pytest-of-tdo96567/pytest-60/test_regression_matches_baseli0/job001/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli1/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, - "customised_axes": true + "customised_axes": true, + "search_type": "grid" }, "provenance": { - "python": "3.14.0", - "platform": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", - "codeentropy_version": "1.0.7", - "git_sha": "226b37f7b206adba1b60253c41c7a0d467e75a58" + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { - "united_atom:Transvibrational": 158.90339720185818, - "united_atom:Rovibrational": 143.87250586343512, - "residue:FTmat-Transvibrational": 106.71035236014967, - "residue:FTmat-Rovibrational": 95.07735227595549, + "united_atom:Transvibrational": 24.88518233240474, + "united_atom:Rovibrational": 27.950376507672583, + "residue:FTmat-Transvibrational": 71.03412922724692, + "residue:FTmat-Rovibrational": 59.44169664956799, "united_atom:Conformational": 0.0, - "residue:Conformational": 0.0 + "residue:Conformational": 0.0, + "residue:Orientational": 59.5156759876787 }, - "total": 504.56360770139844 + "total": 242.82706070457093 } } } diff --git a/tests/regression/baselines/benzaldehyde_rad.json b/tests/regression/baselines/benzaldehyde_rad.json new file mode 100644 index 00000000..84070952 --- /dev/null +++ b/tests/regression/baselines/benzaldehyde_rad.json @@ -0,0 +1,45 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/benzaldehyde/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/benzaldehyde/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/benzaldehyde/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 298.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-1/test_regression_matches_baseli1/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 158.90339720185818, + "united_atom:Rovibrational": 143.87250586343512, + "residue:FTmat-Transvibrational": 106.71035236014967, + "residue:FTmat-Rovibrational": 95.07735227595549, + "united_atom:Conformational": 0.0, + "residue:Conformational": 0.0, + "residue:Orientational": 25.3107189764825 + }, + "total": 529.874326677881 + } + } +} diff --git a/tests/regression/baselines/benzene.json b/tests/regression/baselines/benzene.json index 3517db61..488248b5 100644 --- a/tests/regression/baselines/benzene.json +++ b/tests/regression/baselines/benzene.json @@ -1,12 +1,12 @@ { "args": { "top_traj_file": [ - "/home/tdo96567/BioSim/CodeEntropy/tests/data/benzene/molecules.top", - "/home/tdo96567/BioSim/CodeEntropy/tests/data/benzene/trajectory.crd" + "/home/ogo12949/CodeEntropy/.testdata/benzene/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/benzene/trajectory.crd" ], - "force_file": "/home/tdo96567/BioSim/CodeEntropy/tests/data/benzene/forces.frc", + "force_file": "/home/ogo12949/CodeEntropy/.testdata/benzene/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,30 +14,32 @@ "bin_width": 30, "temperature": 298.0, "verbose": false, - "output_file": "/tmp/pytest-of-tdo96567/pytest-64/test_regression_matches_baseli0/job001/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli2/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, - "customised_axes": true + "customised_axes": true, + "search_type": "grid" }, "provenance": { - "python": "3.14.0", - "platform": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", - "codeentropy_version": "1.0.7", - "git_sha": "226b37f7b206adba1b60253c41c7a0d467e75a58" + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { - "united_atom:Transvibrational": 93.55450341182438, - "united_atom:Rovibrational": 143.68264201362132, - "residue:FTmat-Transvibrational": 108.34125737284016, - "residue:FTmat-Rovibrational": 95.57598285903227, + "united_atom:Transvibrational": 9.081853431559052, + "united_atom:Rovibrational": 27.534380126250227, + "residue:FTmat-Transvibrational": 72.66211800013413, + "residue:FTmat-Rovibrational": 59.93761874375924, "united_atom:Conformational": 0.0, - "residue:Conformational": 0.0 + "residue:Conformational": 0.0, + "residue:Orientational": 41.237966715197246 }, - "total": 441.15438565731813 + "total": 210.45393701689989 } } } diff --git a/tests/regression/baselines/benzene_rad.json b/tests/regression/baselines/benzene_rad.json new file mode 100644 index 00000000..7b5e159f --- /dev/null +++ b/tests/regression/baselines/benzene_rad.json @@ -0,0 +1,45 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/benzene/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/benzene/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/benzene/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 298.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-1/test_regression_matches_baseli2/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 93.55450341182438, + "united_atom:Rovibrational": 143.68264201362132, + "residue:FTmat-Transvibrational": 108.34125737284016, + "residue:FTmat-Rovibrational": 95.57598285903227, + "united_atom:Conformational": 0.0, + "residue:Conformational": 0.0, + "residue:Orientational": 12.282076945243183 + }, + "total": 453.43646260256133 + } + } +} diff --git a/tests/regression/baselines/cyclohexane.json b/tests/regression/baselines/cyclohexane.json index aea6f560..eabf7d83 100644 --- a/tests/regression/baselines/cyclohexane.json +++ b/tests/regression/baselines/cyclohexane.json @@ -1,12 +1,12 @@ { "args": { "top_traj_file": [ - "/home/tdo96567/BioSim/CodeEntropy/tests/data/cyclohexane/molecules.top", - "/home/tdo96567/BioSim/CodeEntropy/tests/data/cyclohexane/trajectory.crd" + "/home/ogo12949/CodeEntropy/.testdata/cyclohexane/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/cyclohexane/trajectory.crd" ], - "force_file": "/home/tdo96567/BioSim/CodeEntropy/tests/data/cyclohexane/forces.frc", + "force_file": "/home/ogo12949/CodeEntropy/.testdata/cyclohexane/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,30 +14,32 @@ "bin_width": 30, "temperature": 298.0, "verbose": false, - "output_file": "/tmp/pytest-of-tdo96567/pytest-60/test_regression_matches_baseli2/job001/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli3/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, - "customised_axes": true + "customised_axes": true, + "search_type": "grid" }, "provenance": { - "python": "3.14.0", - "platform": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", - "codeentropy_version": "1.0.7", - "git_sha": "226b37f7b206adba1b60253c41c7a0d467e75a58" + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { - "united_atom:Transvibrational": 109.02761125847158, - "united_atom:Rovibrational": 227.2888326629934, - "residue:FTmat-Transvibrational": 106.06698045971194, - "residue:FTmat-Rovibrational": 99.10449330958527, + "united_atom:Transvibrational": 11.726471858700231, + "united_atom:Rovibrational": 47.71088602161552, + "residue:FTmat-Transvibrational": 70.3922327806972, + "residue:FTmat-Rovibrational": 63.44920824648768, "united_atom:Conformational": 0.0, - "residue:Conformational": 0.0 + "residue:Conformational": 0.0, + "residue:Orientational": 47.30759597445523 }, - "total": 541.4879176907622 + "total": 240.58639488195587 } } } diff --git a/tests/regression/baselines/cylcohexane_rad.json b/tests/regression/baselines/cylcohexane_rad.json new file mode 100644 index 00000000..928da296 --- /dev/null +++ b/tests/regression/baselines/cylcohexane_rad.json @@ -0,0 +1,45 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/cyclohexane/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/cyclohexane/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/cyclohexane/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 298.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-1/test_regression_matches_baseli3/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 109.02761125847158, + "united_atom:Rovibrational": 227.2888326629934, + "residue:FTmat-Transvibrational": 106.06698045971194, + "residue:FTmat-Rovibrational": 99.10449330958527, + "united_atom:Conformational": 0.0, + "residue:Conformational": 0.0, + "residue:Orientational": 13.963860657362106 + }, + "total": 555.4517783481243 + } + } +} diff --git a/tests/regression/baselines/dna.json b/tests/regression/baselines/dna.json index ab5a1e04..40d0fd35 100644 --- a/tests/regression/baselines/dna.json +++ b/tests/regression/baselines/dna.json @@ -24,9 +24,9 @@ }, "provenance": { "python": "3.13.5", - "platform": "Linux-6.17.0-1011-oem-x86_64-with-glibc2.39", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", "codeentropy_version": "2.0.0", - "git_sha": "44bd758498dfdd07eb391ee86e6ff2d86ea2bcb8" + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { diff --git a/tests/regression/baselines/ethyl-acetate.json b/tests/regression/baselines/ethyl-acetate.json index e9614b14..99886497 100644 --- a/tests/regression/baselines/ethyl-acetate.json +++ b/tests/regression/baselines/ethyl-acetate.json @@ -1,12 +1,12 @@ { "args": { "top_traj_file": [ - "/home/tdo96567/BioSim/CodeEntropy/tests/data/ethyl-acetate/molecules.top", - "/home/tdo96567/BioSim/CodeEntropy/tests/data/ethyl-acetate/trajectory.crd" + "/home/ogo12949/CodeEntropy/.testdata/ethyl-acetate/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/ethyl-acetate/trajectory.crd" ], - "force_file": "/home/tdo96567/BioSim/CodeEntropy/tests/data/ethyl-acetate/forces.frc", + "force_file": "/home/ogo12949/CodeEntropy/.testdata/ethyl-acetate/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,30 +14,32 @@ "bin_width": 30, "temperature": 298.0, "verbose": false, - "output_file": "/tmp/pytest-of-tdo96567/pytest-60/test_regression_matches_baseli4/job001/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli4/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, - "customised_axes": true + "customised_axes": true, + "search_type": "grid" }, "provenance": { - "python": "3.14.0", - "platform": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", - "codeentropy_version": "1.0.7", - "git_sha": "226b37f7b206adba1b60253c41c7a0d467e75a58" + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { - "united_atom:Transvibrational": 119.77870290196522, - "united_atom:Rovibrational": 144.2366436580796, - "residue:FTmat-Transvibrational": 103.5819666889598, - "residue:FTmat-Rovibrational": 95.68311953660015, + "united_atom:Transvibrational": 20.24374894231227, + "united_atom:Rovibrational": 49.35007067210558, + "residue:FTmat-Transvibrational": 67.91350627765567, + "residue:FTmat-Rovibrational": 60.042233035077246, "united_atom:Conformational": 8.140778318198597, - "residue:Conformational": 0.0 + "residue:Conformational": 0.0, + "residue:Orientational": 65.3684992300889 }, - "total": 471.4212111038034 + "total": 271.0588364754383 } } } diff --git a/tests/regression/baselines/ethyl-acetate_rad.json b/tests/regression/baselines/ethyl-acetate_rad.json new file mode 100644 index 00000000..269a24d4 --- /dev/null +++ b/tests/regression/baselines/ethyl-acetate_rad.json @@ -0,0 +1,45 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/ethyl-acetate/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/ethyl-acetate/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/ethyl-acetate/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 298.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-1/test_regression_matches_baseli4/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 124.52960172835098, + "united_atom:Rovibrational": 144.2366436580796, + "residue:FTmat-Transvibrational": 103.5819666889598, + "residue:FTmat-Rovibrational": 95.68311953660015, + "united_atom:Conformational": 8.140778318198597, + "residue:Conformational": 0.0, + "residue:Orientational": 30.894081870911737 + }, + "total": 507.0661918011009 + } + } +} diff --git a/tests/regression/baselines/methane.json b/tests/regression/baselines/methane.json index b509917a..6d1bbce5 100644 --- a/tests/regression/baselines/methane.json +++ b/tests/regression/baselines/methane.json @@ -6,7 +6,7 @@ ], "force_file": "/home/ogo12949/CodeEntropy/.testdata/methane/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,29 +14,29 @@ "bin_width": 30, "temperature": 112.0, "verbose": false, - "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli1/job001/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli5/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, "customised_axes": true, - "search_type": "RAD" + "search_type": "grid" }, "provenance": { "python": "3.13.5", - "platform": "Linux-6.17.0-1011-oem-x86_64-with-glibc2.39", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", "codeentropy_version": "2.0.0", - "git_sha": "44bd758498dfdd07eb391ee86e6ff2d86ea2bcb8" + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { - "united_atom:Transvibrational": 75.73291215434239, - "united_atom:Rovibrational": 68.80103728327107, + "united_atom:Transvibrational": 40.3239711717637, + "united_atom:Rovibrational": 33.60582165153992, "united_atom:Conformational": 0.0, - "united_atom:Orientational": 5.499485304173264 + "united_atom:Orientational": 3.6608703176607116 }, - "total": 150.03343474178672 + "total": 77.59066314096432 } } } diff --git a/tests/regression/baselines/methane_rad.json b/tests/regression/baselines/methane_rad.json new file mode 100644 index 00000000..7891d7af --- /dev/null +++ b/tests/regression/baselines/methane_rad.json @@ -0,0 +1,42 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/methane/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/methane/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/methane/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 112.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-1/test_regression_matches_baseli5/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 75.73291215434239, + "united_atom:Rovibrational": 68.80103728327107, + "united_atom:Conformational": 0.0, + "united_atom:Orientational": 6.742734054179628 + }, + "total": 151.27668349179308 + } + } +} diff --git a/tests/regression/baselines/methanol.json b/tests/regression/baselines/methanol.json index 62ae94c7..782d9ef0 100644 --- a/tests/regression/baselines/methanol.json +++ b/tests/regression/baselines/methanol.json @@ -6,7 +6,7 @@ ], "force_file": "/home/ogo12949/CodeEntropy/.testdata/methanol/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,32 +14,32 @@ "bin_width": 30, "temperature": 298.0, "verbose": false, - "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli2/job001/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli6/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, "customised_axes": true, - "search_type": "RAD" + "search_type": "grid" }, "provenance": { "python": "3.13.5", - "platform": "Linux-6.17.0-1011-oem-x86_64-with-glibc2.39", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", "codeentropy_version": "2.0.0", - "git_sha": "44bd758498dfdd07eb391ee86e6ff2d86ea2bcb8" + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { "united_atom:Transvibrational": 0.0, - "united_atom:Rovibrational": 85.74870264018092, - "residue:FTmat-Transvibrational": 93.59616431728384, - "residue:FTmat-Rovibrational": 59.61417719536213, + "united_atom:Rovibrational": 31.71683454772323, + "residue:FTmat-Transvibrational": 57.967437606219264, + "residue:FTmat-Rovibrational": 32.05829756161347, "united_atom:Conformational": 0.0, "residue:Conformational": 0.0, - "residue:Orientational": 16.370329454731248 + "residue:Orientational": 31.476329452223162 }, - "total": 255.32937360755813 + "total": 153.2188991677791 } } } diff --git a/tests/regression/baselines/methanol_rad.json b/tests/regression/baselines/methanol_rad.json new file mode 100644 index 00000000..63881816 --- /dev/null +++ b/tests/regression/baselines/methanol_rad.json @@ -0,0 +1,45 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/methanol/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/methanol/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/methanol/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 298.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-1/test_regression_matches_baseli6/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 0.0, + "united_atom:Rovibrational": 85.74870264018092, + "residue:FTmat-Transvibrational": 93.59616431728384, + "residue:FTmat-Rovibrational": 59.61417719536213, + "united_atom:Conformational": 0.0, + "residue:Conformational": 0.0, + "residue:Orientational": 17.099561921032407 + }, + "total": 256.0586060738593 + } + } +} diff --git a/tests/regression/baselines/octonal_rad.json b/tests/regression/baselines/octonal_rad.json new file mode 100644 index 00000000..3be148b0 --- /dev/null +++ b/tests/regression/baselines/octonal_rad.json @@ -0,0 +1,45 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/octonol/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/octonol/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/octonol/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 298.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-1/test_regression_matches_baseli7/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 254.7961136639108, + "united_atom:Rovibrational": 345.86413400118744, + "residue:FTmat-Transvibrational": 101.79847675768119, + "residue:FTmat-Rovibrational": 92.71423842383722, + "united_atom:Conformational": 20.4159084259166, + "residue:Conformational": 0.0, + "residue:Orientational": 28.13775462144063 + }, + "total": 843.726625893974 + } + } +} diff --git a/tests/regression/baselines/octonol.json b/tests/regression/baselines/octonol.json index 1856b344..b0cb7171 100644 --- a/tests/regression/baselines/octonol.json +++ b/tests/regression/baselines/octonol.json @@ -1,12 +1,12 @@ { "args": { "top_traj_file": [ - "/home/tdo96567/BioSim/CodeEntropy/tests/data/octonol/molecules.top", - "/home/tdo96567/BioSim/CodeEntropy/tests/data/octonol/trajectory.crd" + "/home/ogo12949/CodeEntropy/.testdata/octonol/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/octonol/trajectory.crd" ], - "force_file": "/home/tdo96567/BioSim/CodeEntropy/tests/data/octonol/forces.frc", + "force_file": "/home/ogo12949/CodeEntropy/.testdata/octonol/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,30 +14,32 @@ "bin_width": 30, "temperature": 298.0, "verbose": false, - "output_file": "/tmp/pytest-of-tdo96567/pytest-65/test_regression_matches_baseli0/job001/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli7/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, - "customised_axes": true + "customised_axes": true, + "search_type": "grid" }, "provenance": { - "python": "3.14.0", - "platform": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", - "codeentropy_version": "1.0.7", - "git_sha": "226b37f7b206adba1b60253c41c7a0d467e75a58" + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { - "united_atom:Transvibrational": 222.4800037654818, - "united_atom:Rovibrational": 345.86413400118744, - "residue:FTmat-Transvibrational": 101.79847675768119, - "residue:FTmat-Rovibrational": 92.71423842383722, + "united_atom:Transvibrational": 50.77228933028987, + "united_atom:Rovibrational": 84.2608785308744, + "residue:FTmat-Transvibrational": 66.13571365167344, + "residue:FTmat-Rovibrational": 57.090651827515686, "united_atom:Conformational": 20.4159084259166, - "residue:Conformational": 0.0 + "residue:Conformational": 0.0, + "residue:Orientational": 74.85579414765692 }, - "total": 783.2727613741043 + "total": 353.5312359139269 } } } diff --git a/tests/regression/baselines/water.json b/tests/regression/baselines/water.json index 0199ecc7..a74acd58 100644 --- a/tests/regression/baselines/water.json +++ b/tests/regression/baselines/water.json @@ -1,12 +1,12 @@ { "args": { "top_traj_file": [ - "../../test_data/Liquids_simulation_data/GAFF/water/molecules.top", - "../../test_data/Liquids_simulation_data/GAFF/water/trajectory.crd" + "/home/ogo12949/CodeEntropy/.testdata/water/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/water/trajectory.crd" ], - "force_file": "../../test_data/Liquids_simulation_data/GAFF/water/forces.frc", + "force_file": "/home/ogo12949/CodeEntropy/.testdata/water/forces.frc", "file_format": "MDCRD", - "kcal_force_units": false, + "kcal_force_units": true, "selection_string": "all", "start": 0, "end": 1, @@ -14,27 +14,29 @@ "bin_width": 30, "temperature": 298.0, "verbose": false, - "output_file": "/home/tdo96567/BioSim/temp/water/job008/output_file.json", + "output_file": "/tmp/pytest-of-ogo12949/pytest-5/test_regression_matches_baseli8/job001/output_file.json", "force_partitioning": 0.5, "water_entropy": true, "grouping": "molecules", "combined_forcetorque": true, - "customised_axes": true + "customised_axes": true, + "search_type": "grid" }, "provenance": { - "python": "3.14.0", - "platform": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", "codeentropy_version": "2.0.0", - "git_sha": "cba3d8ea4118e00b25ee5a58d7ba951e4894b5c0" + "git_sha": "697cc5da0af766f2f69b0fa31254f2ce7b2b1141" }, "groups": { "0": { "components": { - "united_atom:Transvibrational": 79.20298312418278, - "united_atom:Rovibrational": 50.90260688502127, - "united_atom:Conformational": 0.0 + "united_atom:Transvibrational": 43.725393337304425, + "united_atom:Rovibrational": 17.28911070147887, + "united_atom:Conformational": 0.0, + "united_atom:Orientational": 32.00715225476484 }, - "total": 130.10559000920404 + "total": 93.02165629354813 } } } diff --git a/tests/regression/baselines/water_rad.json b/tests/regression/baselines/water_rad.json new file mode 100644 index 00000000..7e03e61d --- /dev/null +++ b/tests/regression/baselines/water_rad.json @@ -0,0 +1,42 @@ +{ + "args": { + "top_traj_file": [ + "/home/ogo12949/CodeEntropy/.testdata/water/molecules.top", + "/home/ogo12949/CodeEntropy/.testdata/water/trajectory.crd" + ], + "force_file": "/home/ogo12949/CodeEntropy/.testdata/water/forces.frc", + "file_format": "MDCRD", + "kcal_force_units": false, + "selection_string": "all", + "start": 0, + "end": 1, + "step": 1, + "bin_width": 30, + "temperature": 298.0, + "verbose": false, + "output_file": "/tmp/pytest-of-ogo12949/pytest-2/test_regression_matches_baseli0/job001/output_file.json", + "force_partitioning": 0.5, + "water_entropy": true, + "grouping": "molecules", + "combined_forcetorque": true, + "customised_axes": true, + "search_type": "RAD" + }, + "provenance": { + "python": "3.13.5", + "platform": "Linux-6.17.0-1012-oem-x86_64-with-glibc2.39", + "codeentropy_version": "2.0.0", + "git_sha": "3143bcbea9717e13135f61c00e6a0efa7814f82f" + }, + "groups": { + "0": { + "components": { + "united_atom:Transvibrational": 79.20298312418278, + "united_atom:Rovibrational": 50.90260688502127, + "united_atom:Conformational": 0.0, + "united_atom:Orientational": 22.599402683404527 + }, + "total": 152.70499269260856 + } + } +} diff --git a/tests/regression/configs/benzaldehyde/config.yaml b/tests/regression/configs/benzaldehyde/config.yaml index 40a9f932..fd60e442 100644 --- a/tests/regression/configs/benzaldehyde/config.yaml +++ b/tests/regression/configs/benzaldehyde/config.yaml @@ -10,3 +10,5 @@ run1: end: 1 step: 1 file_format: "MDCRD" + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/benzaldehyde_rad/config.yaml b/tests/regression/configs/benzaldehyde_rad/config.yaml new file mode 100644 index 00000000..455599b0 --- /dev/null +++ b/tests/regression/configs/benzaldehyde_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/benzaldehyde/forces.frc" + top_traj_file: + - ".testdata/benzaldehyde/molecules.top" + - ".testdata/benzaldehyde/trajectory.crd" + selection_string: "all" + start: 0 + end: 1 + step: 1 + file_format: "MDCRD" +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/regression/configs/benzene/config.yaml b/tests/regression/configs/benzene/config.yaml index 204e19f2..611e6934 100644 --- a/tests/regression/configs/benzene/config.yaml +++ b/tests/regression/configs/benzene/config.yaml @@ -10,3 +10,5 @@ run1: end: 1 step: 1 file_format: 'MDCRD' + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/benzene_rad/config.yaml b/tests/regression/configs/benzene_rad/config.yaml new file mode 100644 index 00000000..e3862947 --- /dev/null +++ b/tests/regression/configs/benzene_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/benzene/forces.frc" + top_traj_file: + - ".testdata/benzene/molecules.top" + - ".testdata/benzene/trajectory.crd" + selection_string: 'all' + start: 0 + end: 1 + step: 1 + file_format: 'MDCRD' +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/regression/configs/cyclohexane/config.yaml b/tests/regression/configs/cyclohexane/config.yaml index cadb32b3..8c8560f1 100644 --- a/tests/regression/configs/cyclohexane/config.yaml +++ b/tests/regression/configs/cyclohexane/config.yaml @@ -10,3 +10,5 @@ run1: end: 1 step: 1 file_format: 'MDCRD' + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/cyclohexane_rad/config.yaml b/tests/regression/configs/cyclohexane_rad/config.yaml new file mode 100644 index 00000000..1fa78cbe --- /dev/null +++ b/tests/regression/configs/cyclohexane_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/cyclohexane/forces.frc" + top_traj_file: + - ".testdata/cyclohexane/molecules.top" + - ".testdata/cyclohexane/trajectory.crd" + selection_string: 'all' + start: 0 + end: 1 + step: 1 + file_format: 'MDCRD' +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/regression/configs/ethyl-acetate/config.yaml b/tests/regression/configs/ethyl-acetate/config.yaml index 84d53a1a..d6d29694 100644 --- a/tests/regression/configs/ethyl-acetate/config.yaml +++ b/tests/regression/configs/ethyl-acetate/config.yaml @@ -10,3 +10,5 @@ run1: end: 1 step: 1 file_format: 'MDCRD' + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/ethyl-acetate_rad/config.yaml b/tests/regression/configs/ethyl-acetate_rad/config.yaml new file mode 100644 index 00000000..df09dfe4 --- /dev/null +++ b/tests/regression/configs/ethyl-acetate_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/ethyl-acetate/forces.frc" + top_traj_file: + - ".testdata/ethyl-acetate/molecules.top" + - ".testdata/ethyl-acetate/trajectory.crd" + selection_string: 'all' + start: 0 + end: 1 + step: 1 + file_format: 'MDCRD' +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/regression/configs/methane/config.yaml b/tests/regression/configs/methane/config.yaml index c7bd75d5..59bba083 100644 --- a/tests/regression/configs/methane/config.yaml +++ b/tests/regression/configs/methane/config.yaml @@ -5,9 +5,11 @@ run1: top_traj_file: - ".testdata/methane/molecules.top" - ".testdata/methane/trajectory.crd" - selection_string: all + selection_string: "all" start: 0 end: 1 step: 1 - file_format: MDCRD + file_format: "MDCRD" temperature: 112.0 + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/methane_rad/config.yaml b/tests/regression/configs/methane_rad/config.yaml new file mode 100644 index 00000000..10e3ea39 --- /dev/null +++ b/tests/regression/configs/methane_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/methane/forces.frc" + top_traj_file: + - ".testdata/methane/molecules.top" + - ".testdata/methane/trajectory.crd" + selection_string: "all" + start: 0 + step: 1 + end: 1 + file_format: "MDCRD" +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/regression/configs/methanol/config.yaml b/tests/regression/configs/methanol/config.yaml index 52ad6c77..9b7ee6f9 100644 --- a/tests/regression/configs/methanol/config.yaml +++ b/tests/regression/configs/methanol/config.yaml @@ -10,3 +10,5 @@ run1: end: 1 step: 1 file_format: 'MDCRD' + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/methanol_rad/config.yaml b/tests/regression/configs/methanol_rad/config.yaml new file mode 100644 index 00000000..1629654a --- /dev/null +++ b/tests/regression/configs/methanol_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/methanol/forces.frc" + top_traj_file: + - ".testdata/methanol/molecules.top" + - ".testdata/methanol/trajectory.crd" + selection_string: 'all' + start: 0 + end: 1 + step: 1 + file_format: 'MDCRD' +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/regression/configs/octonol/config.yaml b/tests/regression/configs/octonol/config.yaml index 29b31c06..926d03f1 100644 --- a/tests/regression/configs/octonol/config.yaml +++ b/tests/regression/configs/octonol/config.yaml @@ -10,3 +10,5 @@ run1: end: 1 step: 1 file_format: 'MDCRD' + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/octonol_rad/config.yaml b/tests/regression/configs/octonol_rad/config.yaml new file mode 100644 index 00000000..918f8c25 --- /dev/null +++ b/tests/regression/configs/octonol_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/octonol/forces.frc" + top_traj_file: + - ".testdata/octonol/molecules.top" + - ".testdata/octonol/trajectory.crd" + selection_string: 'all' + start: 0 + end: 1 + step: 1 + file_format: 'MDCRD' +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/regression/configs/water/config.yaml b/tests/regression/configs/water/config.yaml index 2197e421..37c39f12 100644 --- a/tests/regression/configs/water/config.yaml +++ b/tests/regression/configs/water/config.yaml @@ -10,3 +10,5 @@ run1: step: 1 end: 1 file_format: "MDCRD" + kcal_force_units: True + search_type: "grid" diff --git a/tests/regression/configs/water_rad/config.yaml b/tests/regression/configs/water_rad/config.yaml new file mode 100644 index 00000000..abd388db --- /dev/null +++ b/tests/regression/configs/water_rad/config.yaml @@ -0,0 +1,14 @@ +--- + +run1: + force_file: ".testdata/water/forces.frc" + top_traj_file: + - ".testdata/water/molecules.top" + - ".testdata/water/trajectory.crd" + selection_string: "all" + start: 0 + step: 1 + end: 1 + file_format: "MDCRD" +# kcal_force_units: True + search_type: "RAD" diff --git a/tests/unit/CodeEntropy/entropy/nodes/test_vibrational_node.py b/tests/unit/CodeEntropy/entropy/nodes/test_vibrational_node.py index 45f2d05e..e352b846 100644 --- a/tests/unit/CodeEntropy/entropy/nodes/test_vibrational_node.py +++ b/tests/unit/CodeEntropy/entropy/nodes/test_vibrational_node.py @@ -22,6 +22,7 @@ def shared_data_base(): "reduced_universe": reduced_universe, "force_covariances": {"ua": {}, "res": [], "poly": []}, "torque_covariances": {"ua": {}, "res": [], "poly": []}, + "flexible_dihedrals": {"ua": 0, "res": [0]}, "n_frames": 5, "reporter": MagicMock(), } @@ -42,6 +43,7 @@ def shared_groups(): "reduced_universe": ru, "force_covariances": {"ua": {}, "res": [], "poly": []}, "torque_covariances": {"ua": {}, "res": [], "poly": []}, + "flexible_dihedrals": {"ua": [], "res": []}, "n_frames": 5, "reporter": MagicMock(), } @@ -131,6 +133,7 @@ def test_run_raises_on_unknown_level(shared_data, monkeypatch): shared_data["force_covariances"] = {"ua": {}, "res": [], "poly": []} shared_data["torque_covariances"] = {"ua": {}, "res": [], "poly": []} + shared_data["flexible_dihedrals"] = {"ua": [], "res": []} with pytest.raises(ValueError): node.run(shared_data) @@ -143,6 +146,7 @@ def test_run_united_atom_branch_stores_results(shared_data, monkeypatch): shared_data["groups"] = {0: [0]} shared_data["force_covariances"] = {"ua": {}, "res": [], "poly": []} shared_data["torque_covariances"] = {"ua": {}, "res": [], "poly": []} + shared_data["flexible_dihedrals"] = {"ua": [], "res": []} fake_pair = MagicMock(trans=1.0, rot=2.0) monkeypatch.setattr( @@ -164,6 +168,7 @@ def test_unknown_level_raises(shared_data): shared_data["groups"] = {0: [0]} shared_data["force_covariances"] = {"ua": {}, "res": [], "poly": []} shared_data["torque_covariances"] = {"ua": {}, "res": [], "poly": []} + shared_data["flexible_dihedrals"] = {"ua": [], "res": []} with pytest.raises(ValueError): node.run(shared_data) @@ -177,6 +182,7 @@ def test_polymer_branch_executes(shared_data, monkeypatch): shared_data["force_covariances"] = {"ua": {}, "res": [], "poly": [MagicMock()]} shared_data["torque_covariances"] = {"ua": {}, "res": [], "poly": [MagicMock()]} + shared_data["flexible_dihedrals"] = {"ua": [], "res": []} shared_data["reduced_universe"].atoms.fragments = [MagicMock(residues=[])] @@ -205,6 +211,7 @@ def test_run_skips_empty_mol_ids_group(): "reduced_universe": MagicMock(atoms=MagicMock(fragments=[])), "force_covariances": {"ua": {}, "res": [], "poly": []}, "torque_covariances": {"ua": {}, "res": [], "poly": []}, + "flexible_dihedrals": {"ua": [], "res": []}, "n_frames": 5, "reporter": None, } @@ -235,6 +242,7 @@ def test_compute_united_atom_entropy_logs_residue_data_when_reporter_present(): residues=residues, force_ua={}, torque_ua={}, + flexible_ua={(7, 0): 0, (7, 1): 0}, ua_frame_counts={(7, 0): 3, (7, 1): 4}, reporter=reporter, n_frames_default=10, @@ -255,6 +263,7 @@ def test_compute_force_torque_entropy_success_calls_vibrational_engine(): temp=298.0, fmat=np.eye(3), tmat=np.eye(3), + flexible=0, highest=False, ) @@ -267,7 +276,7 @@ def test_compute_ft_entropy_success_calls_vibrational_engine_for_trans_and_rot() ve = MagicMock() ve.vibrational_entropy_calculation.side_effect = [1.5, 2.5] - out = node._compute_ft_entropy(ve=ve, temp=298.0, ftmat=np.eye(6)) + out = node._compute_ft_entropy(ve=ve, temp=298.0, ftmat=np.eye(6), flexible=0) assert out == EntropyPair(trans=1.5, rot=2.5) assert ve.vibrational_entropy_calculation.call_count == 2 @@ -312,7 +321,7 @@ def test_compute_force_torque_entropy_returns_zero_when_missing_matrix(shared_gr node = VibrationalEntropyNode() ve = MagicMock() pair = node._compute_force_torque_entropy( - ve=ve, temp=298.0, fmat=None, tmat=np.eye(3), highest=True + ve=ve, temp=298.0, fmat=None, tmat=np.eye(3), flexible=0, highest=True ) assert pair == EntropyPair(trans=0.0, rot=0.0) @@ -326,7 +335,7 @@ def test_compute_force_torque_entropy_returns_zero_when_filter_removes_all(monke ) pair = node._compute_force_torque_entropy( - ve=ve, temp=298.0, fmat=np.eye(3), tmat=np.eye(3), highest=True + ve=ve, temp=298.0, fmat=np.eye(3), tmat=np.eye(3), flexible=0, highest=True ) assert pair == EntropyPair(trans=0.0, rot=0.0) @@ -334,9 +343,9 @@ def test_compute_force_torque_entropy_returns_zero_when_filter_removes_all(monke def test_compute_ft_entropy_returns_zero_when_none(): node = VibrationalEntropyNode() ve = MagicMock() - assert node._compute_ft_entropy(ve=ve, temp=298.0, ftmat=None) == EntropyPair( - trans=0.0, rot=0.0 - ) + assert node._compute_ft_entropy( + ve=ve, temp=298.0, ftmat=None, flexible=0 + ) == EntropyPair(trans=0.0, rot=0.0) def test_log_molecule_level_results_ft_labels_branch(): @@ -376,7 +385,7 @@ def test_compute_ft_entropy_returns_zeros_when_filtered_ft_matrix_is_empty(monke lambda _arr, atol: np.empty((0, 0), dtype=float), ) - out = node._compute_ft_entropy(ve=ve, temp=298.0, ftmat=np.eye(6)) + out = node._compute_ft_entropy(ve=ve, temp=298.0, ftmat=np.eye(6), flexible=0) assert out == EntropyPair(trans=0.0, rot=0.0) ve.vibrational_entropy_calculation.assert_not_called() diff --git a/tests/unit/CodeEntropy/entropy/test_vibrational_entropy_math.py b/tests/unit/CodeEntropy/entropy/test_vibrational_entropy_math.py index 43fb8e04..2554571c 100644 --- a/tests/unit/CodeEntropy/entropy/test_vibrational_entropy_math.py +++ b/tests/unit/CodeEntropy/entropy/test_vibrational_entropy_math.py @@ -47,7 +47,7 @@ def test_entropy_components_returns_empty_when_all_invalid(run_manager): ve = VibrationalEntropy(run_manager=run_manager) ve._matrix_eigenvalues = lambda m: np.array([-1.0, 0.0, 0.0]) - comps = ve._entropy_components(np.eye(3), temp=298.0) + comps = ve._entropy_components(np.eye(3), temp=298.0, matrix_type="", flexible=0) assert comps.size == 0 @@ -154,8 +154,17 @@ def test_vibrational_entropy_calculation_end_to_end_returns_float( ) out = ve.vibrational_entropy_calculation( - np.eye(3), matrix_type="torque", temp=298.0, highest_level=False + np.eye(3), matrix_type="torque", temp=298.0, highest_level=False, flexible=0 ) assert isinstance(out, float) assert out >= 0.0 + + +def test_flexible_dihedral(run_manager): + ve = VibrationalEntropy(run_manager=run_manager) + lambdas = [2.0, 3.0, 4.0] + flexible = 2 + lambdas = ve._flexible_dihedral(lambdas, flexible) + + assert lambdas == [1.0, 0.75, 2.0] diff --git a/tests/unit/CodeEntropy/levels/nodes/test_conformations_node.py b/tests/unit/CodeEntropy/levels/nodes/test_conformations_node.py index a03fb555..85f145f7 100644 --- a/tests/unit/CodeEntropy/levels/nodes/test_conformations_node.py +++ b/tests/unit/CodeEntropy/levels/nodes/test_conformations_node.py @@ -9,7 +9,7 @@ def test_compute_conformational_states_node_runs_and_writes_shared_data(): node = ComputeConformationalStatesNode(universe_operations=uops) node._dihedral_analysis.build_conformational_states = MagicMock( - return_value=({"ua_key": ["0", "1"]}, [["00", "01"]]) + return_value=({"ua_key": ["0", "1"]}, [["00", "01"]], {"ua_key": [0]}, [0]) ) shared = { diff --git a/tests/unit/CodeEntropy/levels/test_dihedrals.py b/tests/unit/CodeEntropy/levels/test_dihedrals.py index 8ea0f1fe..6590ecf7 100644 --- a/tests/unit/CodeEntropy/levels/test_dihedrals.py +++ b/tests/unit/CodeEntropy/levels/test_dihedrals.py @@ -209,7 +209,7 @@ def run(self): return SimpleNamespace(results=SimpleNamespace(angles=angles)) with patch("CodeEntropy.levels.dihedrals.Dihedral", _FakeDihedral): - states = dt._assign_states( + states, num_flexible = dt._assign_states( data_container=MagicMock(), molecules=[0, 1], dihedrals=["D0"], @@ -220,6 +220,7 @@ def run(self): ) assert states == ["0", "1", "0", "1"] + assert num_flexible == 1 def test_assign_states_for_group_sets_empty_lists_and_delegates_for_nonempty(): @@ -227,8 +228,10 @@ def test_assign_states_for_group_sets_empty_lists_and_delegates_for_nonempty(): states_ua = {} states_res = [None, None] + flexible_ua = {} + flexible_res = [None, None] - with patch.object(dt, "_assign_states", return_value=["x"]) as assign_spy: + with patch.object(dt, "_assign_states", return_value=[["x"], 0]) as assign_spy: dt._assign_states_for_group( data_container=MagicMock(), group_id=1, @@ -243,11 +246,15 @@ def test_assign_states_for_group_sets_empty_lists_and_delegates_for_nonempty(): level_list=["united_atom", "residue"], states_ua=states_ua, states_res=states_res, + flexible_ua=flexible_ua, + flexible_res=flexible_res, ) assert states_ua[(1, 0)] == [] assert states_ua[(1, 1)] == ["x"] assert states_res[1] == [] + assert flexible_ua == {(1, 0): 0, (1, 1): 0} + assert flexible_res == [None, 0] assert assign_spy.call_count == 1 @@ -264,7 +271,7 @@ def test_build_conformational_states_runs_group_and_skips_empty_group(monkeypatc monkeypatch.setattr(dt, "_collect_peaks_for_group", lambda **kw: ([], [])) monkeypatch.setattr(dt, "_assign_states_for_group", lambda **kw: None) - states_ua, states_res = dt.build_conformational_states( + states_ua, states_res, flex_ua, flex_res = dt.build_conformational_states( data_container=MagicMock(), levels=levels, groups=groups, @@ -276,6 +283,8 @@ def test_build_conformational_states_runs_group_and_skips_empty_group(monkeypatc assert states_ua == {} assert len(states_res) == 2 + assert flex_ua == {} + assert flex_res == [0, 0] def test_identify_peaks_handles_multiple_dihedrals_and_calls_histogram_each_time(): @@ -337,7 +346,7 @@ def run(self): return SimpleNamespace(results=SimpleNamespace(angles=[])) with patch("CodeEntropy.levels.dihedrals.Dihedral", _FakeDihedral): - out = dt._assign_states( + out_state, out_flex = dt._assign_states( data_container=MagicMock(), molecules=[0], dihedrals=[], @@ -347,7 +356,8 @@ def run(self): step=1, ) - assert out == [] + assert out_state == [] + assert out_flex == 0 def test_identify_peaks_multiple_molecules_real_histogram(): @@ -420,8 +430,10 @@ def test_assign_states_for_group_residue_nonempty_calls_assign_states(): states_ua = {} states_res = [None, None] + flexible_ua = {} + flexible_res = [None, None] - with patch.object(dt, "_assign_states", return_value=["A"]) as spy: + with patch.object(dt, "_assign_states", return_value=[["A"], 0]) as spy: dt._assign_states_for_group( data_container=MagicMock(), group_id=1, @@ -436,9 +448,12 @@ def test_assign_states_for_group_residue_nonempty_calls_assign_states(): level_list=["residue"], states_ua=states_ua, states_res=states_res, + flexible_ua=flexible_ua, + flexible_res=flexible_res, ) assert states_res[1] == ["A"] + assert flexible_res[1] == 0 spy.assert_called_once() @@ -463,7 +478,7 @@ def run(self): return SimpleNamespace(results=SimpleNamespace(angles=angles)) with patch("CodeEntropy.levels.dihedrals.Dihedral", _FakeDihedral): - states = dt._assign_states( + states, num_flex = dt._assign_states( data_container=MagicMock(), molecules=[0, 1], dihedrals=["D0"], @@ -474,6 +489,7 @@ def run(self): ) assert states == ["0"] + assert num_flex == 0 def test_collect_peaks_for_group_calls_identify_peaks_for_ua_and_residue(): @@ -523,7 +539,7 @@ def run(self): return SimpleNamespace(results=SimpleNamespace(angles=angles)) with patch("CodeEntropy.levels.dihedrals.Dihedral", _FakeDihedral): - states = dt._assign_states( + states, num_flex = dt._assign_states( data_container=MagicMock(), molecules=[0], dihedrals=["D0"], @@ -534,6 +550,7 @@ def run(self): ) assert states == ["1", "0"] + assert num_flex == 1 def test_build_conformational_states_with_progress_handles_no_groups(): @@ -571,7 +588,7 @@ def test_build_conformational_states_with_progress_skips_empty_molecule_group(): groups = {0: []} levels = {} - states_ua, states_res = dt.build_conformational_states( + states_ua, states_res, flex_ua, flex_res = dt.build_conformational_states( data_container=MagicMock(), levels=levels, groups=groups, @@ -584,6 +601,8 @@ def test_build_conformational_states_with_progress_skips_empty_molecule_group(): assert states_ua == {} assert len(states_res) == 1 + assert flex_ua == {} + assert flex_res == [0] progress.update.assert_called_with(5, title="Group 0 (empty)") progress.advance.assert_called_with(5) diff --git a/tests/unit/CodeEntropy/levels/test_search.py b/tests/unit/CodeEntropy/levels/test_search.py index 9f982b6e..2e970212 100644 --- a/tests/unit/CodeEntropy/levels/test_search.py +++ b/tests/unit/CodeEntropy/levels/test_search.py @@ -205,7 +205,7 @@ def test_get_grid_neighbors_uses_residue_search_for_non_united_atom(): search_result = MagicMock() final_neighbors = MagicMock() - final_neighbors.fragindices = np.array([7, 8, 9]) + final_neighbors.atoms.fragindices = np.array([7, 8, 9]) search_result.__sub__.return_value = final_neighbors