コード例 #1
0
    def test_sub_treatment(self):

        t = ptr.FMRITreatment(output_dir=self.tmp_dir)
        t.enable_draft_testing()
        sub_ts = t.split()
        for sub_t in sub_ts:
            sub_t.run()
コード例 #2
0
 def test_default_treatment_parallel_cluster(self):
     if cfg['parallel-cluster']['enable_unit_test'] == 1:
         t = ptr.FMRITreatment(make_outputs=False, result_dump_file=None,
                               output_dir=self.tmp_dir)
         t.enable_draft_testing()
         t.run(parallel='cluster')
     else:
         print 'Cluster testing is off '\
             '([cluster-LAN][enable_unit_test] = 0 in config.cfg'
コード例 #3
0
 def test_default_treatment_parallel_LAN(self):
     if cfg['parallel-LAN']['enable_unit_test'] == 1:
         t = ptr.FMRITreatment(make_outputs=False, result_dump_file=None,
                               output_dir=self.tmp_dir)
         t.enable_draft_testing()
         t.run(parallel='LAN')
     else:
         print 'LAN testing is off '\
             '([parallel-LAN][enable_unit_test] = 0 in ~/.pyhrf/config.cfg'
コード例 #4
0
 def test_default_jde_cmd_parallel_local(self):
     t = ptr.FMRITreatment(make_outputs=False, result_dump_file=None)
     t.enable_draft_testing()
     t_fn = op.join(self.tmp_dir, 'treatment.pck')
     fout = open(t_fn, 'w')
     cPickle.dump(t, fout)
     fout.close()
     cmd = 'pyhrf_jde_estim -t %s -x local' % t_fn
     if os.system(cmd) != 0:
         raise Exception('"' + cmd + '" did not execute correctly')
コード例 #5
0
    def test_jde_estim_from_treatment_pck(self):

        t = ptr.FMRITreatment(make_outputs=False, result_dump_file=None)
        t.enable_draft_testing()
        sub_ts = t.split()
        sub_t_fn = op.join(self.tmp_dir, 'treatment.pck')
        fout = open(sub_t_fn, 'w')
        cPickle.dump(sub_ts[0], fout)
        fout.close()
        cmd = 'pyhrf_jde_estim  -t %s' % sub_t_fn
        if os.system(cmd) != 0:
            raise Exception('"' + cmd + '" did not execute correctly')
コード例 #6
0
 def test_pickle_treatment(self):
     t = ptr.FMRITreatment(make_outputs=False, result_dump_file=None)
     t.enable_draft_testing()
     cPickle.loads(cPickle.dumps(t))
コード例 #7
0
    def test_parallel_local(self):

        t = ptr.FMRITreatment(make_outputs=False, result_dump_file=None)
        t.enable_draft_testing()
        t.run(parallel='local', n_jobs=2)
コード例 #8
0
    def test_default_treatment(self):

        t = ptr.FMRITreatment(make_outputs=False, result_dump_file=None)
        t.enable_draft_testing()
        t.run()