Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIDS session path not resolved when subject has only one session #168

Closed
surchs opened this issue Jun 17, 2023 · 0 comments · Fixed by #169
Closed

BIDS session path not resolved when subject has only one session #168

surchs opened this issue Jun 17, 2023 · 0 comments · Fixed by #169
Assignees
Labels
severity:blocker A bug or broken feature with no workaround type:bug Defects in shipped code and fixes for those defects

Comments

@surchs
Copy link
Contributor

surchs commented Jun 17, 2023

For subjects with at least one session, we rely on layout.get(..., return_type="dir") to get the path of a given session:

session_path = Path(
layout.get(
subject=bids_sub_id,
session=session,
target="session",
return_type="dir",
)[0]
)

However, this fails if the subject has exactly one session.

To reproduce:

import bids
layout = bids.BIDSLayout("bids-examples/ieeg_motorMiller2007")
layout.get(subject="cc", session="01", target="session", return_type="dir")
Out[]: []

# BUT:
layout.get_sessions(subject="cc")
Out[]: ['01']

This is very similar to bids-standard/pybids#978.

We should do two things:

  1. stop using return_type="dir" and replace it with building the path directly (as suggested in the issue)
  2. being good neighbours and going over to pybids and see if we can help fix this return_type="dir" issue, e.g. by deprecating it / providing docs.
@surchs surchs converted this from a draft issue Jun 17, 2023
@surchs surchs added bug:functional severity:blocker A bug or broken feature with no workaround type:bug Defects in shipped code and fixes for those defects labels Jun 17, 2023
@surchs surchs moved this from Specify - Active to Implement - Active in Neurobagel Jun 17, 2023
@surchs surchs self-assigned this Jun 17, 2023
@surchs surchs moved this from Implement - Active to Implement - Done in Neurobagel Jun 17, 2023
@alyssadai alyssadai moved this from Implement - Done to Review - Active in Neurobagel Jun 19, 2023
@github-project-automation github-project-automation bot moved this from Review - Active to Review - Done in Neurobagel Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity:blocker A bug or broken feature with no workaround type:bug Defects in shipped code and fixes for those defects
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant