Skip to content

Commit 64643da

Browse files
negin513pre-commit-ci[bot]dcherianjacobtomlinsonmaxrjones
authored
Documentation Updates 📖 (#35)
* adding an inital notebook * initial commit of restructure * updating index * moving the files under source for build * moving index to top level * update badges * adding notebook content * restructure * adding contributing * adding conf.py * updating the organization * updating index.md * quick fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update doc.yml * updates to readme badges * badges updates * Update docs/index.md Co-authored-by: Jacob Tomlinson <[email protected]> * fix index * update index to cover the comments * Edits. Co-authored-by: Max Jones <[email protected]> * more edits. * update the dos locations * fix the bad link in tutorials * Small fix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak Cherian <[email protected]> Co-authored-by: Jacob Tomlinson <[email protected]> Co-authored-by: dcherian <[email protected]> Co-authored-by: Max Jones <[email protected]>
1 parent 0bdfa23 commit 64643da

14 files changed

+8344
-3369
lines changed

.readthedocs.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,8 @@ build:
66
tools:
77
python: 'mambaforge-4.10'
88

9-
# Build documentation in the docs/ directory with Sphinx
10-
sphinx:
11-
configuration: docs/conf.py
12-
139
# Optionally set the version of Python and requirements required to build your docs
1410
conda:
1511
environment: ci/doc.yml
1612

17-
python:
18-
install:
19-
- method: pip
20-
path: .
13+
formats: []

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# cupy-xarray
22

3+
> [!IMPORTANT]
34
> ⚠️ This project is looking for maintainers and contributors. Come help out!
45
5-
[![GitHub Workflow CI Status](https://img.shields.io/github/workflow/status/xarray-contrib/cupy-xarray/CI?logo=github&style=flat)](https://github.com/xarray-contrib/cupy-xarray/actions)
6+
![GitHub Workflow CI Status](https://img.shields.io/github/actions/workflow/status/xarray-contrib/cupy-xarray/pypi-release.yaml?style=flat)
67
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/xarray-contrib/cupy-xarray/main.svg)](https://results.pre-commit.ci/latest/github/xarray-contrib/cupy-xarray/main)
7-
[![Documentation Status](https://readthedocs.org/projects/cupy-xarray/badge/?version=latest)](https://cupy-xarray.readthedocs.io/en/latest/?badge=latest)
8+
[![Documentation Status](https://readthedocs.org/projects/cupy-xarray/badge/?version=latest)](https://cupy-xarray.readthedocs.io)
89

910
[![PyPI](https://img.shields.io/pypi/v/cupy-xarray.svg?style=flat)](https://pypi.org/project/cupy-xarray/)
1011
[![Conda-forge](https://img.shields.io/conda/vn/conda-forge/cupy-xarray.svg?style=flat)](https://anaconda.org/conda-forge/cupy-xarray)

ci/doc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ dependencies:
55
- pip
66
- python=3.10
77
- sphinx
8+
- sphinx-design
89
- sphinx-copybutton
9-
- numpydoc
1010
- sphinx-autosummary-accessors
11+
- numpydoc
1112
- ipython
1213
- ipykernel
1314
- ipywidgets

docs/conf.py

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sphinx_autosummary_accessors
1111

1212
project = "cupy-xarray"
13-
copyright = "2022, cupy-xarray developers"
13+
copyright = "2023, cupy-xarray developers"
1414
author = "cupy-xarray developers"
1515
release = "v0.1"
1616

@@ -20,15 +20,18 @@
2020
extensions = [
2121
# "sphinx.ext.autodoc",
2222
"sphinx.ext.viewcode",
23-
# "sphinx.ext.autosummary",
23+
"sphinx.ext.autosummary",
2424
"sphinx.ext.doctest",
2525
"sphinx.ext.intersphinx",
2626
"sphinx.ext.extlinks",
2727
"numpydoc",
2828
# "sphinx_autosummary_accessors",
2929
"IPython.sphinxext.ipython_directive",
30+
"sphinx.ext.napoleon",
3031
"myst_nb",
32+
# "nbsphinx",
3133
"sphinx_copybutton",
34+
"sphinx_design",
3235
]
3336

3437

@@ -56,3 +59,68 @@
5659
"cupy": ("https://docs.cupy.dev/en/latest", None),
5760
"xarray": ("http://docs.xarray.dev/en/latest/", None),
5861
}
62+
63+
autosummary_generate = True
64+
autodoc_typehints = "none"
65+
66+
# Napoleon configurations
67+
napoleon_google_docstring = False
68+
napoleon_numpy_docstring = True
69+
napoleon_use_param = False
70+
napoleon_use_rtype = False
71+
napoleon_preprocess_types = True
72+
napoleon_type_aliases = {
73+
# general terms
74+
"sequence": ":term:`sequence`",
75+
"iterable": ":term:`iterable`",
76+
"callable": ":py:func:`callable`",
77+
"dict_like": ":term:`dict-like <mapping>`",
78+
"dict-like": ":term:`dict-like <mapping>`",
79+
"path-like": ":term:`path-like <path-like object>`",
80+
"mapping": ":term:`mapping`",
81+
"file-like": ":term:`file-like <file-like object>`",
82+
# special terms
83+
# "same type as caller": "*same type as caller*", # does not work, yet
84+
# "same type as values": "*same type as values*", # does not work, yet
85+
# stdlib type aliases
86+
"MutableMapping": "~collections.abc.MutableMapping",
87+
"sys.stdout": ":obj:`sys.stdout`",
88+
"timedelta": "~datetime.timedelta",
89+
"string": ":class:`string <str>`",
90+
# numpy terms
91+
"array_like": ":term:`array_like`",
92+
"array-like": ":term:`array-like <array_like>`",
93+
"scalar": ":term:`scalar`",
94+
"array": ":term:`array`",
95+
"hashable": ":term:`hashable <name>`",
96+
# matplotlib terms
97+
"color-like": ":py:func:`color-like <matplotlib.colors.is_color_like>`",
98+
"matplotlib colormap name": ":doc:`matplotlib colormap name <matplotlib:gallery/color/colormap_reference>`",
99+
"matplotlib axes object": ":py:class:`matplotlib axes object <matplotlib.axes.Axes>`",
100+
"colormap": ":py:class:`colormap <matplotlib.colors.Colormap>`",
101+
# objects without namespace: xarray
102+
"DataArray": "~xarray.DataArray",
103+
"Dataset": "~xarray.Dataset",
104+
"Variable": "~xarray.Variable",
105+
"DatasetGroupBy": "~xarray.core.groupby.DatasetGroupBy",
106+
"DataArrayGroupBy": "~xarray.core.groupby.DataArrayGroupBy",
107+
# objects without namespace: numpy
108+
"ndarray": "~numpy.ndarray",
109+
"DaskArray": "~dask.array.Array",
110+
"MaskedArray": "~numpy.ma.MaskedArray",
111+
"dtype": "~numpy.dtype",
112+
"ComplexWarning": "~numpy.ComplexWarning",
113+
# objects without namespace: pandas
114+
"Index": "~pandas.Index",
115+
"MultiIndex": "~pandas.MultiIndex",
116+
"CategoricalIndex": "~pandas.CategoricalIndex",
117+
"TimedeltaIndex": "~pandas.TimedeltaIndex",
118+
"DatetimeIndex": "~pandas.DatetimeIndex",
119+
"Series": "~pandas.Series",
120+
"DataFrame": "~pandas.DataFrame",
121+
"Categorical": "~pandas.Categorical",
122+
"Path": "~~pathlib.Path",
123+
# objects with abbreviated namespace (from pandas)
124+
"pd.Index": "~pandas.Index",
125+
"pd.NaT": "~pandas.NaT",
126+
}

docs/index.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,86 @@
1-
# Welcome to cupy-xarray's documentation!
1+
# CuPy-Xarray: Xarray on GPUs!
2+
3+
![GitHub Workflow CI Status](https://img.shields.io/github/actions/workflow/status/xarray-contrib/cupy-xarray/pypi-release.yaml?style=flat-square)
4+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/xarray-contrib/cupy-xarray/main.svg?style=flat-square)](https://results.pre-commit.ci/latest/github/xarray-contrib/cupy-xarray/main)
5+
[![Documentation Status](https://readthedocs.org/projects/cupy-xarray/badge/?version=latest&style=flat-square)](https://cupy-xarray.readthedocs.io)
6+
[![license](https://img.shields.io/github/license/xarray-contrib/cupy-xarray.svg?style=flat-square)](https://github.com/xarray-contrib/cupy-xarray)
7+
8+
[![PyPI](https://img.shields.io/pypi/v/cupy-xarray.svg?style=flat-square)](https://pypi.org/project/cupy-xarray/)
9+
[![Conda-forge](https://img.shields.io/conda/vn/conda-forge/cupy-xarray.svg?style=flat-square)](https://anaconda.org/conda-forge/cupy-xarray)
10+
11+
[![NASA-80NSSC22K0345](https://img.shields.io/badge/NASA-80NSSC22K0345-blue?style=flat-square)](https://science.nasa.gov/open-science-overview)
12+
13+
## Overview
14+
15+
CuPy-Xarray is a Python library that leverages [CuPy](https://cupy.dev/), a GPU array library, and [Xarray](https://docs.xarray.dev/en/stable/), a library for multi-dimensional labeled array computations, to enable fast and efficient data processing on GPUs. By combining the capabilities of CuPy and Xarray, CuPy-Xarray provides a convenient interface for performing accelerated computations and analysis on large multidimensional datasets.
16+
17+
## Installation
18+
19+
CuPy-Xarray can be installed using `pip` or `conda`:
20+
21+
From Conda Forge:
22+
23+
```bash
24+
25+
conda install cupy-xarray -c conda-forge
26+
```
27+
28+
From PyPI:
29+
30+
```bash
31+
pip install cupy-xarray
32+
```
33+
34+
The latest version from Github:
35+
36+
```bash
37+
pip install git+https://github.com/xarray-contrib/cupy-xarray.git
38+
```
39+
40+
## Acknowledgements
41+
42+
Large parts of this documentations comes from [SciPy 2023 Xarray on GPUs tutorial](https://negin513.github.io/cupy-xarray-tutorials/README.html) and [this NCAR tutorial to GPUs](https://github.com/NCAR/GPU_workshop/tree/workshop/13_CuPyAndLegate).
243

344
## Contents
445

546
```{eval-rst}
47+
48+
**User Guide**:
49+
50+
.. toctree::
51+
:maxdepth: 1
52+
:caption: User Guide
53+
54+
source/cupy-basics
55+
source/introduction
56+
source/basic-computations
57+
source/high-level-api
58+
source/apply-ufunc
59+
source/real-example-1
60+
61+
62+
**Tutorials & Presentations**:
63+
64+
.. toctree::
65+
:maxdepth: 1
66+
:caption: Tutorials & Presentations
67+
68+
source/tutorials-and-presentations
69+
70+
**Contributing**:
71+
72+
.. toctree::
73+
:maxdepth: 1
74+
:caption: Contributing
75+
76+
source/contributing
77+
78+
79+
**API Reference**:
80+
681
.. toctree::
782
:maxdepth: 1
83+
:caption: API Reference
884
9-
quickstart
85+
api
1086
```

0 commit comments

Comments
 (0)