Skip to content

Commit 4a89cfd

Browse files
committed
add note about lack of secondary metrics from event table
Signed-off-by: Stephen L. <lrq3000@gmail.com>
1 parent 04ddfbf commit 4a89cfd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/circalog-format-spec.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ The purpose of Circalog is to store any kind of circadian periodic schedule data
44

55
The specification is intended as a working document for now, it is subject to change depending on the needs that arise during software development.
66

7-
Draft version: 0.5.1
7+
Draft version: 0.5.2
88

99
## Fields
1010

11-
### Table: Events
11+
### Table: event
1212

1313
This table stores instances of events with temporal and contextual information.
1414

15+
Note that there is no concept of naps or duration or fragmented sleep or other secondary inferential metrics. There are two reasons: 1) they can be done at post-processing from the fields collected, so it's unnecessary to calculate them at the collection app level and clutter the database and slow down the plotting and exports processes, 2) there is no single method to accurately calculate them, different methods will produce different results, so it is best to leave that to the post-processing stage. Nevertheless, some of these secondary metrics can still be collected in the app, eg, for naps, a tag "Nap" can be created to allow the user to specify if they think this was a nap or not (although this may be very unreliable) or to import from other apps such as Sleepmeter which considers naps as a distinct type of sleep session. Fragmented sleep will just consists of several `event` records, they can be "stitched" together at post-processing time. Duration can simply be calculated using `end_time` - `start_time`, and combined with stitching, a duration over multiple fragmented but closely temporally related sleep sessions can be calculated in post-processing.
16+
1517
#### id
1618

1719
A SHA1 hash of the current datetime to ensure the id is unique. SQL key. A unique ID will allow to merge databases from different devices (eg, using Circalog on both the computer and a smartphone, one event gets added on the computer, another on the smartphone, then the computer database can be imported on the smartphone to be up to date, and inversely the smartphone database can be imported onto the computer app, so that both apps can easily be synchronized by merging databases). User cannot access this field.

0 commit comments

Comments
 (0)