Skip to content

Commit cc5fe31

Browse files
committed
modify occurences of ppf to reflect changes in beer_lambert_law
1 parent bb0e3c1 commit cc5fe31

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

mne/channels/tests/test_interpolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def test_interpolation_nirs():
323323
raw_od.interpolate_bads()
324324
assert raw_od.info["bads"] == []
325325
assert bad_0_std_pre_interp > np.std(raw_od._data[bad_0])
326-
raw_haemo = beer_lambert_law(raw_od, ppf=6)
326+
raw_haemo = beer_lambert_law(raw_od, ppf=(6.0, 6.0))
327327
raw_haemo.info["bads"] = raw_haemo.ch_names[2:4]
328328
assert raw_haemo.info["bads"] == ["S1_D2 hbo", "S1_D2 hbr"]
329329
raw_haemo.interpolate_bads()

mne/channels/tests/test_standard_montage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def test_set_montage_artinis_basic():
201201
old_info_od = raw_od.info.copy()
202202
raw.set_montage(montage_octamon)
203203
raw_od.set_montage(montage_octamon)
204-
raw_hb = beer_lambert_law(raw_od, ppf=6) # montage needed for BLL
204+
raw_hb = beer_lambert_law(raw_od, ppf=(6.0, 6.0)) # montage needed for BLL
205205
# Check that the montage was actually modified
206206
assert_raises(
207207
AssertionError,

mne/io/hitachi/tests/test_hitachi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def test_hitachi_basic(
228228
assert_allclose(distances, want, atol=0.0)
229229
raw_od_bad = optical_density(raw)
230230
with pytest.warns(RuntimeWarning, match="will be zero"):
231-
beer_lambert_law(raw_od_bad, ppf=6)
231+
beer_lambert_law(raw_od_bad, ppf=(6.0, 6.0))
232232
# bad distances (too big)
233233
if versions[0] == "1.18" and len(fnames) == 1:
234234
need = sum(([f"S{ii}", f"D{ii}"] for ii in range(1, 9)), [])[:-1]
@@ -239,7 +239,7 @@ def test_hitachi_basic(
239239
raw.set_montage(mon)
240240
raw_od_bad = optical_density(raw)
241241
with pytest.warns(RuntimeWarning, match="greater than 10 cm"):
242-
beer_lambert_law(raw_od_bad, ppf=6)
242+
beer_lambert_law(raw_od_bad, ppf=(6.0, 6.0))
243243
# good distances
244244
mon = make_standard_montage("standard_1020")
245245
if versions[0] == "1.18":
@@ -306,7 +306,7 @@ def test_hitachi_basic(
306306
assert_array_less(peaks, 1, err_msg="TDDR too big")
307307
# HbO/HbR
308308
raw_tddr.set_montage(mon)
309-
raw_h = beer_lambert_law(raw_tddr, ppf=6)
309+
raw_h = beer_lambert_law(raw_tddr, ppf=(6.0, 6.0))
310310
data = raw_h.get_data("fnirs")
311311
assert np.isfinite(data).all()
312312
assert data.shape == (n_ch - 4, n_times)

mne/io/snirf/tests/test_snirf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_basic_reading_and_min_process(fname):
9898
if "fnirs_cw_amplitude" in raw:
9999
raw = optical_density(raw)
100100
if "fnirs_od" in raw:
101-
raw = beer_lambert_law(raw, ppf=6)
101+
raw = beer_lambert_law(raw, ppf=(6.0, 6.0))
102102
assert "hbo" in raw
103103
assert "hbr" in raw
104104

mne/preprocessing/nirs/tests/test_scalp_coupling_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ def test_scalp_coupling_index(fname, fmt, tmp_path):
7676
assert_allclose(sci[8:12], 0, atol=1e-10)
7777

7878
# Ensure function errors if wrong type is passed in
79-
raw = beer_lambert_law(raw, ppf=6)
79+
raw = beer_lambert_law(raw, ppf=(6.0, 6.0))
8080
with pytest.raises(RuntimeError, match="Scalp"):
8181
scalp_coupling_index(raw)

mne/viz/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def fnirs_epochs():
4242
"""Create an fnirs epoch structure."""
4343
raw_intensity = read_raw_nirx(fname_nirx, preload=False)
4444
raw_od = optical_density(raw_intensity)
45-
raw_haemo = beer_lambert_law(raw_od, ppf=6.0)
45+
raw_haemo = beer_lambert_law(raw_od, ppf=(6.0, 6.0))
4646
evts, _ = events_from_annotations(raw_haemo, event_id={"1.0": 1})
4747
evts_dct = {"A": 1}
4848
tn, tx = -1, 2

tutorials/preprocessing/70_fnirs_processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
# Next we convert the optical density data to haemoglobin concentration using
141141
# the modified Beer-Lambert law.
142142

143-
raw_haemo = mne.preprocessing.nirs.beer_lambert_law(raw_od, ppf=0.1)
143+
raw_haemo = mne.preprocessing.nirs.beer_lambert_law(raw_od, ppf=(0.6, 0.6))
144144
raw_haemo.plot(n_channels=len(raw_haemo.ch_names), duration=500, show_scrollbars=False)
145145

146146

0 commit comments

Comments
 (0)