def test_run_do_not_modify_model_inplace(self): state = Mock() state.is_interruption_requested.return_value = True result = run_freeviz(self.data, self.projector, state) state.set_partial_result.assert_called_once() self.assertIs(self.projector, result.projector) self.assertIsNot(self.projection.proj, result.projection.proj) self.assertTrue((self.projection.components_.T != result.projection.components_.T).any())
def test_run_do_not_modify_model_inplace(self): state = Mock() state.is_interruption_requested.return_value = True result = run_freeviz(self.data, self.projector, state) state.set_partial_result.assert_called_once() self.assertIs(self.projector, result.projector) self.assertIsNot(self.projection.proj, result.projection.proj) self.assertTrue((self.projection.components_.T != result.projection.components_.T).any())
def test_run(self): state = Mock() state.is_interruption_requested = Mock(return_value=False) result = run_freeviz(self.data, self.projector, state) array = np.array([[1.66883742e-01, 9.40395481e-38], [-8.86817512e-02, 9.96060012e-01], [6.67450609e-02, -3.97675811e-01], [-1.44947052e-01, -5.98384200e-01]]) np.testing.assert_almost_equal(array.T, result.projection.components_) state.set_status.assert_called_once_with("Calculating...") self.assertGreater(state.set_partial_result.call_count, 40) self.assertGreater(state.set_progress_value.call_count, 40)
def test_run(self): state = Mock() state.is_interruption_requested = Mock(return_value=False) result = run_freeviz(self.data, self.projector, state) array = np.array([[1.66883742e-01, 9.40395481e-38], [-8.86817512e-02, 9.96060012e-01], [6.67450609e-02, -3.97675811e-01], [-1.44947052e-01, -5.98384200e-01]]) np.testing.assert_almost_equal(array.T, result.projection.components_) state.set_status.assert_called_once_with("Calculating...") self.assertGreater(state.set_partial_result.call_count, 40) self.assertGreater(state.set_progress_value.call_count, 40)