Skip to content

Instantly share code, notes, and snippets.

@brianthelion
Last active August 1, 2016 14:08
Show Gist options
  • Save brianthelion/f0d010585339ff2259358cb8a640d1ad to your computer and use it in GitHub Desktop.
Save brianthelion/f0d010585339ff2259358cb8a640d1ad to your computer and use it in GitHub Desktop.
nose testing examples for numpy/matlab unit regressions
import matlab
from Zhang_Suen_ported.py import Zhang_Suen
TEST_LIST = [
('Zhang_Suen.m', Zhang_Suen, (fin2, )),
]
def call_matlab(ml_func_name, args):
NotImplementedError("Do some magic here")
def _test_maker(ml_func_name, np_func, args):
ml_output = call_matlab(ml_func_name, args)
np_output = np_func(*args)
return np.all_close(ml_output, np_output)
def test_all_units():
for ml_func_name, np_func, args in TEST_LIST:
yield _test_maker, ml_func_name, np_func, args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment