MCPcopy
hub / github.com/mne-tools/mne-python / _check_reg_match

Function _check_reg_match

mne/preprocessing/tests/test_maxwell.py:936–951  ·  view source on GitHub ↗

Check regularization.

(sss_py, sss_mf, comp_tol)

Source from the content-addressed store, hash-verified

934
935
936def _check_reg_match(sss_py, sss_mf, comp_tol):
937 """Check regularization."""
938 info_py = sss_py.info["proc_history"][0]["max_info"]["sss_info"]
939 assert info_py is not None
940 assert len(info_py) > 0
941 info_mf = sss_mf.info["proc_history"][0]["max_info"]["sss_info"]
942 n_in = None
943 for inf in (info_py, info_mf):
944 if n_in is None:
945 n_in = _get_n_moments(inf["in_order"])
946 else:
947 assert n_in == _get_n_moments(inf["in_order"])
948 assert inf["components"][:n_in].sum() == inf["nfree"]
949 assert_allclose(
950 info_py["nfree"], info_mf["nfree"], atol=comp_tol, err_msg=sss_py.filenames[0]
951 )
952
953
954@pytest.mark.slowtest

Callers 2

test_regularizationFunction · 0.85
test_triuxFunction · 0.85

Calls 2

_get_n_momentsFunction · 0.85
sumMethod · 0.45

Tested by

no test coverage detected