Skip to content

Commit

Permalink
Update properties.py
Browse files Browse the repository at this point in the history
Added AllAtoms
  • Loading branch information
talagayev authored Dec 9, 2024
1 parent f14a782 commit 4520216
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions mdonatello/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,37 @@ def property_value(self) -> float:
return len(Chem.FindMolChiralCenters(self.mol))


class AllAtoms(Property):
"""A class for calculating the amount of atoms of a molecule.
Parameters:
-----------
mol : Chem.Mol
The RDKit Mol object of the molecule for which the heavy atom count is being calculated.
Returns:
--------
float
The atom count of the molecule.
"""

name = "Heavy Atoms"
values_format = False
unit = ""

@cached_property
def property_value(self) -> float:
"""
Calculates the heavy atoms of the molecule.
Returns:
--------
float
The atom count of the molecule.
"""
return rdMolDescriptors.CalcNumAtoms(self.mol)


class HeavyAtoms(Property):
"""A class for calculating the amount of heavy atoms of a molecule.
Expand Down

0 comments on commit 4520216

Please sign in to comment.