moloney / dcmstack

DICOM to Nifti conversion with meta data preservation
Other
72 stars 51 forks source link

Migrate to pytest from nose #77

Closed yarikoptic closed 1 year ago

yarikoptic commented 1 year ago

From https://salsa.debian.org/med-team/dcmstack/-/raw/master/debian/patches/port-to-pytest.patch brought up by @tillea in https://github.com/moloney/dcmstack/issues/67#issuecomment-967800718 . In the 2nd commit I also established setup.cfg so someone could do pip install -e .[test] or alike to get test depends.

Unfortunately it seems that dcmstack is not entirely kosher with most recent numpy and/or python since:

FAILED test/test_dcmmeta.py::TestSplit::test_split_slice - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::TestSplit::test_split_time - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::TestSplit::test_split_vector - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::test_split_keep_spatial - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::test_from_dicom - nibabel.deprecator.ExpiredDeprecationError: get_affine method is deprecated.
FAILED test/test_dcmmeta.py::test_from_2d_slice_to_3d - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::test_from_3d_time_to_4d - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::test_from_3d_vector_to_4d - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::test_merge_inconsistent_hdr - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
FAILED test/test_dcmmeta.py::test_merge_with_slc_and_without - IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

and that is numpy 1.23.2 and python 3.10.6. I have not had a chance to try anything else yet.

Closes #67 .

yarikoptic commented 1 year ago

Travis is no longer running - likely needs some manual kick by @moloney -- or get replaced with e.g. github actions (#78)