simrunutils

utils

Utility and convenience functions for the simrun package.

Provides functions to parse out specific info from parameter files, silence stdout, subdivide arrays for multiprocessing purposes, and more.

Functions

get_cellnumbers_from_confile(confile)

Get the amount of cells of each type from a confile.

split_network_param_in_one_elem_dicts(dict_)

Split a network parameter dictionary into a list of dictionaries.

get_default_arguments(func)

Gets the keyword arguments with their default value from any function.

set_default_arguments_if_not_set(o, kwargs)

Set default arguments of an object if they are not set.

load_param_file_if_path_is_provided(pathOrParam)

Convenience function to load a parameter file whether it is a string or a dictionary.

tar_folder(source_dir, delete_folder)

Compress a folder to .tar format.

chunkIt(seq, num)

Split a sequence in multiple lists which have approximately equal size.

silence_stdout(fun)

Decorator function to silence a function’s output.

get_fraction_of_landmarkAscii(frac, path)

Sample landmarks (i.e. 3D points) from a landmarkAscii file.

get_fraction_of_landmarkAscii_dir(frac, basedir)

Sample landmarks from all landmarkAscii files in a directory.

select_cells_that_spike_in_interval(sa, tmin, tmax, set_index)

Select cells whose synapses were active in a given time interval.