made the get_phis and qlinear functions work independant of dimension
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import unittest
|
||||
from interp.baker import get_phis_3D, qlinear_3D
|
||||
from interp.baker import get_phis, qlinear
|
||||
from interp.grid import grid
|
||||
|
||||
import numpy as np
|
||||
@@ -19,16 +19,16 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
self.q = [0.0, 0.0, 0.0, 4]
|
||||
|
||||
|
||||
def testGetPhis3D(self):
|
||||
result = get_phis_3D(self.X, self.r)
|
||||
def testGetPhis(self):
|
||||
result = get_phis(self.X, self.r)
|
||||
right_answer = [0.25, 0.25, 0.25, 0.25]
|
||||
|
||||
for a,b in zip(result, right_answer):
|
||||
self.assertAlmostEqual(a,b)
|
||||
|
||||
|
||||
def testQlinear3D(self):
|
||||
phi, result = qlinear_3D(self.X, grid(self.r, self.q))
|
||||
def testQlinear(self):
|
||||
phi, result = qlinear(self.X, grid(self.r, self.q))
|
||||
result = result
|
||||
right_answer = 1.0
|
||||
self.assertAlmostEqual(result, right_answer)
|
||||
|
||||
Reference in New Issue
Block a user