def test_interp_attributes_05(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) assert isinstance(interp_handler.snapshots, np.ndarray)
def test_interp_attributes_01(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) assert interp_handler.output_name == output_name
def test_interp_start_snapshots_01(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) interp_handler.start() assert interp_handler.snapshots.shape == (1, 4)
def test_interp_print_info(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) interp_handler.start() interp_handler.print_info()
def test_interp_write_structures_01(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) interp_handler.start() interp_handler.write_structures() os.remove('triangulation_scalar.npy')
def test_interp_start_mu_values_02(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) interp_handler.start() expected_mu_values = np.load('tests/test_datasets/mu_values_test.npy') np.testing.assert_array_almost_equal(interp_handler.mu_values, expected_mu_values)
def test_interp_add_snapshot_03(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) interp_handler.start() interp_handler.add_snapshot() np.testing.assert_almost_equal(interp_handler.snapshots[0, 0], 36.3507969378)
def test_interp_add_snapshot_02(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) interp_handler.start() interp_handler.add_snapshot() print interp_handler.snapshots[0, -1] np.testing.assert_almost_equal(interp_handler.snapshots[0, -1], 17.57596528)
def test_interp_add_snapshot_01(self): output_name = 'Pressure_drop' namefile_prefix = 'tests/test_datasets/matlab_scalar_0' file_format = '.mat' interp_handler = interp.Interp(output_name, namefile_prefix, file_format) interp_handler.start() interp_handler.add_snapshot() mu_1 = np.array([-.5, .5, .5, -.5, -0.22280828]) mu_2 = np.array([-.5, -.5, .5, .5, -0.46651485]) expected_mu_values = np.array([mu_1, mu_2]) np.testing.assert_array_almost_equal(interp_handler.mu_values, expected_mu_values)