Skip to content

Commit

Permalink
Make readthedocs fail if there's a warning building the docs (python-…
Browse files Browse the repository at this point in the history
…graphblas#361)

* Make readthedocs fail if there's a warning building the docs

* Fix `Vector.select`
  • Loading branch information
eriknw authored Jan 4, 2023
1 parent 704a81d commit ec2cad6
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions docs/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:


Expand Down
2 changes: 1 addition & 1 deletion docs/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions docs/user_guide/udf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies:
# - black
# - black-jupyter
# - codespell
# - commonmark
# - cython
# - cytoolz
# - distributed
Expand All @@ -70,6 +71,7 @@ dependencies:
# - jupyterlab
# - line_profiler
# - lxml
# - make
# - memory_profiler
# - netcdf4
# - networkit
Expand Down
3 changes: 1 addition & 2 deletions graphblas/core/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions graphblas/core/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ec2cad6

Please sign in to comment.