示例#1
0
文件: moose.py 项目: AdrianW15/moose
def syncDataHandler(target):
    """Synchronize data handlers for target.

    Parameters
    ----------
    target : melement/vec/str
        Target element or vec or path string.

    Raises
    ------
    NotImplementedError
        The call to the underlying C++ function does not work.

    Notes
    -----
    This function is defined for completeness, but currently it does not work.

    """
    raise NotImplementedError('The implementation is not working for IntFire - goes to invalid objects. \
First fix that issue with SynBase or something in that line.')
    if isinstance(target, str):
        if not moose.exists(target):
            raise ValueError('%s: element does not exist.' % (target))
        target = vec(target)
        moose.syncDataHandler(target)
示例#2
0
def library1():
    import moose.genesis
    import moose.SBML
    import moose.chemMerge
    import moose.utils
    import moose.network_utils
    print('done')

    p1 = moose.le()
    a = moose.Pool('/a')
    for i in range(10):
        moose.Pool('/a/p%d' % i)
    p2 = moose.le()
    assert set(p2) - set(p1) == set(['/a'])
    aa = moose.le(a)
    assert len(aa) == 10

    try:
        moose.syncDataHandler('/a')
    except NotImplementedError:
        pass

    try:
        moose.showfield('/x')
    except ValueError:
        pass

    moose.showfield('/a')
    moose.showfields('/a')
示例#3
0
def syncDataHandler(target):
    """Synchronize data handlers for target.

    Parameters
    ----------
    target : melement/vec/str
        Target element or vec or path string.

    Raises
    ------
    NotImplementedError
        The call to the underlying C++ function does not work.

    Notes
    -----
    This function is defined for completeness, but currently it does not work.

    """
    raise NotImplementedError('The implementation is not working for IntFire - goes to invalid objects. \
First fix that issue with SynBase or something in that line.')
    if isinstance(target, str):
        if not moose.exists(target):
            raise ValueError('%s: element does not exist.' % (target))
        target = vec(target)
        moose.syncDataHandler(target)