Skip to content

Commit

Permalink
Merge pull request #64 from jodreen/master
Browse files Browse the repository at this point in the history
coverage is accurate
  • Loading branch information
AlonDaks committed Dec 10, 2015
2 parents 6759786 + f9dd349 commit b9aa90d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ clean:
find . -name "*.so" -o -name "*.pyc" -o -name "*.pyx.md5" | xargs rm -f

coverage:
nosetests code/stat159lambda/utils data --with-coverage --cover-package=data --cover-package=utils
nosetests code/stat159lambda/ data --with-coverage

test:
nosetests code/stat159lambda/utils data
nosetests code/stat159lambda/ data

verbose:
nosetests -v code/stat159lambda/utils data
nosetests -v code/stat159lambda/ data
8 changes: 1 addition & 7 deletions code/stat159lambda/classification/tests/test_rf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stat159lambda.classification import rf
from stat159lambda.classification.random_forest import rf
import numpy as np
from sklearn.ensemble import RandomForestClassifier
try:
Expand All @@ -13,12 +13,6 @@ def test_prepare():
y = np.array([1, 0, 1, 1, 0, 2, 1, 1, 0, 0])
return X, y


def test_cv_rf_accuracy():
X, y = test_prepare()
assert rf.cv_rf_accuracy(X, y, 2, 2, 2, num_folds=5) > 0


# @patch.object(RandomForestClassifier, '__init__')
# def test_rf_accuracy(mock_rf_init):
# X, y = test_prepare()
Expand Down
2 changes: 2 additions & 0 deletions code/stat159lambda/simulations/correlation_simulation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import numpy as np
from scipy import stats
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from stat159lambda.config import REPO_HOME_PATH

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from stat159lambda.config import REPO_HOME_PATH

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from numpy.testing import assert_array_equal
import unittest
import imp
Expand All @@ -14,11 +16,12 @@


class SimulateInterRunCorrelationTestCases(unittest.TestCase):
@patch.object(matplotlib.pyplot, 'savefig')
@patch.object(plt, 'savefig')
def test_simulate_inter_run_correlation(self, mock_savefig):
correlation_simulation.simulate_inter_run_correlation()
assert_array_equal(
mock_savefig.call_args[0][0],
'{0}/figures/sim_inter_run.png'.format(REPO_HOME_PATH))
main_module = imp.load_source('__main__', '../correlation_simulation.py'.format(REPO_HOME_PATH))
correlation_simulation_path = '{0}/code/stat159lambda/simulations/correlation_simulation.py'.format(REPO_HOME_PATH)
main_module = imp.load_source('__main__', correlation_simulation_path)
self.assertEqual(main_module.__name__, '__main__')

0 comments on commit b9aa90d

Please sign in to comment.