bjodah / chempy

⚗ A package useful for chemistry written in Python
BSD 2-Clause "Simplified" License
544 stars 78 forks source link

Fix gh-171 & gh-172 #174

Closed bjodah closed 4 years ago

bjodah commented 4 years ago

@matecsaj would you mind taking a look here, does this look alright to you?

matecsaj commented 4 years ago

Thank you for responding to all issues and so quickly.

Hs 271 is the isotope with the longest half-life, should 271 be in the lookup table instead of 270?

Could the test be tightened as follows by omitting the equal and adding an else?

def test_molar_masses_of_the_elements_gh172():
     from chempy import Substance
     previous_mass = 0
     for symbol in symbols:
         this_mass = Substance.from_formula(symbol).mass
         if symbol not in ('K', 'Ni', 'I', 'Pa', 'Np', 'Am'):
             assert this_mass > previous_mass
         else:
             assert this_mass < previous_mass
         previous_mass = this_mass
bjodah commented 4 years ago

Sure, fine by me. Any serious work with Hassium isotopes would probably be better served by using actual isotope masses, also looks like the most stable isotope is 269: https://en.wikipedia.org/wiki/Isotopes_of_hassium

But I don't know what nuclei they smash together and what ratios they get...

bjodah commented 4 years ago

Let me know if this works for you, and thanks again for the reports!