Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions mne/forward/_make_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,20 +496,24 @@ def _prepare_for_forward(
mri_id = dict(machid=np.zeros(2, np.int32), version=0, secs=0, usecs=0)

info_trans = str(trans) if isinstance(trans, Path) else trans
info = Info(
chs=info["chs"],
Comment on lines 499 to 500
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To minimize diff and preserve blame how about

kwargs_fwd_info = dict(
...
)

then only a few lines change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your comments, can you tell me where I should add the test?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in this test somewhere?

def test_make_forward_solution_kit(tmp_path, fname_src_small):

comps=info["comps"],
# The forward-writing code always wants a dev_head_t, so give an identity one
dev_head_t=info["dev_head_t"] or Transform("meg", "head"),
mri_file=info_trans,
mri_id=mri_id,
meas_file=info_extra,
meas_id=None,
working_dir=os.getcwd(),
command_line=cmd,
bads=info["bads"],
mri_head_t=mri_head_t,
)
kwargs_fwd_info = {
"chs": info["chs"],
"comps": info["comps"],
"dev_head_t": info["dev_head_t"] or Transform("meg", "head"),
"mri_file": info_trans,
"mri_id": mri_id,
"meas_file": info_extra,
"meas_id": None,
"working_dir": os.getcwd(),
"command_line": cmd,
"bads": info["bads"],
"mri_head_t": mri_head_t,
}

if "kit_system_id" in info:
kwargs_fwd_info["kit_system_id"] = info["kit_system_id"]

info = Info(**kwargs_fwd_info)
info._update_redundant()
info._check_consistency()
logger.info("")
Expand Down
Loading