Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into db/scikit-build-core
Browse files Browse the repository at this point in the history
  • Loading branch information
dudoslav committed May 24, 2024
2 parents 7156bdc + 299bbbd commit 982d1e5
Show file tree
Hide file tree
Showing 18 changed files with 173 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ repos:
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.284
rev: v0.4.4
hooks:
- id: ruff
17 changes: 17 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Release 0.29.1

## Improvements

* Expose WebP enums by @kounelisagis in https://github.com/TileDB-Inc/TileDB-Py/pull/1974
* Add Array.query in docs and improve docs in general by @kounelisagis in https://github.com/TileDB-Inc/TileDB-Py/pull/1965
* Add support for creating WKB/WKT attributes by @jp-dark in https://github.com/TileDB-Inc/TileDB-Py/pull/1912
* Add wrapping for ls recursive by @kounelisagis in https://github.com/TileDB-Inc/TileDB-Py/pull/1968
* Fix compatibility for delete_fragments by @kounelisagis in https://github.com/TileDB-Inc/TileDB-Py/pull/1966

## Build system changes

* Fix ModuleNotFoundError: No module named 'numpy' on build by @kounelisagis in https://github.com/TileDB-Inc/TileDB-Py/pull/1979
* Add support for numpy2 by @kounelisagis in https://github.com/TileDB-Inc/TileDB-Py/pull/1969
* Fix syntax error in nightly build workflow by @ihnorton in https://github.com/TileDB-Inc/TileDB-Py/pull/1970
* Set an upper bound for numpy to dodge 2.0 by @sgillies in https://github.com/TileDB-Inc/TileDB-Py/pull/1963

# Release 0.29.0

* TileDB-Py 0.29.0 includes TileDB Embedded [2.23.0](https://github.com/TileDB-Inc/TileDB/releases/tag/2.23.0)
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
21 changes: 10 additions & 11 deletions doc/source/python-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Filters
.. automethod:: __getitem__(idx)
.. automethod:: __len__

.. autoclass:: tiledb.libtiledb.CompressionFilter
.. autoclass:: tiledb.CompressionFilter
:members:
.. autoclass:: tiledb.GzipFilter
:members:
Expand Down Expand Up @@ -116,22 +116,21 @@ Dense Array
-----------

.. autoclass:: tiledb.DenseArray
:members:

.. automethod:: __getitem__(selection)
.. automethod:: __setitem__(selection, value)
.. automethod:: query
.. automethod:: from_numpy(uri, array, ctx=None, **kwargs)
:members: query
:special-members: __getitem__, __setitem__

Sparse Array
------------

.. autoclass:: tiledb.SparseArray
:members:
:members: query
:special-members: __getitem__, __setitem__

.. automethod:: __getitem__(selection)
.. automethod:: __setitem__(selection, value)
.. automethod:: query
Query
---------------

.. autoclass:: tiledb.libtiledb.Query
:members:

Query Condition
---------------
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ extend-select = ["I001"]
extend-exclude = ["doc"]
fix = true

[tool.ruff.lint]
select = ["NPY201"]

[tool.ruff.per-file-ignores]
"tiledb/__init__.py" = ["F401"]

Expand Down
17 changes: 12 additions & 5 deletions tiledb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
Bzip2Filter,
ChecksumMD5Filter,
ChecksumSHA256Filter,
CompressionFilter,
DeltaFilter,
DictionaryFilter,
DoubleDeltaFilter,
Expand Down Expand Up @@ -73,6 +74,8 @@
)
from .libtiledb import (
Array,
DenseArrayImpl,
SparseArrayImpl,
consolidate,
ls,
move,
Expand All @@ -85,8 +88,6 @@
vacuum,
walk,
)
from .libtiledb import DenseArrayImpl as DenseArray
from .libtiledb import SparseArrayImpl as SparseArray
from .multirange_indexing import EmptyRange
from .object import Object
from .parquet_ import from_parquet
Expand Down Expand Up @@ -116,13 +117,19 @@
try:
from tiledb.cloud.cloudarray import CloudArray
except ImportError:
pass

class DenseArray(DenseArrayImpl):
pass

class SparseArray(SparseArrayImpl):
pass

else:

class DenseArray(DenseArray, CloudArray):
class DenseArray(DenseArrayImpl, CloudArray):
pass

class SparseArray(SparseArray, CloudArray):
class SparseArray(SparseArrayImpl, CloudArray):
pass

del CloudArray
2 changes: 1 addition & 1 deletion tiledb/array_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def version(self) -> int:
"""The array's schema (storage) version.
:rtype: int
:raises :py:exc:`tiledb.TileDBError`
:raises: :py:exc:`tiledb.TileDBError`
"""
return self._version

Expand Down
2 changes: 1 addition & 1 deletion tiledb/ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def dict(self, prefix: str = ""):
:param str prefix: return only parameters with a given prefix
:rtype: dict
:return: Config parameter / values as a a Python dict
:return: Config parameter / values as a Python dict
"""
return dict(ConfigItems(self, prefix=prefix))
Expand Down
11 changes: 7 additions & 4 deletions tiledb/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CompressionFilter(Filter):
>>> with tempfile.TemporaryDirectory() as tmp:
... dom = tiledb.Domain(tiledb.Dim(domain=(0, 9), tile=2, dtype=np.uint64))
... a1 = tiledb.Attr(name="a1", dtype=np.int64,
... filters=tiledb.FilterList([tiledb.GzipFilter(level=10)]))
... filters=tiledb.FilterList([tiledb.CompressionFilter(level=10)]))
... schema = tiledb.ArraySchema(domain=dom, attrs=(a1,))
... tiledb.DenseArray.create(tmp + "/array", schema)
Expand Down Expand Up @@ -326,8 +326,7 @@ class DoubleDeltaFilter(CompressionFilter):
:param level: -1 (default) sets the compressor level to the default level as specified in TileDB core. Otherwise, sets the compressor level to the given value.
:type level: int
:param reinterp_dtype: (optional) sets the compressor to compress the data treating
as the new datatype.
:param reinterp_dtype: (optional) sets the compressor to compress the data treating as the new datatype.
**Example:**
Expand Down Expand Up @@ -501,7 +500,8 @@ class PositiveDeltaFilter(Filter):
:param ctx: A TileDB Context
:type ctx: tiledb.Ctx
:param window: -1 (default) sets the max window size for the filter to the default window size as specified in TileDB core. Otherwise, sets the compressor level to the given value.
:type window: int
:type window: int
**Example:**
>>> import tiledb, numpy as np, tempfile
Expand Down Expand Up @@ -754,6 +754,9 @@ class WebpFilter(Filter):
lt.FilterOption.WEBP_LOSSLESS,
)

# Expose WebP enums at the top level
WebpInputFormat = lt.WebpInputFormat

def __init__(
self,
input_format: lt.WebpInputFormat = None,
Expand Down
2 changes: 1 addition & 1 deletion tiledb/highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def is_ndarray_like(arr):
elif shape and dtype:
if np.issubdtype(np.bytes_, dtype):
dtype = np.dtype("S")
elif np.issubdtype(dtype, np.unicode_):
elif np.issubdtype(dtype, np.str_):
dtype = np.dtype("U")

ndim = len(shape)
Expand Down
Loading

0 comments on commit 982d1e5

Please sign in to comment.