diameter_synthesis.main

Main functions to learn and generate diameters.

Functions

diametrize_single_neuron(neuron[, neurite_types])

Diametrize single neuron by learning simpler diameter model from it.

plot_models(morphologies, config, ...[, ext])

Plot the models.

run_diameters(config_file, models_params_file)

Build new diameters from config file and diameter model.

run_models(config_file, plot[, ext])

Run the model extraction from config file.

Classes

DiameterWorker(model, models_params, config)

Worker for building diameters.

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

Class to encode numpy arrays.

class diameter_synthesis.main.DiameterWorker(model, models_params, config)

Bases: object

Worker for building diameters.

Parameters:
  • model (str) – The model to use.

  • models_params (dict) – The parameters of the models containing the model name as key.

  • config (dict) – The configuration to use.

class diameter_synthesis.main.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

Bases: JSONEncoder

Class to encode numpy arrays.

default(o)

Numpy encoder.

diameter_synthesis.main.diametrize_single_neuron(neuron, neurite_types=None)

Diametrize single neuron by learning simpler diameter model from it.

Parameters:
  • neuron (mophio.mut.Morphology) – neuron to consider.

  • neurite_types (list) – list of neurite types to consider, if None basal/apical will be used

diameter_synthesis.main.plot_models(morphologies, config, models_params, models_data, ext='.png')

Plot the models.

Parameters:
  • morphologies (dict) – a dict with mtype->[morphologies].

  • config (dict) – the config to use.

  • models_params (dict) – the models parameters.

  • models_data (dict) – the models data.

  • ext (str) – the file extension used to export the figures.

diameter_synthesis.main.run_diameters(config_file, models_params_file)

Build new diameters from config file and diameter model.

Parameters:
  • config_file (str) – the path to the configuration file.

  • models_params_file (str) – the path to the file containing the model parameters.

diameter_synthesis.main.run_models(config_file, plot, ext='.png')

Run the model extraction from config file.

Parameters:
  • config_file (str) – the path to the configuration file.

  • plot (bool) – plot the models once they are built.

  • ext (str) – the file extension used to export the plots.