You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,27 @@ Custom xarray indexes for keeping multiple coordinates in sync across shared dim
13
13
This library provides custom [xarray Index](https://docs.xarray.dev/en/stable/internals/how-to-create-custom-index.html) implementations that automatically constrain related dimensions when you select on any one of them.
14
14
15
15
16
+
### DimensionInterval
17
+
18
+
The DimensionInterval provides the ability to performantly store arbitrary intervals over a continuous coordinate. Like a multiindex but more generalized. See the [comparison with MultiIndex](alt-multiindex.ipynb) for an understanding of the comparison.
19
+
20
+

21
+
22
+
See the [Multi-Interval Example](multi_interval_example.ipynb) for a detailed walkthrough.
23
+
24
+
### AbsoluteRelative Index
25
+
26
+
Provides the ability to work with both absolute or relative coord (e.g. time) for trialed data.
27
+

28
+
29
+
See the [Absolute vs Relative Time Example](abs_rel_time_example.ipynb) for a detailed walkthrough.
30
+
31
+
This then enables more advanced use cases such as building multiple time reference frames without having to shuffle the underlying data. This makes a task such as time-locking a low cost operation:
32
+
33
+

34
+
35
+
See the [Time-Locking Example](time-locking.ipynb) for a demonstration of event-locked analysis.
36
+
16
37
### Use Cases
17
38
18
39
-**Speech/audio data** with hierarchical annotations (words, phonemes, time)
Copy file name to clipboardExpand all lines: docs/multi_interval_example.ipynb
+17-19Lines changed: 17 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,7 @@
4
4
"cell_type": "markdown",
5
5
"id": "cell-0",
6
6
"metadata": {},
7
-
"source": [
8
-
"# Multi-Interval Index Example\n",
9
-
"\n",
10
-
"This notebook demonstrates how `DimensionInterval` enables automatic cross-slicing between multiple interval types over a shared continuous dimension.\n",
11
-
"\n",
12
-
"## Use Case: Speech Data\n",
13
-
"\n",
14
-
"Imagine you have speech data with:\n",
15
-
"- A **continuous time dimension** (e.g., audio samples at regular intervals)\n",
16
-
"- **Word intervals** - each word spans a range of time\n",
17
-
"- **Phoneme intervals** - each phoneme spans a smaller range of time within words\n",
18
-
"\n",
19
-
"TODO: add an explanatory image\n",
20
-
"\n",
21
-
"\n",
22
-
"When you select a specific word, you want the time and phoneme dimensions to automatically constrain to only the overlapping values. This is exactly what `DimensionInterval` provides."
23
-
]
7
+
"source": "# Multi-Interval Index Example\n\nThis notebook demonstrates how `DimensionInterval` enables automatic cross-slicing between multiple interval types over a shared continuous dimension.\n\n\n\nWhen you select a specific word, you want the time and phoneme dimensions to automatically constrain to only the overlapping values. This is exactly what `DimensionInterval` provides.\n\n::::{note}\nThere are two ways to encode intervals with `DimensionInterval`:\n1. **Pandas IntervalIndex** - Used in this notebook, intervals are encoded directly as `pd.IntervalIndex` objects\n2. **Onset/Duration format** - Intervals are specified as separate onset and duration coordinates, see the [Onset/Duration Example](onset_duration_example.ipynb)\n::::\n\n::::{seealso}\nFor a comparison of `DimensionInterval` with xarray's built-in `MultiIndex`, see the [MultiIndex Comparison](alt-multiindex.ipynb) notebook.\n::::"
24
8
},
25
9
{
26
10
"cell_type": "code",
@@ -43,6 +27,20 @@
43
27
"from linked_indices import DimensionInterval"
44
28
]
45
29
},
30
+
{
31
+
"cell_type": "markdown",
32
+
"id": "271be299-c765-488f-804d-5322552e41e0",
33
+
"metadata": {},
34
+
"source": [
35
+
"\n",
36
+
"## Use Case: Speech Data\n",
37
+
"\n",
38
+
"Imagine you have speech data with:\n",
39
+
"- A **continuous time dimension** (e.g., audio samples at regular intervals)\n",
40
+
"- **Word intervals** - each word spans a range of time\n",
41
+
"- **Phoneme intervals** - each phoneme spans a smaller range of time within words\n"
0 commit comments