Skip to content

Commit

Permalink
Fix broken API docs search and expose Metadata (#2153)
Browse files Browse the repository at this point in the history
* Fix the broken search functionality in docs.
* Resolve multiple minor errors and warnings encountered during the docs build process.
* Expose the Metadata class as tiledb.Metadata.
  • Loading branch information
kounelisagis authored Feb 6, 2025
1 parent f2bb95c commit 88f9e1e
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 23 deletions.
21 changes: 18 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# -- Project information -----------------------------------------------------

project = "TileDB-Py"
copyright = "2024, TileDB, Inc."
copyright = "2025, TileDB, Inc."
author = "TileDB, Inc."

# The full version, including alpha/beta/rc tags
Expand All @@ -41,7 +41,17 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.intersphinx"]
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.autosummary",
"nbsphinx",
"sphinxcontrib.jquery",
]

autosummary_generate = True

# Mapping for linking between RTD subprojects.
if readthedocs:
Expand All @@ -55,9 +65,14 @@
% rtd_version,
None,
),
"python": ("https://docs.python.org/", None),
"python": (
"https://docs.python.org/3",
None,
),
}

napoleon_custom_sections = ["Lifecycle"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
4 changes: 1 addition & 3 deletions doc/source/gensidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
# https://github.com/robotpy/robotpy-docs, licensed under Apache v2.
#

import os


def write_if_changed(fname, contents):

try:
with open(fname, "r") as fp:
old_contents = fp.read()
except:
except Exception:
old_contents = ""

if old_contents != contents:
Expand Down
11 changes: 2 additions & 9 deletions doc/source/python-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ There is also a submodule ``libtiledb`` which contains the necessary bindings to
.. code-block:: python
import tiledb
tiledb.version() # TileDB-Py package version number
tiledb.libtiledb.version() # Native TileDB library version number
Getting Started
Expand Down Expand Up @@ -176,17 +177,14 @@ Group
.. automethod:: __contains__(member)
.. automethod:: __len__

.. autoclass:: tiledb.Group.GroupMetadata
.. autoclass:: tiledb.Metadata
:members:

.. automethod:: __setitem__(key, value)
.. automethod:: __getitem__(key)
.. automethod:: __delitem__(key)
.. automethod:: __contains__(key)
.. automethod:: __len__
.. automethod:: __keys__
.. automethod:: __values__
.. automethod:: __items__

Object
------
Expand Down Expand Up @@ -246,11 +244,6 @@ Filestore

.. automethod:: __len__

Version
-------

.. autofunction:: tiledb.libtiledb.version

Statistics
----------

Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ dynamic = ["version"]

[project.optional-dependencies]
doc = [
"jinja2==3.0.0",
"sphinx-rtd-theme==2.0.0",
"Sphinx",
"jinja2==3.1.5",
"sphinx-rtd-theme==3.0.2",
"Sphinx==8.1.3",
"nbsphinx==0.9.6",
"breathe",
]
test = [
Expand Down
1 change: 1 addition & 0 deletions tiledb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
walk,
)
from .libtiledb import TileDBError
from .metadata import Metadata
from .multirange_indexing import EmptyRange
from .object import Object
from .parquet_ import from_parquet
Expand Down
3 changes: 2 additions & 1 deletion tiledb/dense_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def query(
Consuming this iterable returns a result set for each TileDB incomplete query.
See usage example in 'examples/incomplete_iteration.py'.
To retrieve the estimated result sizes for the query ranges, use:
`A.query(..., return_incomplete=True)[...].est_result_size()`
`A.query(..., return_incomplete=True)[...].est_result_size()`
If False (default False), queries will be internally run to completion by resizing buffers and
resubmitting until query is complete.
:return: A proxy Query object that can be used for indexing into the DenseArray
Expand All @@ -164,6 +164,7 @@ def query(
... {"a1": np.zeros(5)})
"""

if not self.isopen:
raise tiledb.TileDBError("Array is not opened")

Expand Down
6 changes: 2 additions & 4 deletions tiledb/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,8 @@ class DeltaFilter(CompressionFilter):
Filter that compresses using run-length encoding (RLE).
: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.
:type reinterp_dtype: numpy, lt.DataType
:param reinterp_dtype: (optional) sets the compressor to compress the data treating as the new datatype.
**Example:**
>>> import tiledb, numpy as np, tempfile
Expand Down

0 comments on commit 88f9e1e

Please sign in to comment.