def test_radius_cut_method(self, universe): acidic = universe.select_atoms(self.sel_acidic) basic = universe.select_atoms(self.sel_basic) r = contacts.distance_array(acidic.positions, basic.positions) initial_contacts = contacts.contact_matrix(r, 6.0) expected = [] for ts in universe.trajectory: r = contacts.distance_array(acidic.positions, basic.positions) expected.append(contacts.radius_cut_q(r[initial_contacts], None, radius=6.0)) ca = self._run_Contacts(universe, method='radius_cut') assert_array_equal(ca.timeseries[:, 1], expected)
def test_radius_cut_q(r, r0, radius, expected_value): # check some extremal points assert contacts.radius_cut_q(r, r0, radius) == expected_value
def test_radius_cut_q(): # check some extremal points assert_equal(contacts.radius_cut_q([1], None, 2), 1) assert_equal(contacts.radius_cut_q([2], None, 1), 0) assert_equal(contacts.radius_cut_q([2, 0.5], None, 1), 0.5)