Skip to content

Commit 463227f

Browse files
authored
Update theme and reference documentation (#146)
1 parent 89746a7 commit 463227f

File tree

6 files changed

+67
-38
lines changed

6 files changed

+67
-38
lines changed

README.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,36 @@ such as PyTorch_ or TensorFlow_. View the |docs| for more info.
3131
.. |license| image:: https://img.shields.io/github/license/xarray-contrib/xbatcher.svg
3232
:target: https://github.com/xarray-contrib/xbatcher
3333
:alt: license
34+
35+
Installation
36+
------------
37+
38+
Xbatcher can be installed from PyPI as::
39+
40+
python -m pip install xbatcher
41+
42+
Or via Conda as::
43+
44+
conda install -c conda-forge xbatcher
45+
46+
Or from source as::
47+
48+
python -m pip install git+https://github.com/xarray-contrib/xbatcher.git
49+
50+
.. note::
51+
The required dependencies installed with Xbatcher are `Xarray <https://xarray.dev/>`_,
52+
`Dask <https://www.dask.org/>`_, and `NumPy <https://numpy.org/>`_.
53+
You will need to separately install `TensorFlow <https://www.tensorflow.org/>`_
54+
or `PyTorch <https://pytorch.org/>`_ to use those data loaders or
55+
Xarray accessors. `Review the installation instructions <https://xbatcher.readthedocs.io/en/latest/#optional-dependencies>`_
56+
for more details.
57+
58+
Documentation
59+
------------
60+
61+
Documentation is hosted on ReadTheDocs: https://xbatcher.readthedocs.org
62+
63+
License
64+
------------
65+
66+
Apache License 2.0, see LICENSE file.

ci/requirements/doc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: xbatcher-docs
1+
name: xbatcher-docs-pydata
22
channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
66
- python=3.8
77
- dask
8+
- pydata-sphinx-theme
89
- ipython
910
- matplotlib
1011
- numpy
1112
- numpydoc
12-
- pangeo-sphinx-book-theme
1313
- pytest
14-
- sphinx
14+
- sphinx<6
1515
- sphinx-autosummary-accessors
1616
- sphinx-copybutton
1717
- xarray

doc/api.rst

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@ API reference
55

66
This page provides an auto-generated summary of Xbatcher's API.
77

8-
Dataset.batch and DataArray.batch
9-
=================================
8+
Core
9+
====
10+
11+
.. currentmodule:: xbatcher
12+
13+
.. autosummary::
14+
:toctree: generated/
15+
16+
BatchGenerator
17+
BatchSchema
18+
19+
Xbatcher xarray accessors
20+
=========================
1021

1122
.. currentmodule:: xarray
1223

@@ -17,19 +28,15 @@ Dataset.batch and DataArray.batch
1728
Dataset.batch.generator
1829
DataArray.batch.generator
1930

20-
Core
21-
====
22-
23-
.. autoclass:: xbatcher.BatchGenerator
24-
:members:
25-
2631
Dataloaders
2732
===========
28-
.. autoclass:: xbatcher.loaders.torch.MapDataset
29-
:members:
3033

31-
.. autoclass:: xbatcher.loaders.torch.IterableDataset
32-
:members:
34+
.. currentmodule:: xbatcher
35+
36+
.. autosummary::
37+
:toctree: generated/
3338

34-
.. autoclass:: xbatcher.loaders.keras.CustomTFDataset
39+
loaders.torch.MapDataset
40+
loaders.torch.IterableDataset
41+
loaders.keras.CustomTFDataset
3542
:members:

doc/conf.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
# type: ignore
1616

17+
import datetime
1718
import sys
1819

1920
import sphinx_autosummary_accessors
@@ -54,26 +55,13 @@
5455
"sphinx_copybutton",
5556
]
5657

57-
# only execute notebooks without any outputs
58-
# https://nbsphinx.readthedocs.io/en/0.2.14/never-execute.html
5958
nbsphinx_execute = "auto"
6059

6160

62-
# http://stackoverflow.com/questions/5599254/how-to-use-sphinxs-autodoc-to-document-a-classs-init-self-method
63-
def skip(app, what, name, obj, skip, options):
64-
if name == "__init__":
65-
return False
66-
return skip
67-
68-
69-
def setup(app):
70-
app.connect("autodoc-skip-member", skip)
71-
72-
7361
autodoc_mock_imports = ["torch", "tensorflow"]
7462

7563
# link to github issues
76-
extlinks = {"issue": ("https://github.com/xarray-contrib/xbatcher/issues/%s", "GH")}
64+
extlinks = {"issue": ("https://github.com/xarray-contrib/xbatcher/issues/%s", "#%s")}
7765

7866
# sphinx-copybutton configurations (from https://github.com/pydata/xarray/blob/main/doc/conf.py)
7967
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
@@ -97,7 +85,7 @@ def setup(app):
9785

9886
# General information about the project.
9987
project = "xbatcher"
100-
copyright = "2021, xbatcher developers"
88+
copyright = f"2016-{datetime.datetime.now().year}, xbatcher developers"
10189

10290
# The version info for the project you're documenting, acts as replacement for
10391
# |version| and |release|, also used in various other places throughout the
@@ -152,15 +140,14 @@ def setup(app):
152140
# The theme to use for HTML and HTML Help pages. See the documentation for
153141
# a list of builtin themes.
154142
# tml_theme = 'default'
155-
html_theme = "pangeo_sphinx_book_theme"
143+
html_theme = "pydata_sphinx_theme"
156144

157145
# Theme options are theme-specific and customize the look and feel of a theme
158146
# further. For a list of options available for each theme, see the
159147
# documentation.
160148
html_theme_options = {
161-
"repository_url": "https://github.com/xarray-contrib/xbatcher",
162-
"use_repository_button": True,
163-
"use_issues_button": True,
149+
"search_bar_position": "sidebar",
150+
"github_url": "https://github.com/xarray-contrib/xbatcher",
164151
}
165152

166153
# Add any paths that contain custom themes here, relative to this directory.
@@ -175,7 +162,7 @@ def setup(app):
175162

176163
# The name of an image file (relative to this directory) to place at the top
177164
# of the sidebar.
178-
# html_logo = None
165+
html_logo = None
179166

180167
# The name of an image file (within the static path) to use as favicon of the
181168
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32

doc/contributing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,10 @@ Continuous integration
243243

244244
Continuous integration is done with `GitHub Actions <https://docs.github.com/en/actions/learn-github-actions>`_.
245245

246-
There is currently 1 workflow configured:
246+
There are currently 3 workflows configured:
247247

248248
- `main.yaml <https://github.com/xarray-contrib/xbatcher/blob/main/.github/workflows/main.yaml>`_ - Run test suite with pytest.
249249
- `pypi-release.yaml <https://github.com/xarray-contrib/xbatcher/blob/main/.github/workflows/pypi-release.yaml>`_ - Publish
250250
wheels to TestPyPI and PyPI on a tagged release. The pull request trigger can be uncommented to test a release using Test PyPI.
251+
- `release-drafter.yml <https://github.com/xarray-contrib/xbatcher/blob/main/.github/workflows/release-drafter.yml>`_ - Draft
252+
release notes based on PR titles and labels.

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ or via a built-in `Xarray accessor <http://xarray.pydata.org/en/stable/internals
8787
:maxdepth: 2
8888
:caption: Contents:
8989

90-
roadmap
9190
api
9291
demo
92+
roadmap
9393
contributing

0 commit comments

Comments
 (0)