def run_examples(example, pipelines, plugin): print 'running example: %s with plugin: %s'%(example, plugin) from nipype.utils.config import NipypeConfig config = NipypeConfig() config.enable_debug_mode() __import__(example) for pipeline in pipelines: wf = getattr(sys.modules[example], pipeline) wf.base_dir = os.path.join(os.getcwd(), 'output', example, plugin) if os.path.exists(wf.base_dir): rmtree(wf.base_dir) wf.config = {'execution' :{'hash_method': 'timestamp', 'stop_on_first_rerun': 'true'}} wf.run(plugin=plugin, plugin_args={'n_procs': 4}) #run twice to check if nothing is rerunning wf.run(plugin=plugin)
def run_examples(example, pipelines, plugin): print 'running example: %s with plugin: %s' % (example, plugin) from nipype.utils.config import NipypeConfig config = NipypeConfig() config.enable_debug_mode() __import__(example) for pipeline in pipelines: wf = getattr(sys.modules[example], pipeline) wf.base_dir = os.path.join(os.getcwd(), 'output', example, plugin) if os.path.exists(wf.base_dir): rmtree(wf.base_dir) wf.config = { 'execution': { 'hash_method': 'timestamp', 'stop_on_first_rerun': 'true' } } wf.run(plugin=plugin, plugin_args={'n_procs': 4}) #run twice to check if nothing is rerunning wf.run(plugin=plugin)
""" Test the nipype interface caching mechanism """ from tempfile import mkdtemp from shutil import rmtree from nose.tools import assert_equal from nipype.caching import Memory from nipype.pipeline.tests.test_engine import TestInterface from nipype.utils.config import NipypeConfig config = NipypeConfig() config.set_default_config() nb_runs = 0 class SideEffectInterface(TestInterface): def _run_interface(self, runtime): global nb_runs nb_runs += 1 runtime.returncode = 0 return runtime def test_caching(): temp_dir = mkdtemp(prefix='test_memory_') old_rerun = config.get('execution', 'stop_on_first_rerun') try: # Prevent rerun to check that evaluation is computed only once
from nipype.utils.config import NipypeConfig from nipype.utils.logger import Logging config = NipypeConfig() logging = Logging(config)
""" Test the nipype interface caching mechanism """ from tempfile import mkdtemp from shutil import rmtree from nose.tools import assert_equal from nipype.caching import Memory from nipype.pipeline.tests.test_engine import TestInterface from nipype.utils.config import NipypeConfig config = NipypeConfig() config.set_default_config() nb_runs = 0 class SideEffectInterface(TestInterface): def _run_interface(self, runtime): global nb_runs nb_runs += 1 runtime.returncode = 0 return runtime def test_caching(): temp_dir = mkdtemp(prefix='test_memory_') old_rerun = config.get('execution', 'stop_on_first_rerun') try: # Prevent rerun to check that evaluation is computed only once config.set('execution', 'stop_on_first_rerun', 'true')