Skip to content

ENH: Allow passing source detector distances to beer lambert law#13875

Merged
larsoner merged 9 commits into
mne-tools:mainfrom
Kallemakela:enh-13862-allow-passing-source-detector-distances-to-beer_lambert_law
May 4, 2026
Merged

ENH: Allow passing source detector distances to beer lambert law#13875
larsoner merged 9 commits into
mne-tools:mainfrom
Kallemakela:enh-13862-allow-passing-source-detector-distances-to-beer_lambert_law

Conversation

@Kallemakela
Copy link
Copy Markdown
Contributor

Reference issue (if any)

#13862

What does this implement/fix?

Add an optional sd_distances argument to mne/preprocessing/nirs/_beer_lambert_law.py:17.

Proposed signature:
def beer_lambert_law(raw, ppf=6.0, sd_distances=None):

Example usage:
beer_lambert_law(raw_od, sd_distances=0.03)
beer_lambert_law(raw_od, sd_distances=[0.03, 0.03, 0.03, 0.03]) # matches info['chs'] order

Additional information

@welcome
Copy link
Copy Markdown

welcome Bot commented Apr 28, 2026

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

@Kallemakela Kallemakela marked this pull request as ready for review April 28, 2026 12:12
Copy link
Copy Markdown
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me, but CIs are not happy. Can you investigate ?

Comment thread mne/preprocessing/nirs/tests/test_beer_lambert_law.py Outdated
Comment thread mne/preprocessing/nirs/_beer_lambert_law.py Outdated
Comment thread mne/preprocessing/nirs/_beer_lambert_law.py
Comment thread mne/preprocessing/nirs/_beer_lambert_law.py Outdated
Comment thread mne/preprocessing/nirs/nirs.py Outdated
Copy link
Copy Markdown
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

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

Thanks @Kallemakela !

@larsoner larsoner merged commit 6b495eb into mne-tools:main May 4, 2026
2 of 4 checks passed
@Kallemakela Kallemakela deleted the enh-13862-allow-passing-source-detector-distances-to-beer_lambert_law branch May 4, 2026 16:28
larsoner added a commit to larsoner/mne-python that referenced this pull request May 5, 2026
* upstream/main:
  MAINT: Update for vtk deprecation (mne-tools#13886)
  ENH:  Allow passing source detector distances to beer lambert law (mne-tools#13875)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants