bluepymm.run_combos package

Submodules

bluepymm.run_combos.calculate_scores module

Python Model Management

bluepymm.run_combos.calculate_scores.calculate_scores(final_dict, emodel_dirs, scores_db_filename, use_ipyp=False, ipyp_profile=None, timeout=10, use_apical_points=True, n_processes=None)[source]

Calculate scores of e-model morphology combinations and update the database accordingly.

Parameters
  • scores_db_filename – path to .sqlite database with e-model morphology combinations

  • final_dict – a dict mapping e-models to dicts with e-model parameters

  • emodel_dirs – a dict mapping e-models to the directories with e-model input files

  • use_ipyp – bool indicating whether ipyparallel is used. Default is False.

  • ipyp_profile – path to ipyparallel profile. Default is None.

  • use_apical_points – boolean to use apical points or not

  • n_processes – the integer number of processes. If None,

  • used. (all processes are going to be) –

bluepymm.run_combos.calculate_scores.create_arg_list(scores_db_filename, emodel_dirs, final_dict, extra_values_error=False, use_apical_points=True)[source]

Create list of argument tuples to be used as an input for run_emodel_morph.

Parameters
  • scores_db_filename – path to .sqlite database

  • emodel_dirs – a dict mapping e-models to the directories with e-model input files

  • final_dict – a dict mapping e-models to dicts with e-model parameters

  • extra_values_error – boolean to raise an exception upon a missing key

  • use_apical_points – boolean to use apical points or not

Raises
  • ValueError, if one of the database entries contains has value None for

  • the key 'emodel'.

bluepymm.run_combos.calculate_scores.expand_scores_to_score_values_table(scores_sqlite_filename)[source]

Read scores from sqlite table, expand to dataframe, and store in new table ‘score_values’. Each column of the new table corresponds to a single score.

Parameters

scores_sqlite_filename – path to sqlite database with keys ‘scores’ and ‘to_run’

Raises
  • Exception, if the scores table contains at least one entry where the

  • value of 'to_run' is True.

bluepymm.run_combos.calculate_scores.read_apical_point(morph_dir, morph_name)[source]

Read apical point from apical point json file

bluepymm.run_combos.calculate_scores.run_emodel_morph(emodel, emodel_dir, emodel_params, morph_path, apical_point_isec, extra_values_error=True)[source]

Run e-model morphology combination.

Parameters
  • emodel – e-model name

  • emodel_dir – directory containing e-model files

  • emodel_params – dict that maps e-model parameters to their values

  • morph_path – path to morphology

  • apical_point_isec – integer value of the apical point isection

  • extra_values_error – boolean to raise an exception upon a missing key

Returns

  • dict that maps features to scores

  • dict with extra values: ‘holding_current’ and ‘threshold_current’

Return type

tuple

bluepymm.run_combos.calculate_scores.run_emodel_morph_isolated(input_args)[source]

Run e-model morphology combination in isolated environment.

Parameters
  • input_args – tuple

  • uid (-) – unique identifier of the e-model morphology combination

  • emodel (-) – e-model name

  • emodel_dir (-) – directory containing e-model files

  • emodel_params (-) – dict that maps e-model parameters to their values

  • morph_path (-) – path to morphology

  • apical_point_isec (-) – integer value of the apical point isection

  • extra_values_error (-) – boolean to raise an exception upon a missing key

Returns

Dict with keys ‘exception’, ‘extra_values’, ‘scores’, ‘uid’.

bluepymm.run_combos.calculate_scores.save_scores(scores_db_filename, uid, scores, extra_values, exception, float_representation='.17g')[source]

Update a specific entry in a given database with scores and related parameters.

Parameters
  • scores_db_filename – path to .sqlite database

  • uid – unique identifier of database entry

  • scores – scores dict to be added to entry as a json string

  • extra_values – dict to be added to entry as a json string

  • exception – description of exception that may have happened during score calculation

  • float_representation – use for json encoding. Default is ‘.17g’.

Returns

ValueError if entry has already been updated.

bluepymm.run_combos.main module

Run combinations and calculate scores.

bluepymm.run_combos.main.add_parser(action)[source]

Add parser

bluepymm.run_combos.main.run_combos(conf_filename, ipyp=None, ipyp_profile=None, n_processes=None)[source]

Run combos

bluepymm.run_combos.main.run_combos_from_conf(conf_dict, ipyp=None, ipyp_profile=None, timeout=10, n_processes=None)[source]

Run combos from conf dictionary

Module contents

Init run combos