@@ -83,7 +83,12 @@ def test_execute_full_workflow(self):
8383 return_value = (mock_reduced_atom , 3 , mock_levels , mock_groups )
8484 )
8585 entropy_manager ._level_manager .build_covariance_matrices = MagicMock (
86- return_value = ("force_matrices" , "torque_matrices" , "frame_counts" )
86+ return_value = (
87+ "force_matrices" ,
88+ "torque_matrices" ,
89+ "forcetorque_avg" ,
90+ "frame_counts" ,
91+ )
8792 )
8893 entropy_manager ._dihedral_analysis .build_conformational_states = MagicMock (
8994 return_value = (["state_ua" ], ["state_res" ])
@@ -128,6 +133,7 @@ def test_execute_full_workflow(self):
128133 mock_groups ,
129134 "force_matrices" ,
130135 "torque_matrices" ,
136+ "forcetorque_avg" ,
131137 ["state_ua" ],
132138 ["state_res" ],
133139 "frame_counts" ,
@@ -173,7 +179,12 @@ def test_execute_triggers_handle_water_entropy_minimal(self):
173179 return_value = (MagicMock (), 3 , {}, {0 : [0 ]})
174180 )
175181 entropy_manager ._level_manager .build_covariance_matrices = MagicMock (
176- return_value = ("force_matrices" , "torque_matrices" , "frame_counts" )
182+ return_value = (
183+ "force_matrices" ,
184+ "torque_matrices" ,
185+ "forcetorque_avg" ,
186+ "frame_counts" ,
187+ )
177188 )
178189 entropy_manager ._dihedral_analysis .build_conformational_states = MagicMock (
179190 return_value = (["state_ua" ], ["state_res" ])
@@ -715,6 +726,8 @@ def test_process_vibrational_only_levels(self):
715726 ve = MagicMock ()
716727 ve .vibrational_entropy_calculation .side_effect = [1.11 , 2.22 ]
717728
729+ forcetorque_matrix = np .eye (6 )
730+
718731 # Run the method
719732 manager ._process_vibrational_entropy (
720733 group_id = 0 ,
@@ -724,14 +737,15 @@ def test_process_vibrational_only_levels(self):
724737 level = "Vibrational" ,
725738 force_matrix = force_matrix ,
726739 torque_matrix = torque_matrix ,
740+ forcetorque_matrix = forcetorque_matrix ,
727741 highest = True ,
728742 )
729743
730744 # Check that results were logged
731745 df = data_logger .molecule_data
732746 self .assertEqual (len (df ), 2 ) # Transvibrational and Rovibrational
733747
734- expected_types = {"Transvibrational" , "Rovibrational" }
748+ expected_types = {"FTmat- Transvibrational" , "FTmat- Rovibrational" }
735749 actual_types = set (entry [2 ] for entry in df )
736750 self .assertSetEqual (actual_types , expected_types )
737751
@@ -789,6 +803,7 @@ def test_compute_entropies_polymer_branch(self):
789803 groups ,
790804 force_matrices ,
791805 torque_matrices ,
806+ force_matrices ,
792807 states_ua ,
793808 states_res ,
794809 frame_counts ,
@@ -942,6 +957,8 @@ def test_compute_entropies_united_atom(self):
942957 universe_operations .get_molecule_container = MagicMock (return_value = mol_mock )
943958 manager ._process_united_atom_entropy = MagicMock ()
944959
960+ force_torque_matrices = MagicMock ()
961+
945962 ve = MagicMock ()
946963 ce = MagicMock ()
947964
@@ -951,6 +968,7 @@ def test_compute_entropies_united_atom(self):
951968 groups ,
952969 force_matrices ,
953970 torque_matrices ,
971+ force_torque_matrices ,
954972 states_ua ,
955973 states_res ,
956974 frame_counts ,
@@ -1017,6 +1035,8 @@ def test_compute_entropies_residue(self):
10171035 manager ._process_vibrational_entropy = MagicMock ()
10181036 manager ._process_conformational_entropy = MagicMock ()
10191037
1038+ force_torque_matrices = MagicMock ()
1039+
10201040 # Mock entropy calculators
10211041 ve = MagicMock ()
10221042 ce = MagicMock ()
@@ -1028,6 +1048,7 @@ def test_compute_entropies_residue(self):
10281048 groups ,
10291049 force_matrices ,
10301050 torque_matrices ,
1051+ force_torque_matrices ,
10311052 states_ua ,
10321053 states_res ,
10331054 frame_counts ,
@@ -1048,6 +1069,7 @@ def test_compute_entropies_polymer(self):
10481069 data_logger = DataLogger ()
10491070 group_molecules = MagicMock ()
10501071 dihedral_analysis = MagicMock ()
1072+
10511073 manager = EntropyManager (
10521074 run_manager ,
10531075 args ,
@@ -1066,9 +1088,10 @@ def test_compute_entropies_polymer(self):
10661088
10671089 force_matrices = {"poly" : {0 : "force_poly" }}
10681090 torque_matrices = {"poly" : {0 : "torque_poly" }}
1091+ force_torque_matrices = {"poly" : {0 : "ft_poly" }}
1092+
10691093 states_ua = {}
10701094 states_res = []
1071-
10721095 frame_counts = {"poly" : {(0 , 0 ): 10 }}
10731096
10741097 mol_mock = MagicMock ()
@@ -1085,6 +1108,7 @@ def test_compute_entropies_polymer(self):
10851108 groups ,
10861109 force_matrices ,
10871110 torque_matrices ,
1111+ force_torque_matrices ,
10881112 states_ua ,
10891113 states_res ,
10901114 frame_counts ,
@@ -1101,6 +1125,7 @@ def test_compute_entropies_polymer(self):
11011125 "polymer" ,
11021126 force_matrices ["poly" ][0 ],
11031127 torque_matrices ["poly" ][0 ],
1128+ force_torque_matrices ["poly" ][0 ],
11041129 True ,
11051130 )
11061131
0 commit comments