Skip to content

Comments

[SQL/electrophysiology] Fix physiological event sample SQL type#10358

Merged
driusan merged 1 commit intoaces:mainfrom
MaximeBICMTL:physio_numerical_sql_types
Feb 19, 2026
Merged

[SQL/electrophysiology] Fix physiological event sample SQL type#10358
driusan merged 1 commit intoaces:mainfrom
MaximeBICMTL:physio_numerical_sql_types

Conversation

@MaximeBICMTL
Copy link
Contributor

@MaximeBICMTL MaximeBICMTL commented Feb 12, 2026

Problem

In the LORIS database schema, the EventSample field currently has a decimal(11, 6) type, which can represent decimal values up to 100,000.

I have some files for MPN that have event sample values up to 300,000, so a higher maximum is clearly needed. After digging more into it, it appears that this field is not a standard BIDS field, but that it is rather a field produced by MNE-BIDS (this will need to be documented on the Python side). In my dataset, and as well as the inexistant very sparse documentation that I could find, it actually seems to me that this value should always be an integer:
https://github.com/mne-tools/mne-bids/blob/5dac732153c071a85d25d5dd0f3d7fde7d15bf2b/mne_bids/write.py#L516-L521

The event onset time in number of sampling points. First sample is 0.

https://github.com/mne-tools/mne-bids/blob/5dac732153c071a85d25d5dd0f3d7fde7d15bf2b/mne_bids/read.py#L601
The documented values uses integers rather than decimals.

Moreover, I ran the following query on Raisinbread and C-BIG and did not find any decimal value:

SELECT 
    SUM(CASE WHEN EventSample IS NULL THEN 1 ELSE 0 END) as rows_null,
    SUM(CASE WHEN EventSample IS NOT NULL AND EventSample != FLOOR(EventSample) THEN 1 ELSE 0 END) as rows_with_decimals,
    SUM(CASE WHEN EventSample IS NOT NULL AND EventSample = FLOOR(EventSample) THEN 1 ELSE 0 END) as rows_with_integers
FROM physiological_task_event;

Solution

Change the EventSample column type from DECIMAL(11, 6) to INT(10).

@github-actions github-actions bot added the Language: SQL PR or issue that update SQL code label Feb 12, 2026
@MaximeBICMTL MaximeBICMTL added the Release: SQL patch PR that contains an SQL patch to apply label Feb 12, 2026
@MaximeBICMTL MaximeBICMTL changed the title change eeg browser numerical SQL types [electrophysiology] Change physiological numerical database types Feb 12, 2026
@kongtiaowang
Copy link
Contributor

kongtiaowang commented Feb 13, 2026

#10355

@MaximeBICMTL MaximeBICMTL marked this pull request as ready for review February 16, 2026 13:46
@MaximeBICMTL MaximeBICMTL changed the title [electrophysiology] Change physiological numerical database types [SQL/electrophysiology] Change physiological numerical database types Feb 16, 2026
@MaximeBICMTL MaximeBICMTL changed the title [SQL/electrophysiology] Change physiological numerical database types [SQL/electrophysiology] Fix physiological event sample SQL type Feb 16, 2026
Copy link
Contributor

@jeffersoncasimir jeffersoncasimir left a comment

Choose a reason for hiding this comment

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

Approved

@driusan driusan merged commit acd5ad2 into aces:main Feb 19, 2026
74 of 78 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in LORIS MEG Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: SQL PR or issue that update SQL code Release: SQL patch PR that contains an SQL patch to apply

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants