Skip to content

Commit a94fea3

Browse files
committed
Format files
1 parent ac4e1ef commit a94fea3

9 files changed

+23
-22
lines changed

examples/variable_length.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535

3636
import numpy as np
3737

38-
#%%
38+
# %%
3939
import tiledb
4040
from tiledb.tests.common import assert_subarrays_equal
4141

4242
array_name = "variable_length_array"
4343

44-
#%%
44+
# %%
4545

4646

4747
def create_array():

tiledb/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
__version__ = version.version
109109
group_create = Group.create
110110

111+
111112
# Create a proxy object to wrap libtiledb and provide a `cc` alias
112113
class CCProxy:
113114
def __init__(self, module):

tiledb/dataframe_.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,9 @@ def _create_array(uri, df, sparse, full_domain, index_dims, column_infos, tiledb
692692
enums=enums,
693693
cell_order=tiledb_args["cell_order"],
694694
tile_order=tiledb_args["tile_order"],
695-
coords_filters=None
696-
if coord_filter is True
697-
else _get_schema_filters(coord_filter),
695+
coords_filters=(
696+
None if coord_filter is True else _get_schema_filters(coord_filter)
697+
),
698698
offsets_filters=_get_schema_filters(
699699
tiledb_args.get("offsets_filters", True)
700700
),

tiledb/dense_array.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,10 @@ def subarray(self, selection, attrs=None, cond=None, coords=False, order=None):
281281
out = self._read_dense_subarray(subarray, attr_names, cond, layout, coords)
282282
if any(s.step for s in idx):
283283
steps = tuple(slice(None, None, s.step) for s in idx)
284-
for (k, v) in out.items():
284+
for k, v in out.items():
285285
out[k] = v.__getitem__(steps)
286286
if drop_axes:
287-
for (k, v) in out.items():
287+
for k, v in out.items():
288288
out[k] = v.squeeze(axis=drop_axes)
289289
# attribute is anonymous, just return the result
290290
if not coords and self.schema.nattr == 1:

tiledb/domain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def size(self):
147147
"""
148148
if not np.issubdtype(self.dtype, self.integer):
149149
raise TypeError("size valid only for integer domains")
150-
return np.product(self.shape)
150+
return np.prod(self.shape)
151151

152152
def _is_homogeneous(self):
153153
dtype0 = self.dim(0).dtype

tiledb/filter.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -879,12 +879,10 @@ def chunksize(self):
879879
return self._chunksize
880880

881881
@overload
882-
def __getitem__(self, idx: int) -> Filter:
883-
...
882+
def __getitem__(self, idx: int) -> Filter: ...
884883

885884
@overload
886-
def __getitem__(self, idx: slice) -> List[Filter]:
887-
...
885+
def __getitem__(self, idx: slice) -> List[Filter]: ...
888886

889887
def __getitem__(self, idx):
890888
"""Gets a copy of the filter in the list at the given index

tiledb/tests/test_core.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ def test_pyquery_init(self):
5757
self.assertEqual(q._test_init_buffer_bytes, intmax)
5858
self.assertEqual(q._test_alloc_max_bytes, intmax)
5959

60-
with self.assertRaisesRegex(
61-
ValueError,
62-
"Invalid parameter: 'py.alloc_max_bytes' must be >= 1 MB ",
63-
), tiledb.scope_ctx({"py.alloc_max_bytes": 10}) as ctx2:
60+
with (
61+
self.assertRaisesRegex(
62+
ValueError,
63+
"Invalid parameter: 'py.alloc_max_bytes' must be >= 1 MB ",
64+
),
65+
tiledb.scope_ctx({"py.alloc_max_bytes": 10}) as ctx2,
66+
):
6467
q = core.PyQuery(ctx2, a, ("",), (), 0, False)
6568

6669
def test_import_buffer(self):

tiledb/tests/test_libtiledb.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -2832,9 +2832,10 @@ def test_pickle_with_tuple_timestamps(self, sparse, use_timestamps):
28322832
assert_array_equal(T[:], T2[:])
28332833
assert T2.timestamp_range == (timestamps[1], timestamps[2])
28342834

2835-
with io.BytesIO() as buf, tiledb.open(
2836-
path, timestamp=(timestamps[1], timestamps[2])
2837-
) as V:
2835+
with (
2836+
io.BytesIO() as buf,
2837+
tiledb.open(path, timestamp=(timestamps[1], timestamps[2])) as V,
2838+
):
28382839
pickle.dump(V, buf)
28392840
buf.seek(0)
28402841
with pickle.load(buf) as V2:

tiledb/tests/test_multi_index.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,7 @@ def test_multirange_1d_sparse_double(self):
436436
assert_array_equal(orig_array[-1], A.multi_index[30.0][attr_name])
437437
assert_array_equal(
438438
orig_array[coords.size - 3 : coords.size],
439-
A.multi_index[
440-
(28.0, 30.0),
441-
][attr_name],
439+
A.multi_index[(28.0, 30.0),][attr_name],
442440
)
443441

444442
res = A.multi_index[slice(0, 5)]

0 commit comments

Comments
 (0)