|
54 | 54 | * :attr:`PhyIO` |
55 | 55 | * :attr:`PickleIO` |
56 | 56 | * :attr:`PlexonIO` |
| 57 | +* :attr:`Plexon2IO` |
57 | 58 | * :attr:`RawBinarySignalIO` |
58 | 59 | * :attr:`RawMCSIO` |
59 | 60 | * :attr:`Spike2IO` |
|
226 | 227 |
|
227 | 228 | .. autoattribute:: extensions |
228 | 229 |
|
| 230 | +.. autoclass:: neo.io.Plexon2IO |
| 231 | +
|
| 232 | + .. autoattribute:: extensions |
| 233 | +
|
229 | 234 | .. autoclass:: neo.io.RawBinarySignalIO |
230 | 235 |
|
231 | 236 | .. autoattribute:: extensions |
|
328 | 333 | from neo.io.phyio import PhyIO |
329 | 334 | from neo.io.pickleio import PickleIO |
330 | 335 | from neo.io.plexonio import PlexonIO |
| 336 | +from neo.io.plexon2io import Plexon2IO |
331 | 337 | from neo.io.rawbinarysignalio import RawBinarySignalIO |
332 | 338 | from neo.io.rawmcsio import RawMCSIO |
333 | 339 | from neo.io.spike2io import Spike2IO |
|
382 | 388 | PhyIO, |
383 | 389 | PickleIO, |
384 | 390 | PlexonIO, |
| 391 | + Plexon2IO, |
385 | 392 | RawBinarySignalIO, |
386 | 393 | RawMCSIO, |
387 | 394 | Spike2IO, |
@@ -458,8 +465,23 @@ def list_candidate_ios(file_or_folder, ignore_patterns=['*.ini', 'README.txt', ' |
458 | 465 | # if only file prefix was provided, e.g /mydatafolder/session1- |
459 | 466 | # to select all files sharing the `session1-` prefix |
460 | 467 | elif file_or_folder.parent.exists(): |
461 | | - filenames = file_or_folder.parent.glob(file_or_folder.name + '*') |
462 | | - |
| 468 | + filenames = list(file_or_folder.parent.glob(file_or_folder.name + '*')) |
| 469 | + # if filenames empty and suffix is provided then non-existent file |
| 470 | + # may be written in current dir. So run check for io |
| 471 | + if len(filenames)==0 and file_or_folder.suffix: |
| 472 | + suffix = file_or_folder.suffix[1:].lower() |
| 473 | + if suffix not in io_by_extension: |
| 474 | + raise ValueError(f'{suffix} is not a supported format of any IO.') |
| 475 | + return io_by_extension[suffix] |
| 476 | + |
| 477 | + # If non-existent file in non-existent dir is given check if this |
| 478 | + # structure could be created with an io writing the file |
| 479 | + elif file_or_folder.suffix: |
| 480 | + suffix = file_or_folder.suffix[1:].lower() |
| 481 | + if suffix not in io_by_extension: |
| 482 | + raise ValueError(f'{suffix} is not a supported format of any IO.') |
| 483 | + return io_by_extension[suffix] |
| 484 | + |
463 | 485 | else: |
464 | 486 | raise ValueError(f'{file_or_folder} does not contain data files of a supported format') |
465 | 487 |
|
|
0 commit comments