Skip to content

Commit

Permalink
Added periodic trends to Element class
Browse files Browse the repository at this point in the history
  • Loading branch information
amogh7joshi committed Oct 23, 2020
1 parent 27cd45d commit f24f0c7
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions chemsolve/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ def __init__(self, element_symbol, **kwargs):
self.__properties = PeriodicTable().get_properties(element_symbol)
self.element_symbol = element_symbol
self.element_name = self.get_element_name()
self.mass = self.get_mass()
self.number = self.get_atomic_number()
self.electron_configuration = self.get_electron_configuration()
self.mass = self.__properties['AtomicMass']
self.number = self.__properties['AtomicNumber']
self.electron_configuration = self.__properties['ElectronConfiguration']
self.full_electron_configuration = self.get_full_electron_configuration()
self.radius = self.__properties['AtomicRadius']
self.electronegativity = self.__properties['Electronegativity']
self.ionization = self.__properties['IonizationEnergy']
self.electron_affinity = self.__properties['Electron Affinity']

'''
The class can calculate quantities of moles and grams, depending on the specific keywords 'moles' and 'grams'.
Expand Down Expand Up @@ -82,24 +86,6 @@ def get_element_name(self):
if ("+" or "-") in self.element_symbol:
print("That is not an existing element in the periodic table.")

def get_mass(self):
'''
Returns the atomic (and therefore molar) mass of the element.
'''
return self.__properties['AtomicMass']

def get_atomic_number(self):
'''
Returns the atomic number of the element.
'''
return self.__properties['AtomicNumber']

def get_electron_configuration(self):
'''
Returns the electron configuration of the element.
'''
return self.__properties['ElectronConfiguration']

def get_full_electron_configuration(self):
'''
Returns the entire electron configuration of the element, ignoring the noble gas abbreviation.
Expand Down

0 comments on commit f24f0c7

Please sign in to comment.