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),
     )
Exemplo n.º 2
0
 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),
     )
Exemplo n.º 3
0
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'])
Exemplo n.º 4
0
def test_saver_has_calls(mocked_saver):
    Collector.collect(5, 128, "name", " path")
    mocked_saver.assert_called_once()
Exemplo n.º 5
0
def test_collector_raises_exception_when_not_on_linux():
    with pytest.raises(InvalidOSException):
        Collector.collect(0, 0, "", "")
Exemplo n.º 6
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'])