add drives explicitly in test_network.py
As pointed out by @jasmainak, tests in test_network.py rely heavily on drive parameters that get instantiated implicilty through the add_drives_from_params argument in Network.__init__(). I propose we add an explicit test for add_drive_from_params=True in test_drives.py and then deprecate dependency on add_drive_from_params in test_network.py. Tests in test_network.py should then be updated to check that explicit user-defined arguments are established in the network.
humm ... not sure if it's the same as what I was suggesting. Instead of doing:
repeats = 10
params.update({'repeats': repeats})
net = Network(params, add_params_from_drives=True)
assert net.external_drives[-1]['n_drive_cells'] == repeats
I was suggesting you should do the following:
n_drive_cells = 10
net = Network(params)
net.add_bursty_drive('myburstydrive', ..., n_drive_cells=n_drive_cells)
assert net.external_drives[-1]['n_drive_cells'] == n_drive_cells
assert len(net.gid_ranges['myburstydrive']) == n_drive_cells
very explicit and clear what's happening and it's testing the drive function directly.
Yes, that's exactly what I was imagining. I just said it in a rather convoluted way, sorry. I thought we should also validate that add_drives_from_params can be exactly reproduced by drives we add manually, but maybe that is unnecessary.
can this be addressed before 0.2 @rythorpe ?
Sorry for the delay @jasmainak. I have some time to work on it today.