|
4 | 4 | from nose.tools import (with_setup, assert_raises, assert_equal, |
5 | 5 | assert_almost_equal) |
6 | 6 | import numpy as np |
7 | | -import modality |
8 | 7 | import pandas as pd |
9 | 8 | from scipy import stats |
10 | 9 |
|
11 | 10 | import tableone |
12 | 11 | from tableone import TableOne |
13 | 12 | from tableone.tableone import InputError |
| 13 | +from tableone.modality import hartigan_diptest, generate_data |
14 | 14 |
|
15 | 15 |
|
16 | 16 | def mytest(*args): |
@@ -297,16 +297,16 @@ def test_hartigan_diptest_for_modality(self): |
297 | 297 | Ensure that the package runs Fisher exact if cell counts are <=5 |
298 | 298 | and it is a 2x2 |
299 | 299 | """ |
300 | | - dist_1_peak = modality.generate_data(peaks=1, n=[10000]) |
301 | | - t1 = modality.hartigan_diptest(dist_1_peak) |
| 300 | + dist_1_peak = generate_data(peaks=1, n=[10000]) |
| 301 | + t1 = hartigan_diptest(dist_1_peak) |
302 | 302 | assert t1 > 0.95 |
303 | 303 |
|
304 | | - dist_2_peak = modality.generate_data(peaks=2, n=[10000, 10000]) |
305 | | - t2 = modality.hartigan_diptest(dist_2_peak) |
| 304 | + dist_2_peak = generate_data(peaks=2, n=[10000, 10000]) |
| 305 | + t2 = hartigan_diptest(dist_2_peak) |
306 | 306 | assert t2 < 0.05 |
307 | 307 |
|
308 | | - dist_3_peak = modality.generate_data(peaks=3, n=[10000, 10000, 10000]) |
309 | | - t3 = modality.hartigan_diptest(dist_3_peak) |
| 308 | + dist_3_peak = generate_data(peaks=3, n=[10000, 10000, 10000]) |
| 309 | + t3 = hartigan_diptest(dist_3_peak) |
310 | 310 | assert t3 < 0.05 |
311 | 311 |
|
312 | 312 | @with_setup(setup, teardown) |
|
0 commit comments