pnlbwh / dMRIharmonization

Multi-site dMRI harmonization
Other
43 stars 14 forks source link

tests run N_shm key error #65

Closed vsiless closed 3 years ago

vsiless commented 3 years ago

Hi when i run the unit test i get the following errors:

(harmonization) bash-4.2$ python -m unittest discover -v lib/tests/    
test_bvalMap (unittest.loader._FailedTest) ... ERROR
test_denoise (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: test_bvalMap (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_bvalMap
Traceback (most recent call last):
  File "xxx/conda/envs/harmonization/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "xxx/conda/envs/harmonization/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "xxx/code/dMRIharmonization/lib/tests/test_bvalMap.py", line 18, in <module>
    from preprocess import nrrd2nifti
  File "xxx/code/dMRIharmonization/lib/preprocess.py", line 28, in <module>
    N_shm = int(config['DEFAULT']['N_shm'])
  File "xxx/code/conda/envs/harmonization/lib/python3.8/configparser.py", line 1254, in __getitem__
    raise KeyError(key)
KeyError: 'N_shm'
tashrifbillah commented 3 years ago

Hi @vsiless , did you run https://github.com/pnlbwh/dMRIharmonization/blob/spm-bspline/lib/tests/pipeline_test.sh test first?

tashrifbillah commented 3 years ago

Change of config file name appears to break unit tests!

This tries:

from preprocess import nrrd2nifti

However, config.read(f'/tmp/harm_config_{getpid()}.ini') has a different name now.

vsiless commented 3 years ago

when I run the ./pipeline_test.sh I get this error:

Traceback (most recent call last):
  File "../../harmonization.py", line 538, in <module>
    pipeline.run()
  File "/space/snoke/2/public/vivros/code/conda/envs/harmonization/lib/python3.8/site-packages/plumbum/cli/application.py", line 572, in run
    retcode = inst.main(*tailargs)
  File "../../harmonization.py", line 447, in main
    self.sanityCheck()       
  File "../../harmonization.py", line 441, in sanityCheck
    raise EnvironmentError(f'{cmd} not found')
OSError: unring.a64 not found

I downloaded the code last week or so, did it change in between?

tashrifbillah commented 3 years ago

I can help you with this quickly. The unring.a64 executable is not in your PATH. Here is the instruction.

tashrifbillah commented 3 years ago

Thank you for your contribution!