nrv.backend

Description

backend: code for IO, machine and classes handling

the backend sub-package is dedicated to handling the magic behind all NRV computations. The code developed here is not meant to be used directly by the end-user, but internally to develop new functionality or maintain other sub-packages.

Classes

nrv_config(*args, **kwargs)

A unique class to handle all the configuration

NRV_Encoder(*[, skipkeys, ensure_ascii, ...])

Json encoding class, specific for NRV2 axon prevent from type error due to np.arrays solution taken as this from askpython.com

bcolors()

pbar(n_tot[, label])

Progess bar object compatible with MPI

Mcore_handler(*args, **kwargs)

Class to handle parallel processing (cores, no threads) in NRV2

NRV_class()

Instanciate a basic NRV class NRV Class are empty shells, defined as abstract classes of which every class in NRV should inherite.

NRV_results([context])

Results class for NRV

sim_results([context])

NRV_simulable([t_sim, dt, record_V_mem, ...])

Generic class for all NRV simulable classes (nerve, fascicle, myelinated).

NRV_singleton

Should be used as metaclass to define singleton classes

nrv_parameters()

A class for NRV parameters used to gather parameters

Functions

is_iterable(some_stuff)

this function chels wether or not a variable contains an iterrable

rmv_ext(fname)

return filename without extension

generate_new_fname(fname)

Prevent overwriting existing files.

create_folder(foldername[, access_rights])

create a folder with controled access rights.

check_json_fname(fname)

Add ".json" extension is missing at the end of the file name and check if it exists.

json_dump(results, filename)

save stuff as a json file

json_load(filename)

Load stuff from a json file

load_dxf_file(filename)

UNDER DEV

set_attributes(my_object, attributes_dict)

check_function_kwargs(func, kwargs)

check that the keys of a dictionnary are arguments of a function and return an updated dictionnary with only valide keys

function_to_str(func)

str_to_function(lines)

init_reporter()

set_log_level(level[, clear_log_file])

rise_error(*args[, out])

Rises and error to the log and to the prompt for the master process (process ID 0) in case of parallel computing.

rise_warning(*args[, abort])

Rises a warning to the log and to the prompt for the master process (process ID 0) in case of parallel computing.

pass_info(*args, **kwargs)

Pass an info to the log and to the prompt for the master process (process ID 0) in case of parallel computing.

pass_debug_info(*args, **kwargs)

Pass an info to the log and to the prompt for the master process (process ID 0) in case of parallel computing.

progression_popup(current, max_iter[, ...])

Displays the progression on prompt, for single process only, nothing saved to the log

prompt_debug(*args)

outputs for debug, simple redirection to icecream without the installation (see icecream help).

clear_prompt_line([n])

Clear lines of the prompt, to overwrite stuffs.

synchronize_processes()

synchronize all processes, used to wait saving complete before loading

is_NRV_class(x)

Check if the object x is a NRV_class.

is_NRV_class_list(x)

check if the object x is a list containing only NRV_class.

is_NRV_class_dict(x)

check if the object x is a dictionary containing only NRV_class.

is_NRV_dict(x)

Check if the object x is a dictionary of saved NRV_class.

is_NRV_dict_list(x)

Check if the object x is a list of dictionary of saved NRV_class.

is_NRV_dict_dict(x)

Check if the object x is a dictionary containing dictionaries of saved NRV_class.

is_NRV_object_dict(x)

Check if the object x is_NRV_dict, is_NRV_dict_list or is_NRV_dict_dict.

is_empty_iterable(x)

check if the object x is an empty iterable

load_any(data, **kwargs)

loads any type of NRV object from a json file or a dictionary generated with NRV_class.save

generate_results(obj, **kwargs)

generate the proper results object depending of the obj simulated

is_NRV_simulable(x)

Check if the object x is a NRV_simulable.

simulable(x)

Check if the object x is a NRV_simulable.

singlecore(func)

Decorator to restrict the processing on a signel core, always core 0 (master)