Skip to content

Commit

Permalink
Automatically document Array members (#1547)
Browse files Browse the repository at this point in the history
* Automatically document Array members

* Fix Array link
  • Loading branch information
dstansby committed Nov 24, 2023
1 parent 503efaf commit 74764af
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 77 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_autoapi/

# PyBuilder
target/
Expand Down
23 changes: 2 additions & 21 deletions docs/api/core.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
The Array class (``zarr.core``)
===============================
.. module:: zarr.core

.. autoclass:: Array

.. automethod:: __getitem__
.. automethod:: __setitem__
.. automethod:: get_basic_selection
.. automethod:: set_basic_selection
.. automethod:: get_mask_selection
.. automethod:: set_mask_selection
.. automethod:: get_block_selection
.. automethod:: set_block_selection
.. automethod:: get_coordinate_selection
.. automethod:: set_coordinate_selection
.. automethod:: get_orthogonal_selection
.. automethod:: set_orthogonal_selection
.. automethod:: digest
.. automethod:: hexdigest
.. automethod:: resize
.. automethod:: append
.. automethod:: view
.. automethod:: astype
.. automodapi:: zarr.core
:no-heading:
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_automodapi.automodapi",
"numpydoc",
"sphinx_issues",
"sphinx_copybutton",
Expand All @@ -52,6 +53,9 @@
numpydoc_class_members_toctree = False
issues_github_path = "zarr-developers/zarr-python"

automodapi_inheritance_diagram = False
automodapi_toctreedirnm = "_autoapi"

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

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jupyter = [
]
docs = [
'sphinx',
'sphinx-automodapi',
'sphinx_design',
'sphinx-issues',
'sphinx-copybutton',
Expand Down
58 changes: 2 additions & 56 deletions zarr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
ensure_ndarray_like,
)

__all__ = ["Array"]


# noinspection PyUnresolvedReferences
class Array:
Expand Down Expand Up @@ -110,62 +112,6 @@ class Array:
to users. Use `numpy.empty(())` by default.
.. versionadded:: 2.13
Attributes
----------
store
path
name
read_only
chunk_store
shape
chunks
dtype
compression
compression_opts
dimension_separator
fill_value
order
synchronizer
filters
attrs
size
itemsize
nbytes
nbytes_stored
cdata_shape
nchunks
nchunks_initialized
is_view
info
vindex
oindex
blocks
write_empty_chunks
meta_array
Methods
-------
__getitem__
__setitem__
get_basic_selection
set_basic_selection
get_orthogonal_selection
set_orthogonal_selection
get_mask_selection
set_mask_selection
get_coordinate_selection
set_coordinate_selection
get_block_selection
set_block_selection
digest
hexdigest
resize
append
view
astype
"""

def __init__(
Expand Down

0 comments on commit 74764af

Please sign in to comment.