Skip to content

Commit

Permalink
Updated the test suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrpugh committed Apr 4, 2015
1 parent aa053ff commit 4f23fa3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pycollocation/test/test_polynomial_collocation.py
Expand Up @@ -94,11 +94,14 @@ def test_chebyshev_collocation(self):
self.domain[1],
1000)
residuals = solution.residuals.values
normed_residuals = solution.normalized_residuals.values

# check that residuals are close to zero on average
mesg = "Chebyshev residuals:\n{}\n\nDictionary of model params: {}"
self.assertTrue(np.mean(residuals) < 1e-6,
msg=mesg.format(residuals, self.params))
self.assertTrue(np.mean(normed_residuals) < 1e-6,
msg=mesg.format(normed_residuals, self.params))

# check that the numerical and analytic solutions are close
numeric_soln = solution.solution.ix[:, 0]
Expand All @@ -122,11 +125,14 @@ def test_legendre_collocation(self):
self.domain[1],
1000)
residuals = solution.residuals.values
normed_residuals = solution.normalized_residuals.values

# check that residuals are all close to zero
mesg = "Legendre residuals:\n{}\n\nDictionary of model params: {}"
self.assertTrue(np.mean(residuals) < 1e-6,
msg=mesg.format(residuals, self.params))
self.assertTrue(np.mean(normed_residuals) < 1e-6,
msg=mesg.format(normed_residuals, self.params))

# check that the numerical and analytic solutions are close
numeric_soln = solution.solution.ix[:, 0]
Expand Down

0 comments on commit 4f23fa3

Please sign in to comment.