[cig-commits] [commit] split_mt: Tweak change to set_method. (b057769)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Jan 5 08:52:32 PST 2015


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

On branch  : split_mt
Link       : https://github.com/geodynamics/burnman/compare/74daca25ab1fe10d144e12b2b358ace333269c4f...b057769c802ead7493d72ccfc2673e1b4c9df108

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

commit b057769c802ead7493d72ccfc2673e1b4c9df108
Author: Bob Myhill <myhill.bob at gmail.com>
Date:   Mon Jan 5 17:52:08 2015 +0100

    Tweak change to set_method.


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

b057769c802ead7493d72ccfc2673e1b4c9df108
 burnman/mineral.py                          |  2 +-
 misc/ref/endmember_benchmarks.py.out        |  2 +-
 misc/ref/example_compare_all_methods.py.out | 10 +++++-----
 misc/ref/example_fit_data.py.out            |  4 ++--
 misc/ref/paper_fit_data.py.out              |  8 ++++----
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/burnman/mineral.py b/burnman/mineral.py
index 0c907b3..24e74eb 100644
--- a/burnman/mineral.py
+++ b/burnman/mineral.py
@@ -67,7 +67,7 @@ class Mineral(Material):
         if self.method is not None and type(new_method) is not type(self.method):
 
             # Warn user that they are changing the EoS
-            warnings.warn('Overriding database equation of state from ' + self.method.__class__.__name__ + ' to ' + new_method.__class__.__name__ + '. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.', stacklevel=2)
+            warnings.warn('Warning, you are changing the method to ' + new_method.__class__.__name__ + ' even though the material is designed to be used with the method ' + self.method.__class__.__name__ + '.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).', stacklevel=2)
 
             # Set new EoS
             self.params['equation_of_state']=equation_of_state
diff --git a/misc/ref/endmember_benchmarks.py.out b/misc/ref/endmember_benchmarks.py.out
index 4890cf8..f84afa7 100644
--- a/misc/ref/endmember_benchmarks.py.out
+++ b/misc/ref/endmember_benchmarks.py.out
@@ -1,4 +1,4 @@
-<stdin>:55: UserWarning: Overriding database equation of state from HP_TMT to MT. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
+<stdin>:55: UserWarning: Warning, you are changing the method to MT even though the material is designed to be used with the method HP_TMT.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
 Benchmarks for SLB2011 database with method slb3
 ['H', 'S', 'V', 'C_p', 'alpha', 'beta', 'rho']
 [0.00017156026591432655, 0.0002055800239183733, -6.4391026211448567e-05, 0.00014642709264959587, 0.00027680790069709911, 0.0043841690680523288, -0.0013546021287755491, -0.00014635661915870913]
diff --git a/misc/ref/example_compare_all_methods.py.out b/misc/ref/example_compare_all_methods.py.out
index 822add4..81f62b5 100644
--- a/misc/ref/example_compare_all_methods.py.out
+++ b/misc/ref/example_compare_all_methods.py.out
@@ -1,12 +1,12 @@
-BURNMAN/burnman/composite.py: UserWarning: Overriding database equation of state from SLB2 to MGD3. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
+BURNMAN/burnman/composite.py: UserWarning: Warning, you are changing the method to MGD3 even though the material is designed to be used with the method SLB2.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
   phase.set_method(method)
-BURNMAN/burnman/composite.py: UserWarning: Overriding database equation of state from MGD3 to SLB2. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
+BURNMAN/burnman/composite.py: UserWarning: Warning, you are changing the method to SLB2 even though the material is designed to be used with the method MGD3.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
   phase.set_method(method)
-BURNMAN/burnman/composite.py: UserWarning: Overriding database equation of state from SLB2 to SLB3. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
+BURNMAN/burnman/composite.py: UserWarning: Warning, you are changing the method to SLB3 even though the material is designed to be used with the method SLB2.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
   phase.set_method(method)
-BURNMAN/burnman/composite.py: UserWarning: Overriding database equation of state from SLB3 to BM2. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
+BURNMAN/burnman/composite.py: UserWarning: Warning, you are changing the method to BM2 even though the material is designed to be used with the method SLB3.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
   phase.set_method(method)
-BURNMAN/burnman/composite.py: UserWarning: Overriding database equation of state from BM2 to BM3. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
+BURNMAN/burnman/composite.py: UserWarning: Warning, you are changing the method to BM3 even though the material is designed to be used with the method BM2.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
   phase.set_method(method)
 Calculations are done for:
 Composite:
diff --git a/misc/ref/example_fit_data.py.out b/misc/ref/example_fit_data.py.out
index 72e99df..370864f 100644
--- a/misc/ref/example_fit_data.py.out
+++ b/misc/ref/example_fit_data.py.out
@@ -1,5 +1,5 @@
-<stdin>:76: UserWarning: Overriding database equation of state from BM2 to BM3. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
-<stdin>:85: UserWarning: Overriding database equation of state from BM3 to BM2. This does not overwrite any mineral attributes other than temperature and pressure. Non-implemented attributes of the old method will remain unchanged unless they are explicitly changed by the user.
+<stdin>:76: UserWarning: Warning, you are changing the method to BM3 even though the material is designed to be used with the method BM2.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
+<stdin>:85: UserWarning: Warning, you are changing the method to BM2 even though the material is designed to be used with the method BM3.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
 Optimization terminated successfully.
          Current function value: 14212.177931
          Iterations: 109
diff --git a/misc/ref/paper_fit_data.py.out b/misc/ref/paper_fit_data.py.out
index 5f64f4b..77ba840 100644
--- a/misc/ref/paper_fit_data.py.out
+++ b/misc/ref/paper_fit_data.py.out
@@ -1,9 +1,9 @@
-<stdin>:88: UserWarning: Overriding database equation of state. From BM2 to BM3
-<stdin>:97: UserWarning: Overriding database equation of state. From BM3 to BM2
+<stdin>:88: UserWarning: Warning, you are changing the method to BM3 even though the material is designed to be used with the method BM2.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
+<stdin>:97: UserWarning: Warning, you are changing the method to BM2 even though the material is designed to be used with the method BM3.  This does not overwrite any mineral attributes other than temperature and pressure, which are set to nan. Stale attributes will be preserved unless they are refreshed (for example, by set_state).
 Optimization terminated successfully.
          Current function value: 14212.177931
-         Iterations: 117
-         Function evaluations: 255
+         Iterations: 116
+         Function evaluations: 246
 2nd order fit: G =  173.346204684 GPa	G' =  1.52206197715
 Optimization terminated successfully.
          Current function value: 16309.293866



More information about the CIG-COMMITS mailing list