Fixed Travis?

This commit is contained in:
Lindsey
2015-02-24 12:54:45 -08:00
parent 71881c7ce8
commit 0a98c5f1c3
3 changed files with 26 additions and 10 deletions
+2 -4
View File
@@ -17,11 +17,8 @@ before_install:
install:
- conda install --yes pip python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib cython
- pip install nose-cov python-coveralls
# Remove this when SimPEG is on pip
- git clone https://github.com/simpeg/simpeg.git
- cd simpeg/
# - pip install -r requirements.txt
- python setup.py install
- cd ../
# Run test
script:
@@ -35,3 +32,4 @@ notifications:
email:
- rowanc1@gmail.com
- sgkang09@gmail.com
- lindseyheagy@gmail.com
+18 -2
View File
@@ -17,15 +17,31 @@ class BaseEMProblem(Problem.BaseProblem):
verbose = False
####################################################
# Mu Model
####################################################
@property
def mu(self):
if getattr(self, '_mu', None) is None:
self._mu = mu_0
return self._mu
@mu.setter
def mu(self, value):
if getattr(self, '_MfMui', None) is not None:
del self._MfMui
self._mu = value
####################################################
# Mass Matrices
####################################################
@property
def MfMui(self):
#TODO: assuming constant mu
if getattr(self, '_MfMui', None) is None:
self._MfMui = self.mesh.getFaceInnerProduct(1/mu_0)
self._MfMui = self.mesh.getFaceInnerProduct(1/self.mu)
return self._MfMui
@property
+6 -4
View File
@@ -7,7 +7,7 @@ from scipy.constants import mu_0
TOL = 1e-4
CONDUCTIVITY = 1e3
MU = mu_0
addrandoms = True
addrandoms = True
def getProblem(fdemType, comp):
cs = 5.
@@ -48,11 +48,11 @@ def adjointTest(fdemType, comp):
print 'Adjoint %s formulation - %s' % (fdemType, comp)
m = np.log(np.ones(prb.mesh.nC)*CONDUCTIVITY)
mu = np.log(np.ones(prb.mesh.nC)*CONDUCTIVITY)
mu = np.log(np.ones(prb.mesh.nC)*MU)
if addrandoms is True:
m = m + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
mu = mu + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
mu = mu + np.random.randn(prb.mesh.nC)*MU*1e-3
prb.mu = mu
survey = prb.survey
@@ -71,11 +71,13 @@ def derivTest(fdemType, comp):
prb = getProblem(fdemType, comp)
print '%s formulation - %s' % (fdemType, comp)
x0 = np.log(np.ones(prb.mesh.nC)*CONDUCTIVITY)
mu = np.log(np.ones(prb.mesh.nC)*MU)
if addrandoms is True:
x0 = x0 + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
mu = mu + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
mu = mu + np.random.randn(prb.mesh.nC)*MU*1e-3
prb.mu = mu
survey = prb.survey
def fun(x):
return survey.dpred(x), lambda x: prb.Jvec(x0, x)