Mouse-Imaging-Centre / pydpiper

Python code for flexible pipeline control
Other
25 stars 10 forks source link

Testing code not functional #424

Open gdevenyi opened 5 years ago

gdevenyi commented 5 years ago

Adding testing to MINC-VM:

$ ./test_MBM_and_MAGeT.py test-data --working_dir=working

Warning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working [/opt/miniconda/lib/python3.7/site-packages/networkx/classes/graph.py:23]

Warning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working [/opt/miniconda/lib/python3.7/site-packages/networkx/classes/reportviews.py:95]

Warning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject [/opt/miniconda/lib/python3.7/importlib/_bootstrap.py:219]

Warning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject [/opt/miniconda/lib/python3.7/importlib/_bootstrap.py:219]

Warning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject [/opt/miniconda/lib/python3.7/importlib/_bootstrap.py:219]

usage: MBM.py [-h] [--restart] [--smart-restart]
              [--pipeline-name PIPELINE_NAME] [--no-restart]
              [--output-dir OUTPUT_DIRECTORY] [--create-graph] [--execute]
              [--no-execute] [--version] [--verbose] [--no-verbose]
              [--files [file [file ...]]] [--csv-file CSV_FILE]
              [--csv-paths-relative-to-wd] [--input-space INPUT_SPACE]
              [--resolution RESOLUTION] [--subject-matter SUBJECT_MATTER]
              [--uri-file URIFILE] [--use-ns]
              [--latency-tolerance LATENCY_TOLERANCE]
              [--num-executors NUM_EXEC]
              [--max-failed-executors MAX_FAILED_EXECUTORS]
              [--no-monitor-heartbeats] [--time TIME] [--proc PROC]
              [--mem MEM] [--pe PE]
              [--mem-request-attribute MEM_REQUEST_ATTRIBUTE] [--greedy]
              [--ppn PPN] [--queue-name QUEUE_NAME] [--queue-type QUEUE_TYPE]
              [--queue-opts QUEUE_OPTS]
              [--executor-start-delay EXECUTOR_START_DELAY] [--submit-server]
              [--no-submit-server] [--max-idle-time MAX_IDLE_TIME]
              [--time-to-accept-jobs TIME_TO_ACCEPT_JOBS] [--local]
              [--config-file config_file] [--prologue-file file]
              [--min-walltime MIN_WALLTIME] [--max-walltime MAX_WALLTIME]
              [--default-job-mem DEFAULT_JOB_MEM]
              [--memory-factor MEMORY_FACTOR] [--cmd-wrapper CMD_WRAPPER]
              [--check-input-files] [--no-check-input-files] [--check-outputs]
              [--no-check-outputs] [--fs-delay FS_DELAY]
              [--executor_wrapper EXECUTOR_WRAPPER]
              [--defer-directory-creation] [--run-lsq6] [--no-run-lsq6]
              [--init-model INIT_MODEL] [--lsq6-target LSQ6_TARGET]
              [--bootstrap] [--pride-of-models PRIDE_OF_MODELS]
              [--lsq6-simple] [--lsq6-centre-estimation]
              [--lsq6-large-rotations]
              [--lsq6-large-rotations-tmp-dir ROTATION_TMP_DIR]
              [--lsq6-large-rotations-parameters ROTATION_PARAMS]
              [--lsq6-rotational-range ROTATION_RANGE]
              [--lsq6-rotational-interval ROTATION_INTERVAL] [--nuc]
              [--no-nuc] [--inormalize] [--no-inormalize]
              [--copy-header-info-to-average]
              [--no-copy-header-info-to-average]
              [--lsq6-protocol PROTOCOL_FILE] [--run-lsq12] [--no-run-lsq12]
              [--lsq12-max-pairs MAX_PAIRS] [--lsq12-likefile LIKE_FILE]
              [--lsq12-protocol PROTOCOL]
              [--registration-method {ANTS,antsRegistration,demons,DRAMMS,elastix,minctracc}]
              [--registration-strategy {build_model,pairwise,tournament,tournament_and_build_model,pairwise_and_build_model}]
              [--nlin-protocol NLIN_PROTOCOL]
              [--pairwise-nlin-max-pairs PRELIM_NLIN_MAX_PAIRS]
              [--pairwise-nlin-max-images PRELIM_NLIN_MAX_IMAGES]
              [--calc-stats] [--no-calc-stats] [--stats-kernels STATS_KERNELS]
              [--common-space-model COMMON_SPACE_MODEL]
              [--common-space-mask COMMON_SPACE_MASK]
              [--common-space-registration] [--no-common-space-registration]
              [--run-maget] [--no-run-maget] [--maget-run-lsq12]
              [--maget-no-run-lsq12] [--maget-lsq12-max-pairs MAX_PAIRS]
              [--maget-lsq12-likefile LIKE_FILE]
              [--maget-lsq12-protocol PROTOCOL]
              [--maget-registration-method {ANTS,antsRegistration,demons,DRAMMS,elastix,minctracc}]
              [--maget-registration-strategy {build_model,pairwise,tournament,tournament_and_build_model,pairwise_and_build_model}]
              [--maget-nlin-protocol NLIN_PROTOCOL]
              [--maget-atlas-library ATLAS_LIB] [--maget-atlas-csv ATLAS_CSV]
              [--maget-pairwise] [--maget-no-pairwise] [--maget-mask]
              [--maget-no-mask] [--maget-mask-only]
              [--maget-max-templates MAX_TEMPLATES]
              [--maget-masking-method MASK_METHOD]
              [--maget-masking-nlin-protocol MASKING_NLIN_PROTOCOL]
MBM.py: error: unrecognized arguments: --time-to-seppuku 1
Traceback (most recent call last):
  File "./test_MBM_and_MAGeT.py", line 51, in <module>
    --files """.format(**vars()).split() + files)
  File "/opt/miniconda/lib/python3.7/subprocess.py", line 341, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['MBM.py', '--pipeline-name=MBM_test', '--num-executors=20', '--verbose', '--init-model=/home/minc/pydpiper/pydpiper_testing/test-data/Pydpiper-init-model-basket-may-2014/basket_mouse_brain.mnc', '--config-file=/home/minc/pydpiper/pydpiper_testing/test-data/sample.cfg', '--lsq6-large-rotations', '--no-run-maget', '--maget-no-mask', '--lsq12-protocol=/home/minc/pydpiper/pydpiper_testing/test-data/default_linear_MAGeT_prot.csv', '--files', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_09jul13.11_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_10jul13.12_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_09jul13.13_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_10jul13.11_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_06aug13.12_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_10jul13.14_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_07aug13.4_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_07aug13.6_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_10jul13.15_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_08aug13.6_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_07aug13.14_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_09jul13.15_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_07aug13.3_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_06aug13.11_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_08aug13.7_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_09jul13.12_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_09jul13.14_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_06aug13.15_C57_dc-deformed-native.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_10jul13.16_C57_dc.mnc', '/home/minc/pydpiper/pydpiper_testing/test-data/test-images/img_06aug13.14_C57_dc.mnc']' returned non-zero exit status 2.
dorkylever commented 5 years ago

The test-code will run when --time-to-seppuku 1 is deleted from test-data/sample.cfg. I presume there is a syntax error somewhere related to this.

gdevenyi commented 5 years ago

Thanks yes I figured that out and didn't update here. That is an option that was renamed several versions ago and the tests weren't updated.

bcdarwin commented 5 years ago

Sorry for the delay on this. @nzxwang has created a new version of the test code which should be merged into the repository at some point (pending some generalization) so updating the existing code hasn't been a priority.