|
3 | 3 | etc. of neo.core objects. |
4 | 4 | ''' |
5 | 5 |
|
6 | | -import neo |
7 | 6 | import copy |
8 | 7 | import warnings |
| 8 | + |
9 | 9 | import numpy as np |
10 | 10 | import quantities as pq |
11 | 11 |
|
| 12 | +import neo |
| 13 | + |
| 14 | +ignore_annotations = ['nix_name'] |
12 | 15 |
|
13 | 16 | def get_events(container, **properties): |
14 | 17 | """ |
@@ -345,8 +348,12 @@ def add_epoch( |
345 | 348 |
|
346 | 349 | ep = neo.Epoch(times=times, durations=durations, **kwargs) |
347 | 350 |
|
348 | | - ep.annotate(**event1.annotations) |
349 | | - ep.array_annotate(**event1.array_annotations) |
| 351 | + annos = {k: v for k, v in event1.annotations.items() |
| 352 | + if k not in ignore_annotations} |
| 353 | + array_annos = {k: v for k, v in event1.array_annotations.items() |
| 354 | + if k not in ignore_annotations} |
| 355 | + ep.annotate(**copy.copy(annos)) |
| 356 | + ep.array_annotate(**copy.copy(array_annos)) |
350 | 357 |
|
351 | 358 | if attach_result: |
352 | 359 | segment.epochs.append(ep) |
@@ -543,10 +550,14 @@ def cut_segment_by_epoch(seg, epoch, reset_time=False): |
543 | 550 | epoch.times[ep_id] + epoch.durations[ep_id], |
544 | 551 | reset_time=reset_time) |
545 | 552 |
|
546 | | - subseg.annotate(**copy.copy(epoch.annotations)) |
| 553 | + annos = {k: v for k, v in epoch.annotations.items() |
| 554 | + if k not in ignore_annotations} |
| 555 | + subseg.annotate(**copy.copy(annos)) |
547 | 556 |
|
548 | 557 | # Add array-annotations of Epoch |
549 | 558 | for key, val in epoch.array_annotations.items(): |
| 559 | + if key in ignore_annotations: |
| 560 | + continue |
550 | 561 | if len(val): |
551 | 562 | subseg.annotations[key] = copy.copy(val[ep_id]) |
552 | 563 |
|
|
0 commit comments