# Program Purpose: execute a number of functions using Numpy. # Author: Matthew T. Dunn # Date: 11/1/15 import sys import matplotlib.pyplot as plt import array_module from array_module import arraybuilder, twoDArray, thedivider, arraymath, generate_mandelbrot try: question1 = twoDArray() question2 = thedivider() question3 = arraymath() question4 = generate_mandelbrot() except KeyboardInterrupt, ValueError: print "\n Interrupted!" except EOFError: print "\n Interrupted!"
def test_twoDArray4(self): question1c = np.array([[2,7,12],[3,8,13],[4,9,14]]) npt.assert_array_equal(twoDArray()[3], question1c) # accessing the first returned value from the function.
def test_twoDArray5(self): question1d = np.array([6,7,8,4,9,5,10]) npt.assert_array_equal(twoDArray()[4], question1d) # accessing the first returned value from the function.
def test_twoDArray2(self): question1a = np.array([[2,7,12],[4,9,14]]) npt.assert_array_equal(twoDArray()[1], question1a) # accessing the second returned value from the function.
def test_twoDArray3(self): question1b = np.array([[6],[7],[8],[9],[10]]) npt.assert_array_equal(twoDArray()[2], question1b) # accessing the first returned value from the function.
#Program Purpose: execute a number of functions using Numpy. #Author: Matthew T. Dunn #Date: 11/1/15 import sys import matplotlib.pyplot as plt import array_module from array_module import arraybuilder, twoDArray, thedivider, arraymath, generate_mandelbrot try: question1 = twoDArray() question2 = thedivider() question3 = arraymath() question4 = generate_mandelbrot() except KeyboardInterrupt, ValueError: print "\n Interrupted!" except EOFError: print "\n Interrupted!"
def test_twoDArray1(self): question1 = np.array([[1, 6, 11], [2, 7, 12], [3, 8, 13], [4, 9, 14], [5, 10, 15]]) npt.assert_array_equal(twoDArray()[0], question1) # accessing the first returned value from the function.
def test_twoDArray5(self): question1d = np.array([6, 7, 8, 4, 9, 5, 10]) npt.assert_array_equal( twoDArray()[4], question1d ) # accessing the first returned value from the function.
def test_twoDArray4(self): question1c = np.array([[2, 7, 12], [3, 8, 13], [4, 9, 14]]) npt.assert_array_equal( twoDArray()[3], question1c ) # accessing the first returned value from the function.
def test_twoDArray3(self): question1b = np.array([[6], [7], [8], [9], [10]]) npt.assert_array_equal( twoDArray()[2], question1b ) # accessing the first returned value from the function.
def test_twoDArray2(self): question1a = np.array([[2, 7, 12], [4, 9, 14]]) npt.assert_array_equal( twoDArray()[1], question1a ) # accessing the second returned value from the function.
def test_twoDArray1(self): question1 = np.array([[1, 6, 11], [2, 7, 12], [3, 8, 13], [4, 9, 14], [5, 10, 15]]) npt.assert_array_equal( twoDArray()[0], question1) # accessing the first returned value from the function.