Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend available NP2 probe types #217

Merged
merged 7 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
version: 2

build:
image: latest
os: ubuntu-20.04
tools:
python: "3.10"

sphinx:
configuration: doc/conf.py

python:
version: 3.8
install:
- method: pip
path: .
Expand Down
72 changes: 69 additions & 3 deletions src/probeinterface/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,9 @@ def write_csv(file, probe):
"ap_hp_filters",
),
},
# Neuropixels 2.0 - Single Shank
# Neuropixels 2.0 - Single Shank - Prototype
21: {
"probe_name": "Neuropixels 2.0 - Single Shank",
"probe_name": "Neuropixels 2.0 - Single Shank - Prototype",
"x_pitch": 32,
"y_pitch": 15,
"contact_width": 12,
Expand All @@ -743,8 +743,72 @@ def write_csv(file, probe):
"polygon": polygon_description["default"],
"fields_in_imro_table": ("channel_ids", "banks", "references", "elec_ids"),
},
# Neuropixels 2.0 - Four Shank
# Neuropixels 2.0 - Four Shank - Prototype
24: {
"probe_name": "Neuropixels 2.0 - Four Shank - Prototype",
"x_pitch": 32,
"y_pitch": 15,
"contact_width": 12,
"stagger": 0.0,
"shank_pitch": 250,
"shank_number": 4,
"ncol": 2,
"polygon": polygon_description["default"],
"fields_in_imro_table": (
"channel_ids",
"shank_id",
"banks",
"references",
"elec_ids",
),
},
# Neuropixels 2.0 - Single Shank - Commercial without metal cap
2003: {
"probe_name": "Neuropixels 2.0 - Single Shank",
"x_pitch": 32,
"y_pitch": 15,
"contact_width": 12,
"stagger": 0.0,
"shank_pitch": 0,
"shank_number": 1,
"ncol": 2,
"polygon": polygon_description["default"],
"fields_in_imro_table": ("channel_ids", "banks", "references", "elec_ids"),
},
# Neuropixels 2.0 - Single Shank - Commercial with metal cap
2004: {
"probe_name": "Neuropixels 2.0 - Single Shank",
"x_pitch": 32,
"y_pitch": 15,
"contact_width": 12,
"stagger": 0.0,
"shank_pitch": 0,
"shank_number": 1,
"ncol": 2,
"polygon": polygon_description["default"],
"fields_in_imro_table": ("channel_ids", "banks", "references", "elec_ids"),
},
# Neuropixels 2.0 - Four Shank - Commercial without metal cap
2013: {
"probe_name": "Neuropixels 2.0 - Four Shank",
"x_pitch": 32,
"y_pitch": 15,
"contact_width": 12,
"stagger": 0.0,
"shank_pitch": 250,
"shank_number": 4,
"ncol": 2,
"polygon": polygon_description["default"],
"fields_in_imro_table": (
"channel_ids",
"shank_id",
"banks",
"references",
"elec_ids",
),
},
# Neuropixels 2.0 - Four Shank - Commercial with metal cap
2014: {
"probe_name": "Neuropixels 2.0 - Four Shank",
"x_pitch": 32,
"y_pitch": 15,
Expand Down Expand Up @@ -1157,6 +1221,8 @@ def read_spikeglx(file: str | Path) -> Probe:
if saved_chans.size != probe.get_contact_count():
# slice if needed
probe = probe.get_slice(saved_chans)
# wire it
probe.set_device_channel_indices(np.arange(probe.get_contact_count()))

return probe

Expand Down
655 changes: 655 additions & 0 deletions tests/data/openephys/OE_Neuropix-PXI-opto-with-sync/settings.xml

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions tests/data/spikeglx/NP2_2013_all_channels.imec0.ap.meta

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions tests/data/spikeglx/NP2_2013_subset_channels.imec0.ap.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
acqApLfSy=384,0,1
appVersion=20230815
fileCreateTime=2023-09-04T16:03:26
fileName=F://chan_below_r65_sync_g0/chan_below_r65_sync_g0_imec0/chan_below_r65_sync_g0_t0.imec0.ap.bin
fileSHA1=8A7F08D4C8AA82589527E6DFC19ACEA0E6E2665B
fileSizeBytes=75511260
fileTimeSecs=10.401
firstSample=920506
gateMode=Immediate
imAiRangeMax=0.62
imAiRangeMin=-0.62
imAnyChanFullBand=true
imCalibrated=false
imChan0apGain=100
imDatApi=3.62
imDatBs_fw=2.0.169
imDatBsc_fw=3.2.189
imDatBsc_hw=1.9
imDatBsc_pn=NP2_QBSC_00
imDatBsc_sn=175
imDatFx_hw=0.1
imDatFx_pn=NPM_FLEX_01
imDatFx_sn=23100013
imDatHs_hw=3.2
imDatHs_pn=NPM_HS_31
imDatHs_sn=23100013
imDatPrb_dock=1
imDatPrb_pn=NP2013
imDatPrb_port=1
imDatPrb_slot=6
imDatPrb_sn=12345601012
imDatPrb_type=2013
imErrFlags_IS_CT_SR_LK_PP_SY=0 0 0 0 0 0
imIsSvyRun=false
imLEDEnable=false
imLowLatency=false
imMaxInt=2048
imSampRate=30000
imStdby=
imSvyMaxBnk=-1
imSvySecPerBnk=60
imTipLength=206
imTrgRising=true
imTrgSource=0
imroFile=F:/16_box_pat.imro
nDataDirs=1
nSavedChans=121
snsApLfSy=120,0,1
snsSaveChanSubset=0:35,72:95,192:227,264:287,384
syncImInputSlot=6
syncSourceIdx=2
syncSourcePeriod=1
trigMode=Immediate
typeImEnabled=1
typeNiEnabled=1
typeObEnabled=0
typeThis=imec
userNotes=
~imroTbl=(2013,384)(0 0 0 0 0)(1 0 0 0 1)(2 0 0 0 2)(3 0 0 0 3)(4 0 0 0 4)(5 0 0 0 5)(6 0 0 0 6)(7 0 0 0 7)(8 0 0 0 8)(9 0 0 0 9)(10 0 0 0 10)(11 0 0 0 11)(12 0 0 0 12)(13 0 0 0 13)(14 0 0 0 14)(15 0 0 0 15)(16 0 0 0 16)(17 0 0 0 17)(18 0 0 0 18)(19 0 0 0 19)(20 0 0 0 20)(21 0 0 0 21)(22 0 0 0 22)(23 0 0 0 23)(24 2 0 0 120)(25 2 0 0 121)(26 2 0 0 122)(27 2 0 0 123)(28 2 0 0 124)(29 2 0 0 125)(30 2 0 0 126)(31 2 0 0 127)(32 2 0 0 128)(33 2 0 0 129)(34 2 0 0 130)(35 2 0 0 131)(36 2 0 0 132)(37 2 0 0 133)(38 2 0 0 134)(39 2 0 0 135)(40 2 0 0 136)(41 2 0 0 137)(42 2 0 0 138)(43 2 0 0 139)(44 2 0 0 140)(45 2 0 0 141)(46 2 0 0 142)(47 2 0 0 143)(48 1 1 0 384)(49 1 1 0 385)(50 1 1 0 386)(51 1 1 0 387)(52 1 1 0 388)(53 1 1 0 389)(54 1 1 0 390)(55 1 1 0 391)(56 1 1 0 392)(57 1 1 0 393)(58 1 1 0 394)(59 1 1 0 395)(60 1 1 0 396)(61 1 1 0 397)(62 1 1 0 398)(63 1 1 0 399)(64 1 1 0 400)(65 1 1 0 401)(66 1 1 0 402)(67 1 1 0 403)(68 1 1 0 404)(69 1 1 0 405)(70 1 1 0 406)(71 1 1 0 407)(72 1 0 0 24)(73 1 0 0 25)(74 1 0 0 26)(75 1 0 0 27)(76 1 0 0 28)(77 1 0 0 29)(78 1 0 0 30)(79 1 0 0 31)(80 1 0 0 32)(81 1 0 0 33)(82 1 0 0 34)(83 1 0 0 35)(84 1 0 0 36)(85 1 0 0 37)(86 1 0 0 38)(87 1 0 0 39)(88 1 0 0 40)(89 1 0 0 41)(90 1 0 0 42)(91 1 0 0 43)(92 1 0 0 44)(93 1 0 0 45)(94 1 0 0 46)(95 1 0 0 47)(96 3 0 0 240)(97 3 0 0 241)(98 3 0 0 242)(99 3 0 0 243)(100 3 0 0 244)(101 3 0 0 245)(102 3 0 0 246)(103 3 0 0 247)(104 3 0 0 248)(105 3 0 0 249)(106 3 0 0 250)(107 3 0 0 251)(108 3 0 0 252)(109 3 0 0 253)(110 3 0 0 254)(111 3 0 0 255)(112 3 0 0 256)(113 3 0 0 257)(114 3 0 0 258)(115 3 0 0 259)(116 3 0 0 260)(117 3 0 0 261)(118 3 0 0 262)(119 3 0 0 263)(120 1 0 0 360)(121 1 0 0 361)(122 1 0 0 362)(123 1 0 0 363)(124 1 0 0 364)(125 1 0 0 365)(126 1 0 0 366)(127 1 0 0 367)(128 1 0 0 368)(129 1 0 0 369)(130 1 0 0 370)(131 1 0 0 371)(132 1 0 0 372)(133 1 0 0 373)(134 1 0 0 374)(135 1 0 0 375)(136 1 0 0 376)(137 1 0 0 377)(138 1 0 0 378)(139 1 0 0 379)(140 1 0 0 380)(141 1 0 0 381)(142 1 0 0 382)(143 1 0 0 383)(144 3 0 0 144)(145 3 0 0 145)(146 3 0 0 146)(147 3 0 0 147)(148 3 0 0 148)(149 3 0 0 149)(150 3 0 0 150)(151 3 0 0 151)(152 3 0 0 152)(153 3 0 0 153)(154 3 0 0 154)(155 3 0 0 155)(156 3 0 0 156)(157 3 0 0 157)(158 3 0 0 158)(159 3 0 0 159)(160 3 0 0 160)(161 3 0 0 161)(162 3 0 0 162)(163 3 0 0 163)(164 3 0 0 164)(165 3 0 0 165)(166 3 0 0 166)(167 3 0 0 167)(168 2 0 0 264)(169 2 0 0 265)(170 2 0 0 266)(171 2 0 0 267)(172 2 0 0 268)(173 2 0 0 269)(174 2 0 0 270)(175 2 0 0 271)(176 2 0 0 272)(177 2 0 0 273)(178 2 0 0 274)(179 2 0 0 275)(180 2 0 0 276)(181 2 0 0 277)(182 2 0 0 278)(183 2 0 0 279)(184 2 0 0 280)(185 2 0 0 281)(186 2 0 0 282)(187 2 0 0 283)(188 2 0 0 284)(189 2 0 0 285)(190 2 0 0 286)(191 2 0 0 287)(192 2 0 0 0)(193 2 0 0 1)(194 2 0 0 2)(195 2 0 0 3)(196 2 0 0 4)(197 2 0 0 5)(198 2 0 0 6)(199 2 0 0 7)(200 2 0 0 8)(201 2 0 0 9)(202 2 0 0 10)(203 2 0 0 11)(204 2 0 0 12)(205 2 0 0 13)(206 2 0 0 14)(207 2 0 0 15)(208 2 0 0 16)(209 2 0 0 17)(210 2 0 0 18)(211 2 0 0 19)(212 2 0 0 20)(213 2 0 0 21)(214 2 0 0 22)(215 2 0 0 23)(216 0 0 0 120)(217 0 0 0 121)(218 0 0 0 122)(219 0 0 0 123)(220 0 0 0 124)(221 0 0 0 125)(222 0 0 0 126)(223 0 0 0 127)(224 0 0 0 128)(225 0 0 0 129)(226 0 0 0 130)(227 0 0 0 131)(228 0 0 0 132)(229 0 0 0 133)(230 0 0 0 134)(231 0 0 0 135)(232 0 0 0 136)(233 0 0 0 137)(234 0 0 0 138)(235 0 0 0 139)(236 0 0 0 140)(237 0 0 0 141)(238 0 0 0 142)(239 0 0 0 143)(240 3 1 0 384)(241 3 1 0 385)(242 3 1 0 386)(243 3 1 0 387)(244 3 1 0 388)(245 3 1 0 389)(246 3 1 0 390)(247 3 1 0 391)(248 3 1 0 392)(249 3 1 0 393)(250 3 1 0 394)(251 3 1 0 395)(252 3 1 0 396)(253 3 1 0 397)(254 3 1 0 398)(255 3 1 0 399)(256 3 1 0 400)(257 3 1 0 401)(258 3 1 0 402)(259 3 1 0 403)(260 3 1 0 404)(261 3 1 0 405)(262 3 1 0 406)(263 3 1 0 407)(264 3 0 0 24)(265 3 0 0 25)(266 3 0 0 26)(267 3 0 0 27)(268 3 0 0 28)(269 3 0 0 29)(270 3 0 0 30)(271 3 0 0 31)(272 3 0 0 32)(273 3 0 0 33)(274 3 0 0 34)(275 3 0 0 35)(276 3 0 0 36)(277 3 0 0 37)(278 3 0 0 38)(279 3 0 0 39)(280 3 0 0 40)(281 3 0 0 41)(282 3 0 0 42)(283 3 0 0 43)(284 3 0 0 44)(285 3 0 0 45)(286 3 0 0 46)(287 3 0 0 47)(288 1 0 0 240)(289 1 0 0 241)(290 1 0 0 242)(291 1 0 0 243)(292 1 0 0 244)(293 1 0 0 245)(294 1 0 0 246)(295 1 0 0 247)(296 1 0 0 248)(297 1 0 0 249)(298 1 0 0 250)(299 1 0 0 251)(300 1 0 0 252)(301 1 0 0 253)(302 1 0 0 254)(303 1 0 0 255)(304 1 0 0 256)(305 1 0 0 257)(306 1 0 0 258)(307 1 0 0 259)(308 1 0 0 260)(309 1 0 0 261)(310 1 0 0 262)(311 1 0 0 263)(312 3 0 0 360)(313 3 0 0 361)(314 3 0 0 362)(315 3 0 0 363)(316 3 0 0 364)(317 3 0 0 365)(318 3 0 0 366)(319 3 0 0 367)(320 3 0 0 368)(321 3 0 0 369)(322 3 0 0 370)(323 3 0 0 371)(324 3 0 0 372)(325 3 0 0 373)(326 3 0 0 374)(327 3 0 0 375)(328 3 0 0 376)(329 3 0 0 377)(330 3 0 0 378)(331 3 0 0 379)(332 3 0 0 380)(333 3 0 0 381)(334 3 0 0 382)(335 3 0 0 383)(336 1 0 0 144)(337 1 0 0 145)(338 1 0 0 146)(339 1 0 0 147)(340 1 0 0 148)(341 1 0 0 149)(342 1 0 0 150)(343 1 0 0 151)(344 1 0 0 152)(345 1 0 0 153)(346 1 0 0 154)(347 1 0 0 155)(348 1 0 0 156)(349 1 0 0 157)(350 1 0 0 158)(351 1 0 0 159)(352 1 0 0 160)(353 1 0 0 161)(354 1 0 0 162)(355 1 0 0 163)(356 1 0 0 164)(357 1 0 0 165)(358 1 0 0 166)(359 1 0 0 167)(360 0 0 0 264)(361 0 0 0 265)(362 0 0 0 266)(363 0 0 0 267)(364 0 0 0 268)(365 0 0 0 269)(366 0 0 0 270)(367 0 0 0 271)(368 0 0 0 272)(369 0 0 0 273)(370 0 0 0 274)(371 0 0 0 275)(372 0 0 0 276)(373 0 0 0 277)(374 0 0 0 278)(375 0 0 0 279)(376 0 0 0 280)(377 0 0 0 281)(378 0 0 0 282)(379 0 0 0 283)(380 0 0 0 284)(381 0 0 0 285)(382 0 0 0 286)(383 0 0 0 287)
~muxTbl=(24,16)(0 1 32 33 64 65 96 97 128 129 160 161 192 193 224 225 256 257 288 289 320 321 352 353)(2 3 34 35 66 67 98 99 130 131 162 163 194 195 226 227 258 259 290 291 322 323 354 355)(4 5 36 37 68 69 100 101 132 133 164 165 196 197 228 229 260 261 292 293 324 325 356 357)(6 7 38 39 70 71 102 103 134 135 166 167 198 199 230 231 262 263 294 295 326 327 358 359)(8 9 40 41 72 73 104 105 136 137 168 169 200 201 232 233 264 265 296 297 328 329 360 361)(10 11 42 43 74 75 106 107 138 139 170 171 202 203 234 235 266 267 298 299 330 331 362 363)(12 13 44 45 76 77 108 109 140 141 172 173 204 205 236 237 268 269 300 301 332 333 364 365)(14 15 46 47 78 79 110 111 142 143 174 175 206 207 238 239 270 271 302 303 334 335 366 367)(16 17 48 49 80 81 112 113 144 145 176 177 208 209 240 241 272 273 304 305 336 337 368 369)(18 19 50 51 82 83 114 115 146 147 178 179 210 211 242 243 274 275 306 307 338 339 370 371)(20 21 52 53 84 85 116 117 148 149 180 181 212 213 244 245 276 277 308 309 340 341 372 373)(22 23 54 55 86 87 118 119 150 151 182 183 214 215 246 247 278 279 310 311 342 343 374 375)(24 25 56 57 88 89 120 121 152 153 184 185 216 217 248 249 280 281 312 313 344 345 376 377)(26 27 58 59 90 91 122 123 154 155 186 187 218 219 250 251 282 283 314 315 346 347 378 379)(28 29 60 61 92 93 124 125 156 157 188 189 220 221 252 253 284 285 316 317 348 349 380 381)(30 31 62 63 94 95 126 127 158 159 190 191 222 223 254 255 286 287 318 319 350 351 382 383)
~snsChanMap=(384,0,1)(AP0;0:0)(AP1;1:1)(AP2;2:2)(AP3;3:3)(AP4;4:4)(AP5;5:5)(AP6;6:6)(AP7;7:7)(AP8;8:8)(AP9;9:9)(AP10;10:10)(AP11;11:11)(AP12;12:12)(AP13;13:13)(AP14;14:14)(AP15;15:15)(AP16;16:16)(AP17;17:17)(AP18;18:18)(AP19;19:19)(AP20;20:20)(AP21;21:21)(AP22;22:22)(AP23;23:23)(AP24;24:216)(AP25;25:217)(AP26;26:218)(AP27;27:219)(AP28;28:220)(AP29;29:221)(AP30;30:222)(AP31;31:223)(AP32;32:224)(AP33;33:225)(AP34;34:226)(AP35;35:227)(AP72;72:72)(AP73;73:73)(AP74;74:74)(AP75;75:75)(AP76;76:76)(AP77;77:77)(AP78;78:78)(AP79;79:79)(AP80;80:80)(AP81;81:81)(AP82;82:82)(AP83;83:83)(AP84;84:84)(AP85;85:85)(AP86;86:86)(AP87;87:87)(AP88;88:88)(AP89;89:89)(AP90;90:90)(AP91;91:91)(AP92;92:92)(AP93;93:93)(AP94;94:94)(AP95;95:95)(AP192;192:192)(AP193;193:193)(AP194;194:194)(AP195;195:195)(AP196;196:196)(AP197;197:197)(AP198;198:198)(AP199;199:199)(AP200;200:200)(AP201;201:201)(AP202;202:202)(AP203;203:203)(AP204;204:204)(AP205;205:205)(AP206;206:206)(AP207;207:207)(AP208;208:208)(AP209;209:209)(AP210;210:210)(AP211;211:211)(AP212;212:212)(AP213;213:213)(AP214;214:214)(AP215;215:215)(AP216;216:24)(AP217;217:25)(AP218;218:26)(AP219;219:27)(AP220;220:28)(AP221;221:29)(AP222;222:30)(AP223;223:31)(AP224;224:32)(AP225;225:33)(AP226;226:34)(AP227;227:35)(AP264;264:264)(AP265;265:265)(AP266;266:266)(AP267;267:267)(AP268;268:268)(AP269;269:269)(AP270;270:270)(AP271;271:271)(AP272;272:272)(AP273;273:273)(AP274;274:274)(AP275;275:275)(AP276;276:276)(AP277;277:277)(AP278;278:278)(AP279;279:279)(AP280;280:280)(AP281;281:281)(AP282;282:282)(AP283;283:283)(AP284;284:284)(AP285;285:285)(AP286;286:286)(AP287;287:287)(SY0;384:384)
~snsGeomMap=(NP2013,4,250,70)(0:27:0:1)(0:59:0:1)(0:27:15:1)(0:59:15:1)(0:27:30:1)(0:59:30:1)(0:27:45:1)(0:59:45:1)(0:27:60:1)(0:59:60:1)(0:27:75:1)(0:59:75:1)(0:27:90:1)(0:59:90:1)(0:27:105:1)(0:59:105:1)(0:27:120:1)(0:59:120:1)(0:27:135:1)(0:59:135:1)(0:27:150:1)(0:59:150:1)(0:27:165:1)(0:59:165:1)(2:27:900:1)(2:59:900:1)(2:27:915:1)(2:59:915:1)(2:27:930:1)(2:59:930:1)(2:27:945:1)(2:59:945:1)(2:27:960:1)(2:59:960:1)(2:27:975:1)(2:59:975:1)(1:27:180:1)(1:59:180:1)(1:27:195:1)(1:59:195:1)(1:27:210:1)(1:59:210:1)(1:27:225:1)(1:59:225:1)(1:27:240:1)(1:59:240:1)(1:27:255:1)(1:59:255:1)(1:27:270:1)(1:59:270:1)(1:27:285:1)(1:59:285:1)(1:27:300:1)(1:59:300:1)(1:27:315:1)(1:59:315:1)(1:27:330:1)(1:59:330:1)(1:27:345:1)(1:59:345:1)(2:27:0:1)(2:59:0:1)(2:27:15:1)(2:59:15:1)(2:27:30:1)(2:59:30:1)(2:27:45:1)(2:59:45:1)(2:27:60:1)(2:59:60:1)(2:27:75:1)(2:59:75:1)(2:27:90:1)(2:59:90:1)(2:27:105:1)(2:59:105:1)(2:27:120:1)(2:59:120:1)(2:27:135:1)(2:59:135:1)(2:27:150:1)(2:59:150:1)(2:27:165:1)(2:59:165:1)(0:27:900:1)(0:59:900:1)(0:27:915:1)(0:59:915:1)(0:27:930:1)(0:59:930:1)(0:27:945:1)(0:59:945:1)(0:27:960:1)(0:59:960:1)(0:27:975:1)(0:59:975:1)(3:27:180:1)(3:59:180:1)(3:27:195:1)(3:59:195:1)(3:27:210:1)(3:59:210:1)(3:27:225:1)(3:59:225:1)(3:27:240:1)(3:59:240:1)(3:27:255:1)(3:59:255:1)(3:27:270:1)(3:59:270:1)(3:27:285:1)(3:59:285:1)(3:27:300:1)(3:59:300:1)(3:27:315:1)(3:59:315:1)(3:27:330:1)(3:59:330:1)(3:27:345:1)(3:59:345:1)
10 changes: 9 additions & 1 deletion tests/test_io/test_openephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_NP1_subset():

assert probe_ap.get_shank_count() == 1
assert "1.0" in probe_ap.model_name
assert len(probe_ap.contact_positions) == 200
assert probe_ap.get_contact_count() == 200

probe_lf = read_openephys(
data_path / "OE_Neuropix-PXI-subset" / "settings.xml", stream_name="ProbeA-LFP"
Expand Down Expand Up @@ -95,6 +95,14 @@ def test_multiple_probes():
assert np.min(ypos) >= 0


def test_np_otpo_with_sync():
probe = read_openephys(data_path / "OE_Neuropix-PXI-opto-with-sync" / "settings.xml")
assert probe.model_name == "Neuropixels Opto"
assert probe.get_shank_count() == 1
assert probe.get_contact_count() == 384



def test_older_than_06_format():
## Test with the open ephys < 0.6 format

Expand Down
70 changes: 61 additions & 9 deletions tests/test_io/test_spikeglx.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ def test_NP1():
assert "1.0" in probe.model_name


def test_NP2_1_shanks():
probe = read_spikeglx(data_path / "p2_g0_t0.imec0.ap.meta")
assert "2.0" in probe.model_name
assert probe.get_shank_count() == 1


def test_NP_phase3A():
# Data provided by rtraghavan
probe = read_spikeglx(data_path / "phase3a.imec.ap.meta")
Expand All @@ -62,10 +56,17 @@ def test_NP_phase3A():
assert np.all(probe.contact_shape_params == {"width": contact_width})
assert np.all(probe.contact_shapes == contact_shape)


def test_NP2_1_shanks():
probe = read_spikeglx(data_path / "p2_g0_t0.imec0.ap.meta")
assert "2.0" in probe.model_name
assert probe.get_shank_count() == 1


def test_NP2_4_shanks():
probe = read_spikeglx(data_path / "NP2_4_shanks.imec0.ap.meta")

assert probe.model_name == "Neuropixels 2.0 - Four Shank"
assert probe.model_name == "Neuropixels 2.0 - Four Shank - Prototype"
assert probe.manufacturer == "IMEC"
assert probe.annotations["probe_type"] == 24

Expand All @@ -85,11 +86,61 @@ def test_NP2_4_shanks():
assert np.min(ypos) == pytest.approx(0)


def test_NP2_2013_all():
# Data provided by Jennifer Colonell
probe = read_spikeglx(data_path / "NP2_2013_all_channels.imec0.ap.meta")

assert probe.model_name == "Neuropixels 2.0 - Four Shank"
assert probe.manufacturer == "IMEC"
assert probe.annotations["probe_type"] == 2013

assert probe.ndim == 2
# all channels are from the first shank
assert probe.get_shank_count() == 1
assert probe.get_contact_count() == 384

# Test contact geometry
contact_width = 12.0
contact_shape = "square"

assert np.all(probe.contact_shape_params == {"width": contact_width})
assert np.all(probe.contact_shapes == contact_shape)

# This file does not save the channnels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
ypos = probe.contact_positions[:, 1]
assert np.min(ypos) == pytest.approx(0)


def test_NP2_2013_subset():
# Data provided by Jennifer Colonell
probe = read_spikeglx(data_path / "NP2_2013_subset_channels.imec0.ap.meta")

assert probe.model_name == "Neuropixels 2.0 - Four Shank"
assert probe.manufacturer == "IMEC"
assert probe.annotations["probe_type"] == 2013

assert probe.ndim == 2
# all channels are from the first shank
assert probe.get_shank_count() == 1
assert probe.get_contact_count() == 120

# Test contact geometry
contact_width = 12.0
contact_shape = "square"

assert np.all(probe.contact_shape_params == {"width": contact_width})
assert np.all(probe.contact_shapes == contact_shape)

# This file does not save the channnels from 0 as the one above (NP2_4_shanks_g0_t0.imec0.ap.meta)
ypos = probe.contact_positions[:, 1]
assert np.min(ypos) == pytest.approx(0)


def test_NP2_4_shanks_with_different_electrodes_saved():
# Data provided by Jennifer Colonell
probe = read_spikeglx(data_path / "NP2_4_shanks_save_different_electrodes.imec0.ap.meta")

assert probe.model_name == "Neuropixels 2.0 - Four Shank"
assert probe.model_name == "Neuropixels 2.0 - Four Shank - Prototype"
assert probe.manufacturer == "IMEC"
assert probe.annotations["probe_type"] == 24

Expand Down Expand Up @@ -275,4 +326,5 @@ def test_CatGT_NP1():


if __name__ == "__main__":
test_NP1()
test_NP2_2013_all()
test_NP2_2013_subset()