[FIX] repaired convolution issue that arises when onset values are repeated#1133
Merged
effigies merged 2 commits intobids-standard:masterfrom May 28, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1133 +/- ##
==========================================
+ Coverage 89.71% 89.73% +0.01%
==========================================
Files 65 66 +1
Lines 7205 7219 +14
Branches 1137 1140 +3
==========================================
+ Hits 6464 6478 +14
Misses 540 540
Partials 201 201 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e157d10 to
8159c30
Compare
Collaborator
|
Resolved the test failure issues. Could you add a test? I think adapting your code to validate that the regressor values are all between -0.2 and 1.2 should do the job. We should create a import numpy as np
from ..hrf import compute_regressor
def test_duplicate_onsets():
[your code]
assert np.all((regressor > 0.2) & (regressor < 1.2)) |
effigies
added a commit
that referenced
this pull request
Sep 24, 2025
Version 0.20.0 (September 24, 2025) New feature release in the 0.20.x series. This release finalizes some deprecations that were started in the 0.7 and 0.14 series. In particular, passing indexer arguments to ``BIDSLayout`` and disabling ``absolute_paths`` mode in ``BIDSLayout()`` or ``BIDSLayout.get()`` will now error. To adjust indexing behavior, create an explicit ``BIDSLayoutIndexer()`` and pass ``BIDSLayout(..., indexer=indexer)``. To access relative paths, use the ``BIDSFile.relative_path`` property on ``BIDSLayout.get()`` return values. * FIX: Check for attribute that can be absent before assigning (#1165) * FIX: Accommodate deprecations in the upcoming Pandas 3 release (#1173) * FIX: Repaired convolution issue that arises when onset values are repeated (#1133) * ENH: StatsModels: Add `invalid_inputs` parameter to allow dropping of missing data columns to run nodes (#1145) * ENH: Add missing root-level path patterns (#1169) * ENH: Parse ``seg-`` entities from dseg or probseg files (#1172) * DOC: Update link to derivatives config file (#1132) * MNT: Address warnings produced by pybids and dependencies (#1136) * MNT: Lock test environment, update with dependabot (#1134)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Michael discovered and odd behavior if onset values were repeated (e.g. two stimuli occurred at the same time). I traced the problem to
_sample_condition. Basically, it creates a boxcar regressor and the duplicate onset times break the code when the block needs to start or end. The repair I did basically adopts what nilearn currently uses for the same function, so I'm assuming they identified and repaired this bug a while ago.Note, I've only fixed this issue as far as convolution is concerned. I'm not sure if this problem arises elsewhere.
The following reproduces the problem I'm referring to.
What pybids currently produces
What you get with my fix