Beispiel #1
0
    def test_import_module_from_path(self):
        from sciunit.utils import import_module_from_path

        temp_file = tempfile.mkstemp(suffix='.py')[1]
        with open(temp_file,'w') as f:
            f.write('value = 42')
        module = import_module_from_path(temp_file)
        self.assertEqual(module.value,42)
Beispiel #2
0
    def test_import_module_from_path(self):
        from sciunit.utils import import_module_from_path

        temp_file = tempfile.mkstemp(suffix='.py')[1]
        with open(temp_file, 'w') as f:
            f.write('value = 42')
        module = import_module_from_path(temp_file)
        self.assertEqual(module.value, 42)
Beispiel #3
0
 def load(self):
     nrn_path = os.path.splitext(
         self.model.orig_lems_file_path)[0] + '_nrn.py'
     nrn = import_module_from_path(nrn_path)
     self.reset_neuron(nrn.neuron)
     modeldirname = os.path.dirname(self.model.orig_lems_file_path)
     self.set_stop_time(500 * ms)
     self.h.tstop
     self.ns = nrn.NeuronSimulation(self.h.tstop, dt=0.0025)