예제 #1
0
 def test_read_write(self):
     celldata = CellParams(number_of_cells=5, spikiness_range=(0, 0.5), spike_size_range=(0.1, 1))
     celldata.save('data/celldata.csv')
     celldata2 = CellParams()
     celldata2.read_from_csv('data/celldata.csv')
     self.assertEqual(len(celldata), len(celldata2))
     for c in celldata.columns:
         self.assertEqual(c in celldata2.columns, True)
     shutil.rmtree('data/')
예제 #2
0
def generate_cell_parameters(outputfile, **kwargs):
    """
    Generates random cell parameters and save them into a given csv file.
    
    Parameters
    ----------
    outputfile : str
        Path to save cell parameters.
    kwargs : key, value pairings
        Keyword arguments passed to the `CellParams` class.

    """
    if not outputfile.endswith('.csv'):
        outputfile += '.csv'
    params = CellParams(**kwargs)
    params.save(outputfile)
예제 #3
0
 def test_valid_types(self, kind):
     celldata = CellParams(kind=kind)
     celldata.save('data/celldata.csv')
     self.assertEqual(os.path.exists('data/celldata.csv'), True)
     shutil.rmtree('data/')
예제 #4
0
 def test_cell_data(self, size):
     celldata = CellParams(number_of_cells=1, size_mean_and_std=size)
     celldata.save('data/celldata.csv')
     celldata.plot_size_distribution()
     shutil.rmtree('data/')