Ejemplo n.º 1
0
def dummy_catalogue(repo_path):
    """
    Fixture that returns a dummy `arbor.catalogue`
    which contains the `dummy` mech.
    """
    path = repo_path / "test" / "unit" / "dummy"
    cat_path = _build_cat("dummy", path)
    return arbor.load_catalogue(str(cat_path))
Ejemplo n.º 2
0
 def __init__(self):
     arb.recipe.__init__(self)
     self.tree = arb.segment_tree()
     self.tree.append(arb.mnpos, (0, 0, 0, 10), (1, 0, 0, 10), 1)
     self.props = arb.neuron_cable_properties()
     self.props.catalogue = arb.load_catalogue(cat)
     d = arb.decor()
     d.paint('(all)', 'dummy')
     d.set_property(Vm=0.0)
     self.cell = arb.cable_cell(self.tree, arb.label_dict(), d)
Ejemplo n.º 3
0
 def test_shared_catalogue(self):
     try:
         cat = arb.load_catalogue("lib/dummy-catalogue.so")
     except:
         print("BBP catalogue not found. Are you running from build directory?")
         raise
     nms = [m for m in cat]
     self.assertEqual(nms, ['dummy'], "Expected equal names.")
     for nm in nms:
         prm = list(cat[nm].parameters.keys())
         self.assertEqual(prm, ['gImbar'], "Expected equal parameters on mechanism '{}'.".format(nm))
Ejemplo n.º 4
0
    def __init__(self):
        arb.recipe.__init__(self)
        self.tree = arb.segment_tree()
        self.tree.append(arb.mnpos, (0, 0, 0, 10), (1, 0, 0, 10), 1)
        self.props = arb.neuron_cable_properties()
        try:
            self.props.catalogue = arb.load_catalogue('dummy-catalogue.so')
        except:
            print("Catalogue not found. Are you running from build directory?")
            raise
        self.props.catalogue = arb.default_catalogue()

        d = arb.decor()
        d.paint('(all)', arb.density('pas'))
        d.set_property(Vm=0.0)
        self.cell = arb.cable_cell(self.tree, arb.label_dict(), d)
Ejemplo n.º 5
0
 def test_nonexistent(self):
     with self.assertRaises(FileNotFoundError):
         arb.load_catalogue("_NO_EXIST_.so")
Ejemplo n.º 6
0
#!/usr/bin/env python3

import argparse
import os
import sys

import arbor

P = argparse.ArgumentParser(
    description=
    'Verify that a mechanism catalogue can be loaded through Python interface.'
)
P.add_argument('catname',
               metavar='FILE',
               help='path of the catalogue to test.')

args = P.parse_args()
catname = args.catname

print(catname)

if not os.path.isfile(catname):
    print('ERROR: unable to open catalogue file')
    sys.exit(1)

print([n for n in arbor.load_catalogue(catname).keys()])
Ejemplo n.º 7
0
 def test_nonexistent(self):
     with self.assertRaises(RuntimeError):
         arb.load_catalogue("_NO_EXIST_.so")