From 86eb634bc489a15fefe53b558636a56ddf6e2acd Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Mon, 19 Jun 2023 11:37:59 -0400 Subject: [PATCH] [FIX] Resolve session path for subjects with single session (#169) stop using layout.get return_type="dir" --- bagel/bids_utils.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/bagel/bids_utils.py b/bagel/bids_utils.py index c447a97..7ee268d 100644 --- a/bagel/bids_utils.py +++ b/bagel/bids_utils.py @@ -62,20 +62,10 @@ def get_session_path( # switch to using layout.get() snippet below to fetch subject path. bids_dir / f"sub-{bids_sub_id}" - # layout.get( - # subject=bids_sub_id, - # target="subject", - # return_type="dir", - # )[0] ) else: - session_path = Path( - layout.get( - subject=bids_sub_id, - session=session, - target="session", - return_type="dir", - )[0] + session_path = ( + Path(layout.root) / f"sub-{bids_sub_id}" / f"ses-{session}" ) return session_path.resolve().as_posix()