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
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,26 @@ 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
+
### NDIndex
25
+
26
+
Provides the ability to select on N-dimensional derived coordinates (like absolute time computed from trial offsets + relative time).
27
+
28
+

29
+
30
+
See the [ND Coordinates Example](nd_index_demo.ipynb) for a detailed walkthrough covering trial-based data with both absolute and relative time coordinates.
31
+
32
+
```{note}
33
+
The time-locking/epoching workflow shown in the diagram is not yet implemented. NDIndex currently supports selection on N-D coordinates but does not yet provide utilities for building multiple time reference frames.
34
+
```
35
+
16
36
### Use Cases
17
37
18
38
-**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