def __init__(self,
                 observation = {'mean_Ith':None, 'Ith_std':None, 'mean_Veq': None, 'Veq_std': None}  ,
                 name="Depolarization block test" ,
                 force_run=False,
                 base_directory= None,
                show_plot=True,
                save_all=True):

        observation = self.format_data(observation)

        Test.__init__(self,observation,name)

        self.required_capabilities += (cap.ReceivesSquareCurrent_ProvidesResponse,)

        self.force_run = force_run
        self.base_directory = base_directory
        self.save_all = save_all

        self.show_plot = show_plot

        self.path_temp_data = None #added later, because model name is needed
        self.path_figs = None
        self.path_results = None

        self.figures = []

        self.npool = multiprocessing.cpu_count() - 1

        self.logFile = None
        self.test_log_filename = 'test_log.txt'

        description = "Tests if the model enters depolarization block under current injection of increasing amplitudes."
Пример #2
0
    def test_ObservationValidator(self):
        import random

        from sciunit import Test
        from sciunit.validators import ObservationValidator

        long_test_list = [None] * 100
        for index in range(100):
            long_test_list[index] = random.randint(1, 1000)

        q = pq.Quantity([1, 2, 3], "ft")
        units = q.simplified.units
        units.name = "UnitName"
        testObj = Test(long_test_list)
        testObj.units = units
        obsVal = ObservationValidator(test=testObj)

        # test constructor
        self.assertRaises(BaseException, ObservationValidator)
        self.assertIsInstance(obsVal, ObservationValidator)

        # test _validate_iterable
        obsVal._validate_iterable(True, "key", long_test_list)
        self.assertRaises(
            BaseException,
            obsVal._validate_iterable,
            is_iterable=True,
            key="Test key",
            value=0,
        )

        # test _validate_units
        self.assertRaises(
            BaseException,
            obsVal._validate_units,
            has_units=True,
            key="Test Key",
            value="I am not units",
        )

        # units in test object is q.simplified.units
        obsVal._validate_units(has_units=True, key="TestKey", value=q)

        # units in test object is a dict
        testObj.units = {"TestKey": units}
        obsVal._validate_units(has_units=True, key="TestKey", value=q)

        print(
            "debug here..............................................................................."
        )
        # Units dismatch
        q2 = pq.Quantity([1], "J")
        self.assertRaises(
            BaseException,
            obsVal._validate_units,
            has_units=True,
            key="TestKey",
            value=q2,
        )
Пример #3
0
	def __init__(self,
			     observation={'mean':None,'std':None},
			     name="Resting potential test"):
		"""Takes the mean and standard deviation of reference membrane potentials."""
		
		Test.__init__(self,observation,name)
		self.required_capabilities += (ProducesMembranePotential,
							  		   ReceivesCurrent,)
Пример #4
0
    def __init__(self, config = {},
                observation = {"mean_AP1_amp_at_50um" : None,
                 "std_AP1_amp_at_50um" : None,
                 "mean_AP1_amp_at_150um" : None,
                 "std_AP1_amp_at_150um" : None,
                 "mean_AP1_amp_at_250um" : None,
                 "std_AP1_amp_at_250um" : None,
                 "mean_AP1_amp_strong_propagating_at_350um" : None,
                 "std_AP1_amp_strong_propagating_at_350um" : None,
                 "mean_AP1_amp_weak_propagating_at_350um" : None,
                 "std_AP1_amp_weak_propagating_at_350um" : None,

                 "mean_APlast_amp_at_50um" : None,
                 "std_APlast_amp_at_50um" : None,
                 "mean_APlast_amp_at_150um" : None,
                 "std_APlast_amp_at_150um" : None,
                 "mean_APlast_amp_at_250um" : None,
                 "std_APlast_amp_at_250um" : None,
                 "mean_APlast_amp_at_350um" : None,
                 "std_APlast_amp_at_350um" : None},

                name="Back-propagating action potential test" ,
                force_run=False,
                force_run_FindCurrentStim=False,
                base_directory= None,
                show_plot=True,
                save_all = True,
                trunk_origin = None):

        observation = self.format_data(observation)

        Test.__init__(self, observation, name)

        self.required_capabilities += (cap.ReceivesSquareCurrent_ProvidesResponse_MultipleLocations,
                                        cap.ProvidesRecordingLocationsOnTrunk, cap.ReceivesSquareCurrent_ProvidesResponse,)

        self.force_run = force_run
        self.force_run_FindCurrentStim = force_run_FindCurrentStim

        self.show_plot = show_plot
        self.save_all = save_all

        self.base_directory = base_directory
        self.path_temp_data = None #added later, because model name is needed
        self.path_figs = None
        self.path_results = None
        self.trunk_origin = trunk_origin

        self.logFile = None
        self.test_log_filename = 'test_log.txt'

        self.npool = multiprocessing.cpu_count() - 1

        self.config = config

        description = "Tests the mode and efficacy of back-propagating action potentials on the apical trunk."
    def __init__(self,
                 config={},
                 observation={},
                 name="PSP attenuation test",
                 force_run=False,
                 base_directory=None,
                 show_plot=True,
                 num_of_dend_locations=15,
                 random_seed=1,
                 save_all=True,
                 trunk_origin=None):

        observation = self.format_data(observation)

        Test.__init__(self, observation, name)

        self.required_capabilities += (cap.ProvidesRandomDendriticLocations,
                                       cap.ReceivesEPSCstim)

        self.force_run = force_run

        self.show_plot = show_plot
        self.save_all = save_all

        self.base_directory = base_directory
        self.path_temp_data = None  #added later, because model name is needed
        self.path_figs = None
        self.path_results = None
        self.trunk_origin = trunk_origin

        self.logFile = None
        self.test_log_filename = 'test_log.txt'

        self.npool = multiprocessing.cpu_count() - 1

        self.config = config

        self.num_of_dend_locations = num_of_dend_locations
        self.random_seed = random_seed

        description = "Tests how much synaptic potential attenuates from the dendrite (different distances) to the soma."
Пример #6
0
    def __init__(self,
                 observation={},
                 config={},
                 name="Somatic features test",
                 force_run=False,
                 base_directory=None,
                 show_plot=True,
                 save_all=True,
                 specify_data_set=''):

        Test.__init__(self, observation, name)

        self.required_capabilities += (
            cap.ReceivesSquareCurrent_ProvidesResponse, )

        self.force_run = force_run
        self.show_plot = show_plot
        self.save_all = save_all
        self.config = config

        self.base_directory = base_directory

        self.path_temp_data = None  #added later, because model name is needed
        self.path_figs = None
        self.path_results = None
        self.npool = multiprocessing.cpu_count() - 1

        self.logFile = None
        self.test_log_filename = 'test_log.txt'
        self.specify_data_set = specify_data_set  #this is added to the name of the directory (somaticfeat), so tests runs using different data sets can be saved into different directories

        plt.close(
            'all'
        )  #needed to avoid overlapping of saved images when the test is run on multiple models in a for loop
        #with open('./stimfeat/PC_newfeat_No14112401_15012303-m990803_stimfeat.json') as f:
        #self.config = json.load(f, object_pairs_hook=collections.OrderedDict)

        description = "Tests some somatic features under current injection of increasing amplitudes."
Пример #7
0
 def __init__(self, observation=None, name=None):
     Test.__init__(self, observation, name)
Пример #8
0
	def __init__(self,
			     observation={'mean':None,'std':None},
			     name="Action potential width"):
		"""Takes the mean and standard deviation of observed spike widths"""
		
		Test.__init__(self,observation,name) 
Пример #9
0
 def __init__(self, observation=None, name=None):
     Test.__init__(self, observation, name)