Interface nwb
pynapple.io.interface_nwb
Pynapple class to interface with NWB files. Data are always lazy-loaded. Object behaves like dictionary.
NWBFile
Bases: UserDict
Class for reading NWB Files.
Examples:
>>> import pynapple as nap
>>> data = nap.load_file("my_file.nwb")
>>> data["units"]
Index rate location group
------- ------ ---------- -------
0 1.0 brain 0
1 1.0 brain 0
2 1.0 brain 0
Source code in pynapple/io/interface_nwb.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
|
__init__
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file |
str or NWBFile
|
Valid file to a NWB file |
required |
lazy_loading |
If True return a memory-view of the data, load otherwise. |
True
|
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If path is invalid |
RuntimeError
|
If file is not an instance of NWBFile |
Source code in pynapple/io/interface_nwb.py
__repr__
__getitem__
Get object from NWB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
|
required |
Returns:
Type | Description |
---|---|
(Ts, Tsd, TsdFrame, TsGroup, IntervalSet or dict of IntervalSet)
|
|
Raises:
Type | Description |
---|---|
KeyError
|
If key is not in the dictionary |