From ec2cad649133f26d849e56b11d6ff8b7b3362e88 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 4 Jan 2023 09:35:17 -0600 Subject: [PATCH] Make readthedocs fail if there's a warning building the docs (#361) * Make readthedocs fail if there's a warning building the docs * Fix `Vector.select` --- .readthedocs.yml | 1 + docs/api_reference/index.rst | 12 ++++++------ docs/env.yml | 2 +- docs/user_guide/udf.rst | 3 +-- environment.yml | 2 ++ graphblas/core/matrix.py | 3 +-- graphblas/core/vector.py | 3 +-- setup.cfg | 6 ++++++ 8 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 99c9f1781..18be4b7ee 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,6 +4,7 @@ version: 2 sphinx: configuration: docs/conf.py + fail_on_warning: True # Try to make build faster with mamba. See: # https://docs.readthedocs.io/en/stable/guides/conda.html#making-builds-faster-with-mamba diff --git a/docs/api_reference/index.rst b/docs/api_reference/index.rst index 01e0ca161..53ed902d9 100644 --- a/docs/api_reference/index.rst +++ b/docs/api_reference/index.rst @@ -34,37 +34,37 @@ Operators UnaryOp ~~~~~~~ -.. autoclass:: graphblas.operator.UnaryOp() +.. autoclass:: graphblas.core.operator.UnaryOp() :members: BinaryOp ~~~~~~~~ -.. autoclass:: graphblas.operator.BinaryOp() +.. autoclass:: graphblas.core.operator.BinaryOp() :members: Monoid ~~~~~~ -.. autoclass:: graphblas.operator.Monoid() +.. autoclass:: graphblas.core.operator.Monoid() :members: Semiring ~~~~~~~~ -.. autoclass:: graphblas.operator.Semiring() +.. autoclass:: graphblas.core.operator.Semiring() :members: IndexUnaryOp ~~~~~~~~~~~~ -.. autoclass:: graphblas.operator.IndexUnaryOp() +.. autoclass:: graphblas.core.operator.IndexUnaryOp() :members: SelectOp ~~~~~~~~ -.. autoclass:: graphblas.operator.SelectOp() +.. autoclass:: graphblas.core.operator.SelectOp() :members: diff --git a/docs/env.yml b/docs/env.yml index efe0145bd..7bc373c06 100644 --- a/docs/env.yml +++ b/docs/env.yml @@ -8,7 +8,7 @@ dependencies: # python-graphblas dependencies - donfig - numba - - python-suitesparse-graphblas>=7.3.2.0 + - python-suitesparse-graphblas>=7.4.0.0 - pyyaml # extra dependencies - matplotlib diff --git a/docs/user_guide/udf.rst b/docs/user_guide/udf.rst index 8ee3cefbf..6c72535fc 100644 --- a/docs/user_guide/udf.rst +++ b/docs/user_guide/udf.rst @@ -15,14 +15,13 @@ Example user-defined UnaryOp: .. code-block:: python from graphblas import unary - from graphblas.operator import UnaryOp def force_odd_func(x): if x % 2 == 0: return x + 1 return x - UnaryOp.register_new('force_odd', force_odd_func) + unary.register_new('force_odd', force_odd_func) v = Vector.from_coo([0, 1, 3, 4, 5], [1, 2, 3, 8, 14]) w = v.apply(unary.force_odd).new() diff --git a/environment.yml b/environment.yml index 4888fb691..ff1ba1351 100644 --- a/environment.yml +++ b/environment.yml @@ -50,6 +50,7 @@ dependencies: # - black # - black-jupyter # - codespell + # - commonmark # - cython # - cytoolz # - distributed @@ -70,6 +71,7 @@ dependencies: # - jupyterlab # - line_profiler # - lxml + # - make # - memory_profiler # - netcdf4 # - networkit diff --git a/graphblas/core/matrix.py b/graphblas/core/matrix.py index 5e17434f3..c5bf3b3f9 100644 --- a/graphblas/core/matrix.py +++ b/graphblas/core/matrix.py @@ -2118,8 +2118,7 @@ def select(self, op, thunk=None): Parameters ---------- - op : :class:`~graphblas.core.operator.SelectOp`or - :class:`~graphblas.core.operator.IndexUnaryOp` + op : :class:`~graphblas.core.operator.SelectOp` Operator to apply thunk : Scalar passed to operator diff --git a/graphblas/core/vector.py b/graphblas/core/vector.py index 0995aa78b..aafd78e89 100644 --- a/graphblas/core/vector.py +++ b/graphblas/core/vector.py @@ -1239,8 +1239,7 @@ def select(self, op, thunk=None): Parameters ---------- - op : :class:`~graphblas.core.operator.SelectOp` or - :class:`~graphblas.core.operator.IndexUnaryOp` + op : :class:`~graphblas.core.operator.SelectOp` Operator to apply thunk : Scalar passed to operator diff --git a/setup.cfg b/setup.cfg index 58be47bd1..f103bdd3d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,3 +55,9 @@ precision = 1 fail_under = 0 skip_covered = True skip_empty = True + +[build_sphinx] +all-files = 1 +source-dir = docs +build-dir = docs/_build +warning-is-error = 1