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

Function get_n_projected

mne/preprocessing/tests/test_maxwell.py:1142–1155  ·  view source on GitHub ↗

Get the number of projected tSSS components from the log.

()

Source from the content-addressed store, hash-verified

1140
1141@contextmanager
1142def get_n_projected():
1143 """Get the number of projected tSSS components from the log."""
1144 count = list()
1145 with use_log_level(True):
1146 with catch_logging() as log:
1147 yield count
1148 log = log.getvalue()
1149 assert "Processing data using tSSS" in log
1150 log = log.splitlines()
1151 reg = re.compile(r"\s+Projecting\s+([0-9])+\s+intersecting tSSS .*")
1152 for line in log:
1153 m = reg.match(line)
1154 if m:
1155 count.append(int(m.group(1)))
1156
1157
1158@buggy_mkl_svd

Callers 1

test_shielding_factorFunction · 0.85

Calls 5

use_log_levelClass · 0.90
catch_loggingClass · 0.90
getvalueMethod · 0.80
compileMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected