Exemple #1
0

# Remove and recreate the old test-dir:
if os.path.exists(test_dir):
    shutil.rmtree(test_dir)
os.makedirs(output_dir)


# generate NMODL files
for model in models:
    # run the example script, saving the XML to file
    tc = TestableComponent(model)

    component = tc()
    #ComponentModifier.close_all_reduce_ports(component)
    ComponentModifier.remap_port_to_parameter(component, 'Isyn')

    nineml2nmodl.write_nmodldirect(component=component,
                                  mod_filename='%s/%s.mod'%(test_dir, model) )


    

# run nrnivmodl
p = Popen("nrnivmodl", shell=True, stdout=None, stderr=None, cwd=output_dir)
result = p.wait()
assert result == 0, "nrnivmodl failed"

# run test scripts
cwd = os.getcwd()
os.chdir(output_dir)