-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ENH: support auto and fsaverage for add_trans in report #13232
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drammock this should be good to go... any further commits will just be to fix any faulty logic if CIs fail
if subject is None: | ||
if "SUBJECT" in os.environ: | ||
subject = os.environ["SUBJECT"] | ||
else: | ||
raise ValueError( | ||
"subject is None and SUBJECT environment variable not set, cannot " | ||
"use trans='auto'" | ||
) | ||
glob_str = str(subjects_dir / subject / "*-trans.fif") | ||
trans_fnames = glob.glob(glob_str) | ||
if len(trans_fnames) < 1: | ||
raise RuntimeError( | ||
f"Could not find the transformation for {subject} in: {glob_str}" | ||
) | ||
elif len(trans_fnames) > 1: | ||
raise RuntimeError( | ||
f"Found multiple transformations for {subject} in: {glob_str}" | ||
) | ||
trans = Path(trans_fnames[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are just indentation plus improved error message (giving the user the glob string to help them understand why the trans wasn't found)
fsaverage
forsubject
inmne.Report.add_trans
#13224