Skip to content

Add a document template for the whole array API standard #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spec/_build/
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx==3.1.1
sphinx-material==0.0.30
recommonmark
sphinx_markdown_tables
sphinx_copybutton
1 change: 1 addition & 0 deletions spec/API_specification/array_object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Array object
1 change: 1 addition & 0 deletions spec/API_specification/casting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Dtype casting
10 changes: 10 additions & 0 deletions spec/API_specification/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
API specification
=================

.. toctree::
:caption: API specification
:maxdepth: 1

array_object
indexing
casting
1 change: 1 addition & 0 deletions spec/API_specification/indexing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Indexing
20 changes: 20 additions & 0 deletions spec/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
15 changes: 15 additions & 0 deletions spec/assumptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Assumptions

## Hardware environments



## Software environments



## Dependencies



## Interactive use & production code
1 change: 1 addition & 0 deletions spec/benchmark_suite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Benchmark suite
160 changes: 160 additions & 0 deletions spec/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import sphinx_material
from recommonmark.transform import AutoStructify

# -- Project information -----------------------------------------------------

project = 'Python array API standard'
copyright = '2020, Consortium for Python Data API Standards'
author = 'Consortium for Python Data API Standards'

# The full version, including alpha/beta/rc tags
release = '0.1-dev'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'recommonmark',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx_markdown_tables',
'sphinx_copybutton',
]

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

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
extensions.append("sphinx_material")
html_theme_path = sphinx_material.html_theme_path()
html_context = sphinx_material.get_html_context()
html_theme = 'sphinx_material'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Material theme options (see theme.conf for more information) ------------
html_show_sourcelink = False
html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}

html_theme_options = {

# Set the name of the project to appear in the navigation.
'nav_title': 'Python array API standard',

# Set you GA account ID to enable tracking
#'google_analytics_account': 'UA-XXXXX',

# Specify a base_url used to generate sitemap.xml. If not
# specified, then no sitemap will be built.
#'base_url': 'https://project.github.io/project',

# Set the color and the accent color (see
# https://material.io/design/color/the-color-system.html)
'color_primary': 'deep-purple',
'color_accent': 'cyan',

# Set the repo location to get a badge with stats
#'repo_url': 'https://github.com/project/project/',
#'repo_name': 'Project',

"html_minify": False,
"html_prettify": True,
"css_minify": True,
"logo_icon": "&#xe869",
"repo_type": "github",
"touch_icon": "images/apple-icon-152x152.png",
"theme_color": "#2196f3",
"master_doc": False,

# Visible levels of the global TOC; -1 means unlimited
'globaltoc_depth': 2,
# If False, expand all TOC entries
'globaltoc_collapse': True,
# If True, show hidden TOC entries
'globaltoc_includehidden': True,

"nav_links": [
{"href": "index", "internal": True, "title": "Array API standard"},
{
"href": "https://link-to-consortium-website",
"internal": False,
"title": "Consortium for Python Data API Standards",
},
],
"heroes": {
"index": "A common API for array and tensor Python libraries",
#"customization": "Configuration options to personalize your site.",
},

#"version_dropdown": True,
#"version_json": "_static/versions.json",
"table_classes": ["plain"],
}


todo_include_todos = True
#html_favicon = "images/favicon.ico"

html_use_index = True
html_domain_indices = True

extlinks = {
"duref": (
"http://docutils.sourceforge.net/docs/ref/rst/" "restructuredtext.html#%s",
"",
),
"durole": ("http://docutils.sourceforge.net/docs/ref/rst/" "roles.html#%s", ""),
"dudir": ("http://docutils.sourceforge.net/docs/ref/rst/" "directives.html#%s", ""),
}


# Enable eval_rst in markdown
def setup(app):
app.add_config_value(
"recommonmark_config",
{"enable_math": True, "enable_inline_math": True, "enable_eval_rst": True},
True,
)
app.add_transform(AutoStructify)
app.add_object_type(
"confval",
"confval",
objname="configuration value",
indextemplate="pair: %s; configuration value",
)
1 change: 1 addition & 0 deletions spec/design_topics/C_API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# C API
1 change: 1 addition & 0 deletions spec/design_topics/array_ducktyping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Array duck typing
4 changes: 4 additions & 0 deletions spec/design_topics/backwards_compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Backwards compatibility

This section discusses the impact on existing array and tensor libraries of
choices made in the API standard, and the trade-offs that went into them.
1 change: 1 addition & 0 deletions spec/design_topics/data_interchange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Data interchange mechanisms
1 change: 1 addition & 0 deletions spec/design_topics/eager_lazy_eval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Eager and lazy evaluation
16 changes: 16 additions & 0 deletions spec/design_topics/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Design topics & constraints
===========================

.. toctree::
:caption: Design topics & constraints
:maxdepth: 1

backwards_compatibility
eager_lazy_eval
parallelism
static_typing
array_ducktyping
data_interchange
missing_data
portability
C_API
1 change: 1 addition & 0 deletions spec/design_topics/missing_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Missing data
1 change: 1 addition & 0 deletions spec/design_topics/parallelism.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Parallelism
1 change: 1 addition & 0 deletions spec/design_topics/portability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Portability
1 change: 1 addition & 0 deletions spec/design_topics/static_typing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Static typing
13 changes: 13 additions & 0 deletions spec/future_API_evolution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Future API standard evolution

## Scope extensions



## Backwards compatibility



## Versioning


34 changes: 34 additions & 0 deletions spec/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. Python array API standard documentation master file, created by
sphinx-quickstart on Mon Jun 15 16:55:00 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Python array API standard
=========================

Contents
--------

.. toctree::
:caption: Context
:maxdepth: 1

purpose_and_scope
use_cases
assumptions

.. toctree::
:caption: API
:maxdepth: 1

design_topics/index
future_API_evolution
API_specification/index

.. toctree::
:caption: Methodology and Usage
:maxdepth: 1

usage_data
verification_test_suite
benchmark_suite
35 changes: 35 additions & 0 deletions spec/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
41 changes: 41 additions & 0 deletions spec/purpose_and_scope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Purpose and scope

## Introduction



## History



## Scope (includes out-of-scope / non-goals)



## Stakeholders




## High-level API overview




## How to read this document




## How to adopt this API




## Definitions




## References

Loading