Skip to content
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
Expand Up @@ -70,6 +70,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/generated/

# PyBuilder
target/
Expand Down
23 changes: 23 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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)

clean:
rm -rf $(BUILDDIR) generated

.PHONY: help clean 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)
13 changes: 13 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ fullname }}
{{ underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
.. rubric:: Methods
{% for item in methods %}
.. automethod:: {{ item }}
{%- endfor %}
{% endblock %}
56 changes: 56 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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('../atcoder'))


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

project = 'ac-library-python'
copyright = '2020, Naoto Mizuno'
author = 'Naoto Mizuno'


# -- 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 = ['sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
]

autosummary_generate = True

# 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.
#
html_theme = 'sphinx_rtd_theme'

# 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']
9 changes: 9 additions & 0 deletions docs/convolution.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Convolution
===========

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.convolution.convolution
atcoder.convolution.convolution_int
8 changes: 8 additions & 0 deletions docs/dsu.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Disjoint Union Set
==================

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.dsu.DSU
8 changes: 8 additions & 0 deletions docs/fenwicktree.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Fenwick Tree
============

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.fenwicktree.FenwickTree
38 changes: 38 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

ac-library-python: Python port of AtCoder Library.
==================================================

.. toctree::
:maxdepth: 1
:caption: Data Structures:

fenwicktree
segtree
lazysegtree
string

.. toctree::
:maxdepth: 1
:caption: Math:

math
convolution
modint

.. toctree::
:maxdepth: 1
:caption: Graphs:

dsu
maxflow
mincostflow
scc
twosat


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
8 changes: 8 additions & 0 deletions docs/lazysegtree.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Lazy Segment Tree
=================

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.lazysegtree.LazySegTree
35 changes: 35 additions & 0 deletions docs/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
14 changes: 14 additions & 0 deletions docs/math.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Math
====

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.math.inv_mod
atcoder.math.crt
atcoder.math.floor_sum

Note
----
``atcoder.math.pow_mod`` is not implemented. Use ``pow(x, n, m)`` instead of it.
8 changes: 8 additions & 0 deletions docs/maxflow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Maximum Flow
============

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.maxflow.MFGraph
8 changes: 8 additions & 0 deletions docs/mincostflow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Minimum-Cost Flow
=================

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.mincostflow.MCFGraph
8 changes: 8 additions & 0 deletions docs/modint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Modint
======

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.modint.Modint
8 changes: 8 additions & 0 deletions docs/scc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Strongly Connected Components
=============================

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.scc.SCCGraph
8 changes: 8 additions & 0 deletions docs/segtree.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Segment Tree
============

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.segtree.SegTree
10 changes: 10 additions & 0 deletions docs/string.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
String Algorithms
=================

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.string.suffix_array
atcoder.string.lcp_array
atcoder.string.z_algorithm
8 changes: 8 additions & 0 deletions docs/twosat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
2-SAT
=====

.. autosummary::
:toctree: generated/
:nosignatures:

atcoder.twosat.TwoSAT
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ lint =
pep8-naming
mypy
test = pytest
docs =
sphinx
sphinx_rtd_theme

[mypy]
disallow_untyped_defs = True
Expand Down