@@ -1514,21 +1514,21 @@ cdef class Array(object):
1514
1514
... A[:] = {"a1": a1_data, "l1": l1_data, "l2": l2_data, "l3": l3_data}
1515
1515
...
1516
1516
... with tiledb.open(tmp, "r") as A:
1517
- ... A.label_index(["l1"])[3:4]
1518
- ... A.label_index(["l1", "l3"])[2, 0.5:1.0]
1519
- ... A.label_index(["l2"])[:, -1:0]
1520
- ... A.label_index(["l3"])[:, 0.5:1.0]
1521
- OrderedDict([( 'l1', array([4, 3])), ( 'a1', array([[1, 2, 3],
1522
- [4, 5, 6]]))] )
1523
- OrderedDict([( 'l3', array([0.5, 1. ])), ( 'l1', array([2])), ( 'a1', array([[8, 9]]))] )
1524
- OrderedDict([( 'l2', array([-1, 0])), ( 'a1', array([[ 1, 2],
1525
- [ 4, 5],
1526
- [ 7, 8],
1527
- [10, 11]]))] )
1528
- OrderedDict([( 'l3', array([0.5, 1. ])), ( 'a1', array([[ 2, 3],
1529
- [ 5, 6],
1530
- [ 8, 9],
1531
- [11, 12]]))] )
1517
+ ... A.label_index(["l1"])[3:4] # doctest: +ELLIPSIS
1518
+ ... A.label_index(["l1", "l3"])[2, 0.5:1.0] # doctest: +ELLIPSIS
1519
+ ... A.label_index(["l2"])[:, -1:0] # doctest: +ELLIPSIS
1520
+ ... A.label_index(["l3"])[:, 0.5:1.0] # doctest: +ELLIPSIS
1521
+ OrderedDict(... 'l1'... array([4, 3])..., ... 'a1'... array([[1, 2, 3],
1522
+ [4, 5, 6]])... )
1523
+ OrderedDict(... 'l3'... array([0.5, 1. ])..., ... 'l1'... array([2])..., ... 'a1'... array([[8, 9]])... )
1524
+ OrderedDict(... 'l2'... array([-1, 0])..., ... 'a1'... array([[ 1, 2],
1525
+ [ 4, 5],
1526
+ [ 7, 8],
1527
+ [10, 11]])... )
1528
+ OrderedDict(... 'l3'... array([0.5, 1. ])..., ... 'a1'... array([[ 2, 3],
1529
+ [ 5, 6],
1530
+ [ 8, 9],
1531
+ [11, 12]])... )
1532
1532
1533
1533
:param labels: List of labels to use when querying. Can only use at most one
1534
1534
label per dimension.
@@ -1572,19 +1572,23 @@ cdef class Array(object):
1572
1572
>>>
1573
1573
>>> with tempfile.TemporaryDirectory() as tmp:
1574
1574
... A = tiledb.from_numpy(tmp, np.eye(4) * [1,2,3,4])
1575
- ... A.multi_index[1]
1576
- ... A.multi_index[1,1]
1575
+ ... A.multi_index[1] # doctest: +ELLIPSIS
1576
+ ... A.multi_index[1,1] # doctest: +ELLIPSIS
1577
1577
... # return row 0 and 2
1578
- ... A.multi_index[[0,2]]
1578
+ ... A.multi_index[[0,2]] # doctest: +ELLIPSIS
1579
1579
... # return rows 0 and 2 intersecting column 2
1580
- ... A.multi_index[[0,2], 2]
1580
+ ... A.multi_index[[0,2], 2] # doctest: +ELLIPSIS
1581
1581
... # return rows 0:2 intersecting columns 0:2
1582
- ... A.multi_index[slice(0,2), slice(0,2)]
1583
- OrderedDict([('', array([[0., 2., 0., 0.]]))])
1584
- OrderedDict([('', array([[2.]]))])
1585
- OrderedDict([('', array([[1., 0., 0., 0.], [0., 0., 3., 0.]]))])
1586
- OrderedDict([('', array([[0.], [3.]]))])
1587
- OrderedDict([('', array([[1., 0., 0.], [0., 2., 0.], [0., 0., 3.]]))])
1582
+ ... A.multi_index[slice(0,2), slice(0,2)] # doctest: +ELLIPSIS
1583
+ OrderedDict(...''... array([[0., 2., 0., 0.]])...)
1584
+ OrderedDict(...''... array([[2.]])...)
1585
+ OrderedDict(...''... array([[1., 0., 0., 0.],
1586
+ [0., 0., 3., 0.]])...)
1587
+ OrderedDict(...''... array([[0.],
1588
+ [3.]])...)
1589
+ OrderedDict(...''... array([[1., 0., 0.],
1590
+ [0., 2., 0.],
1591
+ [0., 0., 3.]])...)
1588
1592
1589
1593
"""
1590
1594
# Delayed to avoid circular import
@@ -2161,8 +2165,8 @@ cdef class DenseArrayImpl(Array):
2161
2165
... A[0:10] = {"a1": np.zeros((10)), "a2": np.ones((10))}
2162
2166
... with tiledb.DenseArray(tmp + "/array", mode='r') as A:
2163
2167
... # Access specific attributes individually.
2164
- ... A.query(attrs=("a1",))[0:5]
2165
- OrderedDict([( 'a1', array([0, 0, 0, 0, 0]))] )
2168
+ ... A.query(attrs=("a1",))[0:5] # doctest: +ELLIPSIS
2169
+ OrderedDict(... 'a1'... array([0, 0, 0, 0, 0])... )
2166
2170
2167
2171
"""
2168
2172
if not self .isopen or self .mode != 'r' :
@@ -2216,8 +2220,8 @@ cdef class DenseArrayImpl(Array):
2216
2220
... A[0:10] = {"a1": np.zeros((10)), "a2": np.ones((10))}
2217
2221
... with tiledb.DenseArray(tmp + "/array", mode='r') as A:
2218
2222
... # A[0:5], attribute a1, row-major without coordinates
2219
- ... A.subarray((slice(0, 5),), attrs=("a1",), coords=False, order='C')
2220
- OrderedDict([( 'a1', array([0, 0, 0, 0, 0]))] )
2223
+ ... A.subarray((slice(0, 5),), attrs=("a1",), coords=False, order='C') # doctest: +ELLIPSIS
2224
+ OrderedDict(... 'a1'... array([0, 0, 0, 0, 0])... )
2221
2225
2222
2226
"""
2223
2227
from .subarray import Subarray
@@ -3154,11 +3158,10 @@ cdef class SparseArrayImpl(Array):
3154
3158
... "a2": np.array([3, 4])}
3155
3159
... with tiledb.SparseArray(tmp + "/array", mode='r') as A:
3156
3160
... # Return an OrderedDict with values and coordinates
3157
- ... A[0:3, 0:10]
3161
+ ... A[0:3, 0:10] # doctest: +ELLIPSIS
3158
3162
... # Return just the "x" coordinates values
3159
- ... A[0:3, 0:10]["x"]
3160
- OrderedDict([('a1', array([1, 2])), ('a2', array([3, 4])), ('y', array([0, 2], dtype=uint64)), ('x', array([0, 3], dtype=uint64))])
3161
- array([0, 3], dtype=uint64)
3163
+ ... A[0:3, 0:10]["x"] # doctest: +ELLIPSIS
3164
+ OrderedDict(...'a1'... array([1, 2])..., ...'a2'... array([3, 4])..., ...'y'... array([0, 2], dtype=uint64)..., ...'x'... array([0, 3], dtype=uint64)...)
3162
3165
3163
3166
With a floating-point array domain, index bounds are inclusive, e.g.:
3164
3167
@@ -3231,8 +3234,8 @@ cdef class SparseArrayImpl(Array):
3231
3234
... A[I, J] = {"a1": np.array([1, 2]),
3232
3235
... "a2": np.array([3, 4])}
3233
3236
... with tiledb.SparseArray(tmp + "/array", mode='r') as A:
3234
- ... A.query(attrs=("a1",), coords=False, order='G')[0:3, 0:10]
3235
- OrderedDict([( 'a1', array([1, 2]))] )
3237
+ ... A.query(attrs=("a1",), coords=False, order='G')[0:3, 0:10] # doctest: +ELLIPSIS
3238
+ OrderedDict(... 'a1'... array([1, 2])... )
3236
3239
3237
3240
"""
3238
3241
if not self .isopen or self .mode not in ('r' , 'd' ):
@@ -3341,8 +3344,8 @@ cdef class SparseArrayImpl(Array):
3341
3344
... "a2": np.array([3, 4])}
3342
3345
... with tiledb.SparseArray(tmp + "/array", mode='r') as A:
3343
3346
... # A[0:3, 0:10], attribute a1, row-major without coordinates
3344
- ... A.subarray((slice(0, 3), slice(0, 10)), attrs=("a1",), coords=False, order='G')
3345
- OrderedDict([( 'a1', array([1, 2]))] )
3347
+ ... A.subarray((slice(0, 3), slice(0, 10)), attrs=("a1",), coords=False, order='G') # doctest: +ELLIPSIS
3348
+ OrderedDict(... 'a1'... array([1, 2])... )
3346
3349
3347
3350
"""
3348
3351
from .subarray import Subarray
0 commit comments