This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Repository navigation
Commit de8f70e
authored
feat: advanced indexing (#1074)
* feat: indexing by iterable of ints
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: accept all iterables as index
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* feat: index by boolean mask
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* feat: allow indexing with torch or numpy
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* feat: add setitem
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: set by mask
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* test: add tests
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* test: fix some tests
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: some mypy issues
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: remove uneeded optimization
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: index by numpy int type
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* refactor: make torch available check a util function
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: np indexing
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: mypy stuff
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* docs: add docstring
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* docs: fix docstring example
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* refactor: split columns dict
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* docs: tweak docstring
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* test: add test for none indexing
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* fix: adapt proto to changes
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
* refactor: apply black
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
---------
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com>1 parent 998875f commit de8f70e
17 files changed
Lines changed: 779 additions & 791 deletions
File tree
- docarray
- array
- base_document/mixins
- display
- documents
- proto
- pb2
- pb
- typing
- tensor
- url/data
- utils
- tests/units/array
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
52 | 70 | | |
53 | 71 | | |
54 | 72 | | |
| |||
66 | 84 | | |
67 | 85 | | |
68 | 86 | | |
| 87 | + | |
69 | 88 | | |
70 | 89 | | |
71 | 90 | | |
| |||
79 | 98 | | |
80 | 99 | | |
81 | 100 | | |
82 | | - | |
83 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
84 | 126 | | |
85 | 127 | | |
86 | 128 | | |
87 | 129 | | |
88 | 130 | | |
89 | 131 | | |
90 | | - | |
| 132 | + | |
91 | 133 | | |
92 | 134 | | |
93 | | - | |
| 135 | + | |
94 | 136 | | |
95 | 137 | | |
96 | 138 | | |
97 | 139 | | |
98 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
99 | 149 | | |
| 150 | + | |
| 151 | + | |
100 | 152 | | |
101 | 153 | | |
102 | | - | |
| 154 | + | |
| 155 | + | |
103 | 156 | | |
104 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
105 | 194 | | |
106 | 195 | | |
107 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
108 | 264 | | |
109 | 265 | | |
110 | 266 | | |
| |||
0 commit comments