Skip to content

Commit 759b01e

Browse files
committed
Fix import issue (regarding sleep)
1 parent 8a6a749 commit 759b01e

3 files changed

Lines changed: 4586 additions & 285 deletions

File tree

circStudio/analysis/sleep/diary.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os
22
import pandas as pd
33
import pyexcel as pxl
4-
import warnings
5-
from circStudio.analysis.sleep import *
4+
from .sleep import *
65

76

87
class SleepDiary:
@@ -75,6 +74,12 @@ def __init__(self, input_fname, start_time, periods, frequency, header_size=2, s
7574
line=dict(width=0)
7675
)
7776

77+
def __str__(self):
78+
return self._diary.to_string()
79+
80+
def __call__(self):
81+
return self._diary
82+
7883
@property
7984
def name(self):
8085
"""The name of the subject."""

docs/source/notebooks/legacy_notebooks/05 - Visualizing sleep diaries.ipynb

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
"execution_count": 1,
3131
"metadata": {
3232
"ExecuteTime": {
33-
"end_time": "2025-07-22T14:28:44.587006Z",
34-
"start_time": "2025-07-22T14:28:42.169791Z"
33+
"start_time": "2025-07-24T16:48:02.646910Z"
34+
},
35+
"jupyter": {
36+
"is_executing": true
3537
}
3638
},
3739
"outputs": [],
@@ -69,7 +71,7 @@
6971
},
7072
{
7173
"cell_type": "code",
72-
"execution_count": 7,
74+
"execution_count": 4,
7375
"metadata": {
7476
"ExecuteTime": {
7577
"end_time": "2023-01-30T15:46:56.446362Z",
@@ -84,7 +86,7 @@
8486
},
8587
{
8688
"cell_type": "code",
87-
"execution_count": 8,
89+
"execution_count": 5,
8890
"metadata": {
8991
"ExecuteTime": {
9092
"end_time": "2023-01-30T15:46:56.481980Z",
@@ -99,7 +101,7 @@
99101
},
100102
{
101103
"cell_type": "code",
102-
"execution_count": 9,
104+
"execution_count": 6,
103105
"metadata": {
104106
"ExecuteTime": {
105107
"end_time": "2023-01-30T15:46:56.509555Z",
@@ -113,7 +115,7 @@
113115
"Timestamp('1918-01-23 13:58:00')"
114116
]
115117
},
116-
"execution_count": 9,
118+
"execution_count": 6,
117119
"metadata": {},
118120
"output_type": "execute_result"
119121
}
@@ -125,7 +127,7 @@
125127
},
126128
{
127129
"cell_type": "code",
128-
"execution_count": 10,
130+
"execution_count": 7,
129131
"metadata": {
130132
"ExecuteTime": {
131133
"end_time": "2023-01-30T15:46:56.518949Z",
@@ -139,7 +141,7 @@
139141
"Timedelta('12 days 18:41:00')"
140142
]
141143
},
142-
"execution_count": 10,
144+
"execution_count": 7,
143145
"metadata": {},
144146
"output_type": "execute_result"
145147
}
@@ -182,7 +184,7 @@
182184
},
183185
{
184186
"cell_type": "code",
185-
"execution_count": 11,
187+
"execution_count": 9,
186188
"metadata": {
187189
"ExecuteTime": {
188190
"end_time": "2023-01-30T15:46:56.619683Z",
@@ -203,45 +205,33 @@
203205
},
204206
{
205207
"cell_type": "code",
206-
"execution_count": 12,
207-
"metadata": {
208-
"ExecuteTime": {
209-
"end_time": "2023-01-30T15:46:56.637042Z",
210-
"start_time": "2023-01-30T15:46:56.631247Z"
211-
}
212-
},
208+
"execution_count": 1,
209+
"metadata": {},
213210
"outputs": [
214211
{
215-
"data": {
216-
"text/plain": [
217-
"'EXAMPLE_01'"
218-
]
219-
},
220-
"execution_count": 12,
221-
"metadata": {},
222-
"output_type": "execute_result"
212+
"ename": "NameError",
213+
"evalue": "name 'raw' is not defined",
214+
"output_type": "error",
215+
"traceback": [
216+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
217+
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
218+
"Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mraw\u001b[49m\u001b[38;5;241m.\u001b[39msleep_diary()\n",
219+
"\u001b[1;31mNameError\u001b[0m: name 'raw' is not defined"
220+
]
223221
}
224222
],
225223
"source": [
226-
"raw.sleep_diary.name"
227-
]
228-
},
229-
{
230-
"cell_type": "markdown",
231-
"metadata": {},
232-
"source": [
233-
"To access to the data contained in the sleep diary:"
224+
"raw.sleep_diary()"
234225
]
235226
},
236227
{
237228
"cell_type": "code",
238-
"execution_count": 13,
229+
"execution_count": 15,
239230
"metadata": {
240231
"ExecuteTime": {
241-
"end_time": "2023-01-30T15:46:56.653278Z",
242-
"start_time": "2023-01-30T15:46:56.642057Z"
243-
},
244-
"scrolled": true
232+
"end_time": "2023-01-30T15:46:56.637042Z",
233+
"start_time": "2023-01-30T15:46:56.631247Z"
234+
}
245235
},
246236
"outputs": [
247237
{
@@ -433,7 +423,7 @@
433423
"21 NIGHT 1918-02-02 23:20:00 1918-02-03 07:45:00"
434424
]
435425
},
436-
"execution_count": 13,
426+
"execution_count": 15,
437427
"metadata": {},
438428
"output_type": "execute_result"
439429
}
@@ -442,6 +432,13 @@
442432
"raw.sleep_diary.diary"
443433
]
444434
},
435+
{
436+
"cell_type": "markdown",
437+
"metadata": {},
438+
"source": [
439+
"To access to the data contained in the sleep diary:"
440+
]
441+
},
445442
{
446443
"cell_type": "markdown",
447444
"metadata": {},

docs/source/tutorial_3.ipynb

Lines changed: 4544 additions & 245 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)