def execute(self): super().execute() Collector.collect( self.get_int_value(Key.AMOUNT), self.get_int_value(Key.SIZE), self.arguments.get(Key.NAME), self.arguments.get(Key.PATH), )
def execute(self): super().execute() Collector.collect( amount=self.get_int_value(Key.AMOUNT), size=self.get_int_value(Key.SIZE), name=self.arguments.get(Key.NAME), path=self.arguments.get(Key.PATH), )
def test_collect(): data = Collector.collect(5, 128, 'unlabeled_matrices', 'modules/shared/data/') assert len(data) == 5 for matrix in data: plt.spy(matrix.todense()) plt.show() created_file = h5py.File('modules/shared/data/unlabeled_matrices.hdf5', 'r') print(created_file['dense_matrices'])
def test_saver_has_calls(mocked_saver): Collector.collect(5, 128, "name", " path") mocked_saver.assert_called_once()
def test_collector_raises_exception_when_not_on_linux(): with pytest.raises(InvalidOSException): Collector.collect(0, 0, "", "")
def test_collect(): data = Collector.collect(5, 128, 'unlabeled_matrices', 'data/') assert len(data) == 5 created_file = h5py.File('data/unlabeled_matrices.hdf5', 'r') print(created_file['dense_matrices'])