From 67253a700903f13df358ccd96f4184dc75782da2 Mon Sep 17 00:00:00 2001 From: Pascal Merz Date: Fri, 23 Apr 2021 14:40:26 -0600 Subject: [PATCH] Remove unused functions (#125) Removing two functions in util.kinetic_energy which are not used anywhere in the code. --- physical_validation/util/kinetic_energy.py | 93 ---------------------- 1 file changed, 93 deletions(-) diff --git a/physical_validation/util/kinetic_energy.py b/physical_validation/util/kinetic_energy.py index e34eb84..d99afbb 100644 --- a/physical_validation/util/kinetic_energy.py +++ b/physical_validation/util/kinetic_energy.py @@ -727,66 +727,6 @@ def check_equipartition( return result, ndof_molec, kin_molec -def calc_system_ndof(natoms, nmolecs, nbonds, stop_com_tra, stop_com_rot): - r""" - Calculates the total / translational / rotational & internal / - rotational / internal degrees of freedom of the system. - - Parameters - ---------- - natoms : int - Total number of atoms in the system - nmolecs : int - Total number of molecules in the system - nbonds : int - Total number of bonds in the system - stop_com_tra : bool - Was the center-of-mass translation removed during the simulation? - stop_com_rot : bool - Was the center-of-mass translation removed during the simulation? - - Returns - ------- - ndof : dict - Dictionary containing the degrees of freedom. - Keys: ['tot', 'tra', 'rni', 'rot', 'int'] - """ - # total ndof - ndof_tot = 3 * natoms - nbonds - - # ndof reduction due to COM motion constraining - if stop_com_tra: - ndof_tot -= 3 - if stop_com_rot: - ndof_tot -= 3 - - # translational ndof - ndof_tot_tra = 3 * nmolecs - if stop_com_tra: - ndof_tot -= 3 - - # rotational & internal ndof - ndof_tot_rni = ndof_tot - ndof_tot_tra - - # rotational ndof - ndof_tot_rot = 3 * nmolecs - if stop_com_tra: - ndof_tot -= 3 - - # internal ndof - ndof_tot_int = ndof_tot_rni - ndof_tot_rot - - # return dict - ndof = { - "tot": ndof_tot, - "tra": ndof_tot_tra, - "rni": ndof_tot_rni, - "rot": ndof_tot_rot, - "int": ndof_tot_int, - } - return ndof - - def calc_ndof( natoms, nmolecs, molec_idx, molec_nbonds, ndof_reduction_tra, ndof_reduction_rot ): @@ -1051,39 +991,6 @@ def group_ndof(ndof_molec, nmolecs, molec_group=None): return ndof -def calc_temperatures(kin_molec, ndof_molec, nmolecs, molec_group=None): - r""" - Calculates the partitioned temperature for a - given group or the entire system. - - Parameters - ---------- - kin_molec : List[dict] - Partitioned kinetic energies per molecule. - ndof_molec : List[dict] - Partitioned degrees of freedom per molecule. - nmolecs : int - Total number of molecules in the system. - molec_group : iterable - Indeces of the group to be summed up. None defaults to all molecules - in the system. Default: None. - - Returns - ------- - temp : dict - Dictionary of partitioned temperatures for the group. - """ - - kin = group_kinetic_energy(kin_molec, nmolecs, molec_group) - ndof = group_ndof(ndof_molec, nmolecs, molec_group) - - temp = {} - for key in kin: - temp[key] = temperature(kin[key], ndof[key]) - - return temp - - def test_group( kin_molec, ndof_molec,