예제 #1
0
def test_mapnode_expansion(tmpdir):
    tmpdir.chdir()
    from nipype import MapNode, Function

    def func1(in1):
        return in1 + 1

    mapnode = MapNode(
        Function(function=func1), iterfield="in1", name="mapnode", n_procs=2, mem_gb=2
    )
    mapnode.inputs.in1 = [1, 2]

    for idx, node in mapnode._make_nodes():
        for attr in ("overwrite", "run_without_submitting", "plugin_args"):
            assert getattr(node, attr) == getattr(mapnode, attr)
        for attr in ("_n_procs", "_mem_gb"):
            assert getattr(node, attr) == getattr(mapnode, attr)
예제 #2
0
def test_mapnode_expansion(tmpdir):
    tmpdir.chdir()
    from nipype import MapNode, Function

    def func1(in1):
        return in1 + 1

    mapnode = MapNode(Function(function=func1),
                      iterfield='in1',
                      name='mapnode',
                      n_procs=2,
                      mem_gb=2)
    mapnode.inputs.in1 = [1, 2]

    for idx, node in mapnode._make_nodes():
        for attr in ('overwrite', 'run_without_submitting', 'plugin_args'):
            assert getattr(node, attr) == getattr(mapnode, attr)
        for attr in ('_n_procs', '_mem_gb'):
            assert (getattr(node, attr) == getattr(mapnode, attr))
예제 #3
0
def test_mapnode_expansion(tmpdir):
    tmpdir.chdir()
    from nipype import MapNode, Function

    def func1(in1):
        return in1 + 1

    mapnode = MapNode(Function(function=func1),
                      iterfield='in1',
                      name='mapnode',
                      n_procs=2,
                      mem_gb=2)
    mapnode.inputs.in1 = [1, 2]

    for idx, node in mapnode._make_nodes():
        for attr in ('overwrite', 'run_without_submitting', 'plugin_args'):
            assert getattr(node, attr) == getattr(mapnode, attr)
        for attr in ('_n_procs', '_mem_gb'):
            assert (getattr(node, attr) ==
                    getattr(mapnode, attr))
예제 #4
0
def test_mapnode_expansion(tmpdir):
    os.chdir(str(tmpdir))
    from nipype import MapNode, Function

    def func1(in1):
        return in1 + 1

    mapnode = MapNode(Function(function=func1),
                      iterfield='in1',
                      name='mapnode')
    mapnode.inputs.in1 = [1, 2]
    mapnode.interface.num_threads = 2
    mapnode.interface.estimated_memory_gb = 2

    for idx, node in mapnode._make_nodes():
        for attr in ('overwrite', 'run_without_submitting', 'plugin_args'):
            assert getattr(node, attr) == getattr(mapnode, attr)
        for attr in ('num_threads', 'estimated_memory_gb'):
            assert (getattr(node._interface,
                            attr) == getattr(mapnode._interface, attr))