geodynamics/burnman — pull request #37 by ian-r-rose (2014-10-14 02:50:34+00:00)
Title: Validate params

Sanne and I talked about this a while back, but I thought I'd take a crack at implementing this. In general we were doing a lot of assuming that the 'params' object that a mineral is created with contains all the information that the equation of state we request needs. If it does not, calculations fail quickly and confusingly for the user.

Instead, we should probably do a validation step before trying to use the mineral, just to check if the params object is valid. Additionally, we can do certain checks there to make sure that the parameters are within the range of possibility. For instance, what I have done here will throw warnings if the parameters are orders of magnitude different from our expectations (e.g, passing in moduli in GPa vs Pa).

Relatedly, because the parameters are so tied to the equation of state, much of the time our mineral library should know what EOS to use. We can thus call set_method() in the init function. Thoughts about this?