Skip to content

Commit a582c57

Browse files
committed
Merge branch 'master' into to
2 parents e3d3e72 + 3066aa4 commit a582c57

File tree

9 files changed

+168
-4
lines changed

9 files changed

+168
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ instance/
7070

7171
# Sphinx documentation
7272
docs/_build/
73+
docs/generated/
7374

7475
# PyBuilder
7576
target/

docs/api.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.. currentmodule:: xarray
2+
3+
API reference
4+
=============
5+
This page contains a auto-generated summary of ``pint-xarray``'s API.
6+
7+
8+
Dataset
9+
-------
10+
.. autosummary::
11+
:toctree: generated/
12+
:template: autosummary/accessor_method.rst
13+
14+
Dataset.pint.quantify
15+
Dataset.pint.dequantify
16+
Dataset.pint.to_base_units
17+
Dataset.pint.to_system
18+
19+
DataArray
20+
---------
21+
.. autosummary::
22+
:toctree: generated/
23+
:template: autosummary/accessor_property.rst
24+
25+
DataArray.pint.magnitude
26+
DataArray.pint.units
27+
DataArray.pint.dimensionality
28+
DataArray.pint.registry
29+
30+
.. autosummary::
31+
:toctree: generated/
32+
:template: autosummary/accessor_method.rst
33+
34+
DataArray.pint.quantify
35+
DataArray.pint.dequantify
36+
DataArray.pint.to
37+
DataArray.pint.to_base_units

docs/conf.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
# -- Imports -----------------------------------------------------------------
18+
19+
import datetime as dt
20+
21+
import sphinx_autosummary_accessors
22+
23+
# need to import so accessors get registered
24+
import pintxarray # noqa: F401
25+
26+
# -- Project information -----------------------------------------------------
27+
28+
year = dt.datetime.now().year
29+
project = "pint-xarray"
30+
author = f"{project} developers"
31+
copyright = f"{year}, {author}"
32+
33+
34+
# -- General configuration ---------------------------------------------------
35+
36+
# Add any Sphinx extension module names here, as strings. They can be
37+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
38+
# ones.
39+
extensions = [
40+
"sphinx.ext.intersphinx",
41+
"sphinx.ext.autosummary",
42+
"sphinx.ext.autodoc",
43+
"sphinx.ext.napoleon",
44+
"sphinx_autosummary_accessors",
45+
]
46+
47+
# Add any paths that contain templates here, relative to this directory.
48+
templates_path = ["_templates", sphinx_autosummary_accessors.templates_path]
49+
50+
# List of patterns, relative to source directory, that match files and
51+
# directories to ignore when looking for source files.
52+
# This pattern also affects html_static_path and html_extra_path.
53+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
54+
55+
56+
# -- Options for HTML output -------------------------------------------------
57+
58+
# The theme to use for HTML and HTML Help pages. See the documentation for
59+
# a list of builtin themes.
60+
#
61+
html_theme = "sphinx_rtd_theme"
62+
63+
# Add any paths that contain custom static files (such as style sheets) here,
64+
# relative to this directory. They are copied after the builtin static files,
65+
# so a file named "default.css" will overwrite the builtin "default.css".
66+
# html_static_path = ["_static"]
67+
68+
69+
# -- Extension configuration -------------------------------------------------
70+
71+
autosummary_generate = True
72+
autodoc_typehints = "none"
73+
74+
napoleon_use_param = True
75+
napoleon_use_rtype = True
76+
77+
# -- Options for intersphinx extension ---------------------------------------
78+
79+
# Example configuration for intersphinx: refer to the Python standard library.
80+
intersphinx_mapping = {"https://docs.python.org/3/": None}

docs/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. accessors documentation master file, created by
2+
sphinx-quickstart on Thu Jul 2 01:49:50 2020.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to accessors's documentation!
7+
=====================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
api

docs/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pint>=0.13
2+
xarray>=0.15.1
3+
sphinx>=3.0
4+
sphinx_rtd_theme
5+
nbsphinx
6+
git+https://github.com/keewis/sphinx-autosummary-accessors

pintxarray/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
try:
2+
from importlib.metadata import version
3+
except ImportError:
4+
from importlib_metadata import version
5+
16
from .accessors import PintDataArrayAccessor, PintDatasetAccessor # noqa
7+
8+
try:
9+
__version__ = version("pint-xarray")
10+
except Exception:
11+
# Local copy or not installed with setuptools.
12+
# Disable minimum version checks on downstream libraries.
13+
__version__ = "999"

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[build-system]
2-
requires = ["setuptools >= 41", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["setuptools >= 42", "wheel", "setuptools_scm[toml] >= 3.4"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]

readthedocs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
3+
build:
4+
image: latest
5+
6+
python:
7+
install:
8+
- requirements: docs/requirements.txt
9+
- method: pip
10+
path: .

setup.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[metadata]
22
name = pint-xarray
3-
version = 0.0.1
43
author = Tom Nicholas
54
author_email = [email protected]
65
description = Physical units interface to xarray using Pint
@@ -9,7 +8,11 @@ url = https://github.com/TomNicholas/pint-xarray
98
[options]
109
packages = find:
1110
python_requires = >=3.6
12-
install_requires = numpy>=1.17.1; xarray>=0.15.1; pint>=0.13
11+
install_requires =
12+
numpy >= 1.17.1
13+
xarray >= 0.15.1
14+
pint >= 0.13
15+
importlib-metadata; python_version < "3.8"
1316

1417
[flake8]
1518
ignore =

0 commit comments

Comments
 (0)