Skip to content

Commit 01ff929

Browse files
authored
Merge pull request #1327 from MaximeBICMTL/add_eeg_chunker_to_linter
Add the EEG chunker to the linter configuration
2 parents 199818f + a0b39ab commit 01ff929

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ packages = [
5252
[tool.ruff]
5353
src = ["python"]
5454
include = ["python/**/*.py"]
55-
exclude = ["python/react-series-data-viewer"]
5655
line-length = 120
5756
preview = true
5857

python/react-series-data-viewer/chunking.py

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
import json
33
import math
44
import os
5-
from collections import OrderedDict
6-
import numpy as np
7-
from scipy import signal
85
import sys
6+
from collections import OrderedDict
97

8+
import numpy as np
109
from protocol_buffers import chunk_pb2 as chunk_pb
10+
from scipy import signal
1111

1212

1313
def pad_values(values, chunk_size):

python/react-series-data-viewer/edf_to_chunks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#!/usr/bin/env python
2+
13
import argparse
4+
import sys
5+
26
import mne.io
37
import mne.io.edf.edf as mne_edf
48
from chunking import write_chunk_directory
5-
import sys
69

710

811
def load_channels(exclude):
@@ -67,7 +70,7 @@ def load_channels(exclude):
6770
if len(stim_channel_idxs) == 1:
6871
continue
6972

70-
print('Creating chunk for channel {} for {}'.format(i, path))
73+
print(f'Creating chunk for channel {i} for {path}')
7174

7275
# excluding channels in the loader reduce the time required to read the file
7376
# and avoid memory issues

python/react-series-data-viewer/eeglab_to_chunks.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#!/usr/bin/env python
2+
13
import argparse
4+
import sys
5+
6+
import chunking
27
import mne.io
38
import mne.io.eeglab.eeglab as mne_eeglab
4-
import chunking
5-
import sys
69

710

811
def load_channels(path):
@@ -42,7 +45,7 @@ def load_channels(path):
4245
if args.channel_count and args.channel_count < 0:
4346
sys.exit("Channel count must be a positive integer")
4447

45-
print('Creating chunks for {}'.format(path))
48+
print(f'Creating chunks for {path}')
4649
chunking.write_chunk_directory(
4750
path=path,
4851
from_channel_index=args.channel_index,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.ruff]
2+
extend = "../../pyproject.toml"
3+
exclude = ["protocol_buffers"]

0 commit comments

Comments
 (0)