Skip to content

Commit 30370d9

Browse files
Adding a test for reproducing #119
1 parent c647153 commit 30370d9

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

pylossless/dash/qcannotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, onset, duration, description_str, layout):
2626
description of the annotation event, such as "blink".
2727
descriptions beginning with "bad_" will be considered as
2828
time durations to be excluded by mne-python.
29-
layout : plotly.graph_objects.layout
29+
layout : plotly.graph_objects.Layout
3030
The graph layout object that the annotations should be
3131
plotted onto.
3232
"""
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Authors: Christian O'Reilly <[email protected]>
2+
# License: MIT
3+
4+
import json
5+
import plotly.graph_objects as go
6+
7+
from ..qcannotations import EEGAnnotationList, EEGAnnotation
8+
9+
10+
def test_EEGAnnotationList_serialization():
11+
fig = go.Figure()
12+
fig.add_trace(go.Bar(x=[1, 2, 3], y=[1, 2, 3]))
13+
layout = fig.layout
14+
layout.xaxis.update({"range": [0, 1]})
15+
layout.yaxis.update({"range": [0, 1]})
16+
annotation = EEGAnnotation(0.0, 1.0, "test", layout)
17+
annotation_list = EEGAnnotationList(annotation)
18+
19+
# Check if json serializable
20+
json.dumps(annotation_list)

0 commit comments

Comments
 (0)