Example #1
0
def depolarization_block_test(model, base_directory):
    # Load target data
    with open('../target_features/depol_block_target_data.json') as f:
        observation = json.load(f, object_pairs_hook=collections.OrderedDict)

    # observation = config['features']
    IPython.display.HTML(json2html.convert(json=observation))

    # Instantiate the test class

    test = tests.DepolarizationBlockTest(observation=observation,
                                         force_run=False,
                                         show_plot=True,
                                         save_all=True,
                                         base_directory=base_directory)

    # Number of parallel processes
    test.npool = 10

    try:
        # Run the test
        score = test.judge(model)
        # Summarize and print the score achieved by the model on the test using SciUnit's summarize function
        score.summarize()
    except Exception as e:
        print('Model: ' + model.name + ' could not be run')
        print(e)
        pass
Example #2
0
import os

from quantities import mV, nA
import sciunit
from hippounit import models
from hippounit import tests
from hippounit import capabilities

import matplotlib.pyplot as plt


target_Ith = 0.6*nA
Ith_SD = 0.3*nA
target_Veq = -40.1*mV
Veq_SD = 3.4*mV

observation = {'mean_Ith':target_Ith,'Ith_std':Ith_SD, 'mean_Veq': target_Veq, 'Veq_std': Veq_SD}

show_plot=False
test = tests.DepolarizationBlockTest(observation, force_run=False, show_plot=show_plot)

model = models.Bianchi()
score = test.judge(model)
score.summarize()


if show_plot: plt.show()