[cig-commits] [commit] master: Remove integer check (11466f5)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Sun Jan 4 06:44:34 PST 2015


Repository : https://github.com/geodynamics/burnman

On branch  : master
Link       : https://github.com/geodynamics/burnman/compare/3f851f06618bcb112ae159cb61326e211911be2e...1f0b803e9189e4c6cc1ff3065bbc5da699dc80b6

>---------------------------------------------------------------

commit 11466f54bc62b3d282caf4736989c3eff8a467dd
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Sun Dec 28 11:47:20 2014 -0800

    Remove integer check


>---------------------------------------------------------------

11466f54bc62b3d282caf4736989c3eff8a467dd
 burnman/eos/mie_grueneisen_debye.py |  2 +-
 burnman/eos/slb.py                  |  2 +-
 tests/test_eos.py                   | 28 ----------------------------
 3 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/burnman/eos/mie_grueneisen_debye.py b/burnman/eos/mie_grueneisen_debye.py
index 0a242c5..ee8d300 100644
--- a/burnman/eos/mie_grueneisen_debye.py
+++ b/burnman/eos/mie_grueneisen_debye.py
@@ -202,7 +202,7 @@ class MGDBase(eos.EquationOfState):
             warnings.warn( 'Unusual value for Gprime_0', stacklevel=2 )
         if params['molar_mass'] < 0.001 or params['molar_mass'] > 1.:
             warnings.warn( 'Unusual value for molar_mass' , stacklevel=2)
-        if params['n'] < 1. or params['n'] > 1000. or float(params['n']).is_integer()==False:
+        if params['n'] < 1. or params['n'] > 1000.:
             warnings.warn( 'Unusual value for n' , stacklevel=2)
         if params['Debye_0'] < 1. or params['Debye_0'] > 10000.:
             warnings.warn( 'Unusual value for Debye_0' , stacklevel=2)
diff --git a/burnman/eos/slb.py b/burnman/eos/slb.py
index d338a53..a80e73d 100644
--- a/burnman/eos/slb.py
+++ b/burnman/eos/slb.py
@@ -291,7 +291,7 @@ class SLBBase(eos.EquationOfState):
             warnings.warn( 'Unusual value for Gprime_0', stacklevel=2 )
         if params['molar_mass'] < 0.001 or params['molar_mass'] > 10.:
             warnings.warn( 'Unusual value for molar_mass', stacklevel=2 )
-        if params['n'] < 1. or params['n'] > 1000. or float(params['n']).is_integer() == False:
+        if params['n'] < 1. or params['n'] > 1000.:
             warnings.warn( 'Unusual value for n', stacklevel=2 )
         if params['Debye_0'] < 1. or params['Debye_0'] > 10000.:
             warnings.warn( 'Unusual value for Debye_0', stacklevel=2 )
diff --git a/tests/test_eos.py b/tests/test_eos.py
index adc62df..f25a41d 100644
--- a/tests/test_eos.py
+++ b/tests/test_eos.py
@@ -156,34 +156,6 @@ class test_eos_validation(BurnManTest):
             if len(w) == 0:
                 self.fail("Did not catch expected warning K in Gpa")
 
-        class mymineralwithfractionalatoms(burnman.Mineral):
-            def __init__(self):
-                self.params = {
-                    'equation_of_state': 'slb3',
-                    'V_0': 11.24e-6,
-                    'K_0': 161.0e9,
-                    'Kprime_0': 3.8,
-                    'molar_mass': .0403,
-                    'n': 3.14159,
-                    'Debye_0': 773.,
-                    'grueneisen_0': 1.5,
-                    'q_0': 1.5,
-                    'eta_s_0': 2.8}
-                burnman.Mineral.__init__(self)
-
-        with warnings.catch_warnings(record=True) as w:
-            # Cause all warnings to always be triggered.
-            warnings.simplefilter("always")
-            #Trigger warning
-            fractional_atoms = mymineralwithfractionalatoms()
-            if len(w) == 0:
-                self.fail("Did not catch expected warning for fractional atoms")
-     
-     
-
-
-     
-
 
 if __name__ == '__main__':
     unittest.main()



More information about the CIG-COMMITS mailing list