• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CCPBioSim / CodeEntropy / 13726590978

07 Mar 2025 06:07PM UTC coverage: 1.726%. First build
13726590978

push

github

web-flow
Merge pull request #45 from CCPBioSim/39-implement-ci-pipeline-pre-commit-hooks

Implement CI pipeline pre-commit hooks

27 of 1135 new or added lines in 23 files covered. (2.38%)

53 of 3071 relevant lines covered (1.73%)

0.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/CodeEntropy/poseidon/extractData/mainClass.py
1
#!/usr/bin/env python
2

3

4
class atom_info(object):
×
5
    """
6
    Class for all information attributed to atoms and molecules in the system.
7
    """
8

NEW
9
    def __init__(
×
10
        self,
11
        atom_num,
12
        atom_name,
13
        mass,
14
        charge,
15
        resid,
16
        resname,
17
        bonded_to_atom_num,
18
        dihedral_list,
19
    ):  # order important
20

21
        self.atom_num = atom_num
×
22
        self.atom_name = atom_name
×
23
        self.resid = resid
×
24
        self.resname = resname
×
25
        self.mass = mass
×
26
        self.charge = charge
×
27
        self.bonded_to_atom_num = bonded_to_atom_num
×
NEW
28
        self.dihedral_list = dihedral_list
×
29
        # list of lists of atom nums in dihedrals, not including Hs
30

NEW
31
        self.molecule_atomNums = None  # list of bonded UA atom nums
×
NEW
32
        self.bonded_to_resids = None  # list of resids residue is bonded to
×
33

34
        self.coords = None
×
35
        self.forces = None
×
NEW
36
        self.nearest_sorted_array = None  # list of (atom_nums, distances)
×
37
        # from nearest to furthest within a set cutoff distance,
38
        # not including Hs
NEW
39
        self.nearest_all_atom_array = None  # list containing sorted by
×
40
        # dist (atom_num, dist) for all atoms, including Hs
41
        self.PKenergy = None
×
42
        self.UA_PKenergy = None
×
43

NEW
44
        self.bondedUA_H = None  # [num_bondedUAs, num_bonded Hs]
×
NEW
45
        self.nearest_atom = None  # HB acceptor all atom info
×
NEW
46
        self.nearest_Hs = []  # HB
×
NEW
47
        self.dist = None  # HB distance between donor and acceptor
×
NEW
48
        self.broken = None  # HB
×
NEW
49
        self.RAD = None  # list of atoms.all_info
×
NEW
50
        self.RAD_dist = None  # list of (atoms.all_info, dist from ref)
×
51

52
        self.UAweightedForces = None
×
53
        self.UAweightedTorques = None
×
54
        self.MweightedForces = None
×
55
        self.MweightedTorques = None
×
56
        self.molecule_UA_Fs = None
×
57
        self.molecule_UA_Ts = None
×
58
        self.WMprincipalAxis = None
×
59

NEW
60
        self.dihedral_phi_type = None  # unique dihedral angles, in degrees
×
NEW
61
        self.nearestAnyNonlike = None  # tuple (atom.all_info, dist)
×
NEW
62
        self.RAD_shell_ranked = None  # list of 3 tuple
×
63
        # RAD shell ranked, acceptors ranked, donors ranked by RAD
64
        self.RAD_nAtoms = None
×
NEW
65
        self.hydrationShellRAD_solute = None  # nearest solute molecule centric
×
66

NEW
67
    def __repr__(self):  # return the output below if whole object is printed
×
NEW
68
        return "%s %s %s %s %s %s %s" % (
×
69
            self.atom_num,
70
            self.atom_name,
71
            self.mass,
72
            self.charge,
73
            self.resid,
74
            self.resname,
75
            self.bonded_to_atom_num,
76
        )
77

78

79
def clearClass(all_data):
×
80
    """
81
    For variables in the class, clear after each frame is analysed.
82
    """
83

84
    def reset(self):
×
85
        """
86
        reset attributes in a class. Except those from topology.
87
        This prevents memory overload from each frame.
88
        """
89
        dic = vars(self)
×
NEW
90
        noEdit = [
×
91
            "atom_num",
92
            "atom_name",
93
            "resid",
94
            "resname",
95
            "mass",
96
            "charge",
97
            "bonded_to_atom_num",
98
            "nearest_Hs",
99
            "molecule_atomNums",
100
            "bonded_to_resids",
101
            "dihedral_list",
102
            "bondedUA_H",
103
        ]
104
        for i in dic.keys():
×
105
            if i not in noEdit:
×
106
                dic[i] = None
×
107
            else:
108
                continue
×
NEW
109
        dic["nearest_Hs"] = []
×
110

111
    # clear all objects from previous frame
112
    for x in range(0, len(all_data)):
×
113
        atom = all_data[x]
×
114
        reset(atom)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc