Commit 7e254bd4 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: I think it's fair to require navalues/rawlevels/newlevels to be numpy

arrays and not lists
parent 3f00b4b8
......@@ -298,7 +298,7 @@ def test_applyNewLevels():
codes1 = np.random.randint(100, 200, 10)
codes2 = np.random.randint(100, 200, 10)
codes3 = list(reversed(range(10)))
codes3 = np.arange(9, -1, -1)
exp1 = [codes1[data[i, 1]] for i in range(50)]
exp2 = [codes2[data[i, 2]] for i in range(50)]
......@@ -308,11 +308,11 @@ def test_applyNewLevels():
with warnings.catch_warnings():
warnings.simplefilter('ignore')
vartable['RawLevels'][1] = list(range(10))
vartable['RawLevels'][1] = np.arange(10)
vartable['NewLevels'][1] = codes1
vartable['RawLevels'][2] = list(range(10))
vartable['RawLevels'][2] = np.arange(10)
vartable['NewLevels'][2] = codes2
vartable['RawLevels'][3] = list(range(10))
vartable['RawLevels'][3] = np.arange(10)
vartable['NewLevels'][3] = codes3
......@@ -347,8 +347,8 @@ def test_applyNAInsertion():
data = np.random.randint(0, 10, (100, 3)).astype(np.float32)
data[:, 0] = np.arange(1, 101)
miss1 = list(np.random.choice(range(10), 4, replace=False))
miss2 = list(np.random.choice(range(10), 4, replace=False))
miss1 = np.random.choice(range(10), 4, replace=False)
miss2 = np.random.choice(range(10), 4, replace=False)
exp1 = data[:, 1].copy()
exp2 = data[:, 2].copy()
......@@ -362,7 +362,7 @@ def test_applyNAInsertion():
warnings.simplefilter("ignore")
vartable['NAValues'][1] = miss1
vartable['NAValues'][2] = miss2
vartable['NAValues'][3] = [1, 2, 3]
vartable['NAValues'][3] = np.array([1, 2, 3])
cols = ['eid', '1-0.0', '2-0.0']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment