Skip to content

Commit 299c8fe

Browse files
committed
young current
1 parent a7fa5c3 commit 299c8fe

File tree

5 files changed

+45
-172
lines changed

5 files changed

+45
-172
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ dist/
1313
**/.eegdash_cache/
1414
**/*/eegdash.egg-info/
1515
.env
16-
16+
tests/data/

DevNotes.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22

33
pip install -r requirements.txt
44

5+
## signalstore mongodb
6+
- Check args functions to double check input to db query
7+
- Create_index to the collection once its created to speed up querying
8+
- `find` has deserialization to convert timestamp to correct milisecond format and json_schema from bytes to dict
9+
- `add` has serialization before insert into db

notebooks/eegdash.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
],
367367
"metadata": {
368368
"kernelspec": {
369-
"display_name": "eegdash",
369+
"display_name": ".venv",
370370
"language": "python",
371371
"name": "python3"
372372
},
@@ -380,7 +380,7 @@
380380
"name": "python",
381381
"nbconvert_exporter": "python",
382382
"pygments_lexer": "ipython3",
383-
"version": "3.11.5"
383+
"version": "3.10.12"
384384
}
385385
},
386386
"nbformat": 4,

notebooks/scratch.ipynb

+36-168
Original file line numberDiff line numberDiff line change
@@ -2,190 +2,58 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 5,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
99
"# To be able to make edits to repo without having to restart notebook\n",
10+
"%load_ext autoreload\n",
11+
"%autoreload 2\n",
1012
"from eegdash import EEGDash\n",
1113
"from braindecode.datasets import BaseDataset, BaseConcatDataset"
1214
]
1315
},
1416
{
1517
"cell_type": "code",
16-
"execution_count": 14,
18+
"execution_count": 2,
1719
"metadata": {},
1820
"outputs": [
1921
{
20-
"data": {
21-
"text/html": [
22-
"<div>\n",
23-
"<style scoped>\n",
24-
" .dataframe tbody tr th:only-of-type {\n",
25-
" vertical-align: middle;\n",
26-
" }\n",
27-
"\n",
28-
" .dataframe tbody tr th {\n",
29-
" vertical-align: top;\n",
30-
" }\n",
31-
"\n",
32-
" .dataframe thead th {\n",
33-
" text-align: right;\n",
34-
" }\n",
35-
"</style>\n",
36-
"<table border=\"1\" class=\"dataframe\">\n",
37-
" <thead>\n",
38-
" <tr style=\"text-align: right;\">\n",
39-
" <th></th>\n",
40-
" <th>sampling_frequency</th>\n",
41-
" <th>nchans</th>\n",
42-
" <th>ntimes</th>\n",
43-
" </tr>\n",
44-
" </thead>\n",
45-
" <tbody>\n",
46-
" <tr>\n",
47-
" <th>0</th>\n",
48-
" <td>250</td>\n",
49-
" <td>74</td>\n",
50-
" <td>742500</td>\n",
51-
" </tr>\n",
52-
" <tr>\n",
53-
" <th>1</th>\n",
54-
" <td>250</td>\n",
55-
" <td>74</td>\n",
56-
" <td>747000</td>\n",
57-
" </tr>\n",
58-
" <tr>\n",
59-
" <th>2</th>\n",
60-
" <td>250</td>\n",
61-
" <td>74</td>\n",
62-
" <td>740000</td>\n",
63-
" </tr>\n",
64-
" <tr>\n",
65-
" <th>3</th>\n",
66-
" <td>250</td>\n",
67-
" <td>74</td>\n",
68-
" <td>738750</td>\n",
69-
" </tr>\n",
70-
" <tr>\n",
71-
" <th>4</th>\n",
72-
" <td>250</td>\n",
73-
" <td>74</td>\n",
74-
" <td>741750</td>\n",
75-
" </tr>\n",
76-
" <tr>\n",
77-
" <th>5</th>\n",
78-
" <td>250</td>\n",
79-
" <td>74</td>\n",
80-
" <td>736750</td>\n",
81-
" </tr>\n",
82-
" <tr>\n",
83-
" <th>6</th>\n",
84-
" <td>250</td>\n",
85-
" <td>74</td>\n",
86-
" <td>749000</td>\n",
87-
" </tr>\n",
88-
" <tr>\n",
89-
" <th>7</th>\n",
90-
" <td>250</td>\n",
91-
" <td>74</td>\n",
92-
" <td>738750</td>\n",
93-
" </tr>\n",
94-
" <tr>\n",
95-
" <th>8</th>\n",
96-
" <td>250</td>\n",
97-
" <td>74</td>\n",
98-
" <td>747750</td>\n",
99-
" </tr>\n",
100-
" <tr>\n",
101-
" <th>9</th>\n",
102-
" <td>250</td>\n",
103-
" <td>74</td>\n",
104-
" <td>736500</td>\n",
105-
" </tr>\n",
106-
" <tr>\n",
107-
" <th>10</th>\n",
108-
" <td>250</td>\n",
109-
" <td>74</td>\n",
110-
" <td>738250</td>\n",
111-
" </tr>\n",
112-
" <tr>\n",
113-
" <th>11</th>\n",
114-
" <td>250</td>\n",
115-
" <td>74</td>\n",
116-
" <td>739500</td>\n",
117-
" </tr>\n",
118-
" <tr>\n",
119-
" <th>12</th>\n",
120-
" <td>250</td>\n",
121-
" <td>74</td>\n",
122-
" <td>749000</td>\n",
123-
" </tr>\n",
124-
" <tr>\n",
125-
" <th>13</th>\n",
126-
" <td>250</td>\n",
127-
" <td>74</td>\n",
128-
" <td>741500</td>\n",
129-
" </tr>\n",
130-
" <tr>\n",
131-
" <th>14</th>\n",
132-
" <td>250</td>\n",
133-
" <td>74</td>\n",
134-
" <td>743000</td>\n",
135-
" </tr>\n",
136-
" <tr>\n",
137-
" <th>15</th>\n",
138-
" <td>250</td>\n",
139-
" <td>74</td>\n",
140-
" <td>744000</td>\n",
141-
" </tr>\n",
142-
" <tr>\n",
143-
" <th>16</th>\n",
144-
" <td>250</td>\n",
145-
" <td>74</td>\n",
146-
" <td>742500</td>\n",
147-
" </tr>\n",
148-
" <tr>\n",
149-
" <th>17</th>\n",
150-
" <td>250</td>\n",
151-
" <td>74</td>\n",
152-
" <td>743250</td>\n",
153-
" </tr>\n",
154-
" </tbody>\n",
155-
"</table>\n",
156-
"</div>"
157-
],
158-
"text/plain": [
159-
" sampling_frequency nchans ntimes\n",
160-
"0 250 74 742500\n",
161-
"1 250 74 747000\n",
162-
"2 250 74 740000\n",
163-
"3 250 74 738750\n",
164-
"4 250 74 741750\n",
165-
"5 250 74 736750\n",
166-
"6 250 74 749000\n",
167-
"7 250 74 738750\n",
168-
"8 250 74 747750\n",
169-
"9 250 74 736500\n",
170-
"10 250 74 738250\n",
171-
"11 250 74 739500\n",
172-
"12 250 74 749000\n",
173-
"13 250 74 741500\n",
174-
"14 250 74 743000\n",
175-
"15 250 74 744000\n",
176-
"16 250 74 742500\n",
177-
"17 250 74 743250"
178-
]
179-
},
180-
"execution_count": 14,
181-
"metadata": {},
182-
"output_type": "execute_result"
22+
"name": "stdout",
23+
"output_type": "stream",
24+
"text": [
25+
"{'_id': ObjectId('677db70295291b67a99cada1'), 'schema_ref': 'eeg_signal', 'data_name': 'ds002718_sub-014_task-FaceRecognition_eeg.set', 'dataset': 'ds002718', 'bidspath': 'ds002718/sub-014/eeg/sub-014_task-FaceRecognition_eeg.set', 'subject': '014', 'task': 'FaceRecognition', 'session': '', 'run': '', 'sampling_frequency': 250, 'modality': 'EEG', 'has_file': True, 'version_timestamp': 0, 'time_of_save': 1738946443346607, 'time_of_removal': None, 'nchans': 74, 'ntimes': 742500, 'channel_types': ['EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'HEOG', 'VEOG', 'ECG', 'ECG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG', 'EEG'], 'channel_names': ['EEG001', 'EEG002', 'EEG003', 'EEG004', 'EEG005', 'EEG006', 'EEG007', 'EEG008', 'EEG009', 'EEG010', 'EEG011', 'EEG012', 'EEG013', 'EEG014', 'EEG015', 'EEG016', 'EEG017', 'EEG018', 'EEG019', 'EEG020', 'EEG021', 'EEG022', 'EEG023', 'EEG024', 'EEG025', 'EEG026', 'EEG027', 'EEG028', 'EEG029', 'EEG030', 'EEG031', 'EEG032', 'EEG033', 'EEG034', 'EEG035', 'EEG036', 'EEG037', 'EEG038', 'EEG039', 'EEG040', 'EEG041', 'EEG042', 'EEG043', 'EEG044', 'EEG045', 'EEG046', 'EEG047', 'EEG048', 'EEG049', 'EEG050', 'EEG051', 'EEG052', 'EEG053', 'EEG054', 'EEG055', 'EEG056', 'EEG057', 'EEG058', 'EEG059', 'EEG060', 'EEG061', 'EEG062', 'EEG063', 'EEG064', 'EEG065', 'EEG066', 'EEG067', 'EEG068', 'EEG069', 'EEG070', 'EEG071', 'EEG072', 'EEG073', 'EEG074']}\n"
26+
]
27+
}
28+
],
29+
"source": [
30+
"eeg = EEGDash(is_public=False)\n",
31+
"# eeg.update_noref({'data_name': record['data_name']})\n",
32+
"datasets = eeg.findrecord({'dataset': 'ds002718'})\n",
33+
"print(datasets[0])"
34+
]
35+
},
36+
{
37+
"cell_type": "code",
38+
"execution_count": 3,
39+
"metadata": {},
40+
"outputs": [
41+
{
42+
"name": "stdout",
43+
"output_type": "stream",
44+
"text": [
45+
"{'data_name': 'test2', 'dataset': 'test', 'bidspath': 'test', 'subject': 'test'}\n"
46+
]
18347
}
18448
],
18549
"source": [
186-
"eeg = EEGDash()\n",
187-
"datasets = eeg.find({'dataset': 'ds002718'})\n",
188-
"datasets.description"
50+
"record = {\n",
51+
" 'data_name': 'test2',\n",
52+
" 'dataset': 'test',\n",
53+
" 'bidspath': 'test',\n",
54+
" 'subject': 'test',\n",
55+
"}\n",
56+
"eeg.addnoref(record)"
18957
]
19058
},
19159
{

notebooks/testspeed.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@
723723
"name": "python",
724724
"nbconvert_exporter": "python",
725725
"pygments_lexer": "ipython3",
726-
"version": "3.11.9"
726+
"version": "3.10.12"
727727
}
728728
},
729729
"nbformat": 4,

0 commit comments

Comments
 (0)