Skip to content

Commit 74764af

Browse files
authored
Automatically document Array members (#1547)
* Automatically document Array members * Fix Array link
1 parent 503efaf commit 74764af

File tree

5 files changed

+10
-77
lines changed

5 files changed

+10
-77
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ coverage.xml
5151

5252
# Sphinx documentation
5353
docs/_build/
54+
docs/_autoapi/
5455

5556
# PyBuilder
5657
target/

docs/api/core.rst

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
The Array class (``zarr.core``)
22
===============================
3-
.. module:: zarr.core
43

5-
.. autoclass:: Array
6-
7-
.. automethod:: __getitem__
8-
.. automethod:: __setitem__
9-
.. automethod:: get_basic_selection
10-
.. automethod:: set_basic_selection
11-
.. automethod:: get_mask_selection
12-
.. automethod:: set_mask_selection
13-
.. automethod:: get_block_selection
14-
.. automethod:: set_block_selection
15-
.. automethod:: get_coordinate_selection
16-
.. automethod:: set_coordinate_selection
17-
.. automethod:: get_orthogonal_selection
18-
.. automethod:: set_orthogonal_selection
19-
.. automethod:: digest
20-
.. automethod:: hexdigest
21-
.. automethod:: resize
22-
.. automethod:: append
23-
.. automethod:: view
24-
.. automethod:: astype
4+
.. automodapi:: zarr.core
5+
:no-heading:

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"sphinx.ext.autosummary",
4343
"sphinx.ext.viewcode",
4444
"sphinx.ext.intersphinx",
45+
"sphinx_automodapi.automodapi",
4546
"numpydoc",
4647
"sphinx_issues",
4748
"sphinx_copybutton",
@@ -52,6 +53,9 @@
5253
numpydoc_class_members_toctree = False
5354
issues_github_path = "zarr-developers/zarr-python"
5455

56+
automodapi_inheritance_diagram = False
57+
automodapi_toctreedirnm = "_autoapi"
58+
5559
# Add any paths that contain templates here, relative to this directory.
5660
templates_path = ["_templates"]
5761

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jupyter = [
4545
]
4646
docs = [
4747
'sphinx',
48+
'sphinx-automodapi',
4849
'sphinx_design',
4950
'sphinx-issues',
5051
'sphinx-copybutton',

zarr/core.py

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
ensure_ndarray_like,
6161
)
6262

63+
__all__ = ["Array"]
64+
6365

6466
# noinspection PyUnresolvedReferences
6567
class Array:
@@ -110,62 +112,6 @@ class Array:
110112
to users. Use `numpy.empty(())` by default.
111113
112114
.. versionadded:: 2.13
113-
114-
115-
Attributes
116-
----------
117-
store
118-
path
119-
name
120-
read_only
121-
chunk_store
122-
shape
123-
chunks
124-
dtype
125-
compression
126-
compression_opts
127-
dimension_separator
128-
fill_value
129-
order
130-
synchronizer
131-
filters
132-
attrs
133-
size
134-
itemsize
135-
nbytes
136-
nbytes_stored
137-
cdata_shape
138-
nchunks
139-
nchunks_initialized
140-
is_view
141-
info
142-
vindex
143-
oindex
144-
blocks
145-
write_empty_chunks
146-
meta_array
147-
148-
Methods
149-
-------
150-
__getitem__
151-
__setitem__
152-
get_basic_selection
153-
set_basic_selection
154-
get_orthogonal_selection
155-
set_orthogonal_selection
156-
get_mask_selection
157-
set_mask_selection
158-
get_coordinate_selection
159-
set_coordinate_selection
160-
get_block_selection
161-
set_block_selection
162-
digest
163-
hexdigest
164-
resize
165-
append
166-
view
167-
astype
168-
169115
"""
170116

171117
def __init__(

0 commit comments

Comments
 (0)