FilingManager

class managers.filing.FilingManager

Available methods:

Method name Method type
available_modelscales() static method
modelscale_inventory() static method
get_responsepath_check_create() static method
responsepath_check_create() class method
static available_modelscales()

Returns a list of available model_scale.

Arguments: No arguments

Returned value: list of model scales (directory names)

Raised Exceptions: ValueError if there are no model_scale

Use case:

>> fm = FilingManager()

>> fm.available_modelscales()

static get_responsepath_check_create(list_dir_names)

Crawler operator checks for the response path (if it already exists). Otherwise a reponse path is created by the PathSpawner operator. Regardless, the response is returned. The path is of the form ~/cerebmodels/responses/<model_scale>/<model_name>/.

Argument: list of string elements of the form ["responses", "<model_scale>", "<model_name>"].

NOTE: ['responses', chosenmodel.modelscale, chosenmodel.modelname] is equivalent to ['responses', 'cells', 'DummyModel'].

This is called by :py:meth: .responsepath_check_create().

static modelscale_inventory(model_scale=None)

Returns a list of available model for given model_scale.

Keyword argument:

Key Value type
model_scale string; egs. “cells”, “microcircuits”, “networks”

Returned value: list of model names (model directory names)

Raised exceptions:

  • ValueError if the given model_scale is not listed
  • ValueError if the model_scale has no models.

Use case:

>> fm = FilingManager()

>> fm.modelscale_inventory(model_scale="cells")

classmethod responsepath_check_create(list_dir_names=None, chosenmodel=None)

Returns path to the reponse.

Keyword argument:

Key Value type
list_dir_names or chosenmodel

list of three strings

instantiated model

Returned value: path (string) `` ~/cerebmodel/responses/<model_scale>/<model_name>``

Raised exceptions: ValueError if the argument list_dir_names is not of the form ["responses", "<model_scale>", "<model_name>"]

Use case:

>> fm = FilingManager()

Then,

>> fm.responsepath_check_create(list_dir_names=["responses", "cells", "DummyModel"])

OR

>> fm.responsepath_check_create( chosenmodel = DummyModel() )

static show_filenames_with_path(dir_names)

This is identical to show_files method of Crawler

Returned Value: dictionary whose key is the filename and its filepath is the value.