From bc191af9141ce367f0ccb801684d204a2e8a0025 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 13 Sep 2024 17:21:52 -0400 Subject: [PATCH 1/2] Ignore 3.12 warning on utcnow in nipype --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 5e62db0c..55eca3e0 100644 --- a/tox.ini +++ b/tox.ini @@ -42,6 +42,8 @@ filterwarnings = ignore:.*pkg_resources:DeprecationWarning # ignore:.*Use setlocale.* instead:DeprecationWarning:nipype + # + ignore:.*datetime.datetime.utcnow\(\) is deprecated.*:DeprecationWarning:nipype [coverage:run] include = heudiconv/* From bf793c9d9c29f144266fedb198148de995e16003 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 13 Sep 2024 17:22:18 -0400 Subject: [PATCH 2/2] BF(workaround): add kludge for read_file for dcmstack --- heudiconv/dicoms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/heudiconv/dicoms.py b/heudiconv/dicoms.py index 2c3d8029..1d276e39 100644 --- a/heudiconv/dicoms.py +++ b/heudiconv/dicoms.py @@ -46,6 +46,11 @@ # suppress warning import nibabel.nicom.dicomwrappers as dw +# TODO: remove the kludge whenever +# https://github.com/moloney/dcmstack/pull/90 is merged and released +if not hasattr(dcm, "read_file"): + dcm.read_file = dcm.dcmread + lgr = logging.getLogger(__name__) total_files = 0 # Might be monkey patched by user heuristic to tune desired compression level.