Skip to content

[bug] lack of error handling for forward_model failure in osl_ephys.report.src_report.gen_html_summary #411

@JizeZhangPsych

Description

@JizeZhangPsych

Error Stack Trace

File /osl-ephys/osl_ephys/report/src_report.py", line 254, in gen_html_summary
fid_err_table["Session ID"] = [subject_data[i]["fif_id"] for i in range(len(subject_data))]
KeyError: 'fif_id'

Reason for the Error

When breakpoint at error thrown:

  • subject_data[i]['filename'] = "sub-010194"
  • in sub-010194_src.error.log:
    • osl-ephys SOURCE RECON failed at: 2025-07-09 18:43:29
      Processing failed during stage : "forward_model"<class 'RuntimeError'>
      Surface outer skull is not completely inside surface outer skin

Easy Solution

at line 230 of osl_ephys/report/src_report.py, add:

if not "fif_id" in subject_data[-1].keys():
    subject_data.pop(-1)  # Remove if no fif_id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions