diff --git a/docs/requirements.txt b/docs/requirements.txt index 6d655158..c33ee191 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ ipython<=8.6.0 # restrict for https://github.com/ipython/ipython/issues/13845 makefun multipledispatch -nbsphinx==0.8.1 +nbsphinx==0.8.9 numpy>=1.7 opt_einsum>=2.3.2 pytest>=4.1 diff --git a/docs/source/conf.py b/docs/source/conf.py index b85b7468..5ce45c34 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -90,7 +90,8 @@ # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".ipynb"] +# NOTE: `.rst` is the default suffix of sphinx, and nbsphinx will +# automatically add support for `.ipynb` suffix. # do not execute cells nbsphinx_execute = "never" @@ -106,7 +107,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/funsor/__init__.py b/funsor/__init__.py index adb0ae63..04561956 100644 --- a/funsor/__init__.py +++ b/funsor/__init__.py @@ -53,7 +53,7 @@ testing, ) -__version__ = "0.4.3" # mirrored in setup.py +__version__ = "0.4.4" # mirrored in setup.py __all__ = [ "__version__", diff --git a/funsor/testing.py b/funsor/testing.py index ece56145..f9fa86bb 100644 --- a/funsor/testing.py +++ b/funsor/testing.py @@ -245,7 +245,7 @@ def check_funsor(x, inputs, output, data=None): else: assert (x_data == data).all() else: - if get_backend() == "jax": + if get_backend() in ["jax", "numpy"]: # JAX has numerical errors for reducing ops. assert_close(x_data, data) else: diff --git a/setup.py b/setup.py index ab9d9a43..febb0993 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="funsor", - version="0.4.3", # mirrored in funsor/__init__.py + version="0.4.4", # mirrored in funsor/__init__.py description="A tensor-like library for functions and distributions", packages=find_packages(include=["funsor", "funsor.*"]), url="https://github.com/pyro-ppl/funsor", diff --git a/test/test_tensor.py b/test/test_tensor.py index 26d5efcf..c6e298a7 100644 --- a/test/test_tensor.py +++ b/test/test_tensor.py @@ -7,7 +7,7 @@ import pickle from collections import OrderedDict from functools import reduce -from typing import get_type_hints +from typing import Tuple, get_type_hints import numpy as np import pytest @@ -863,7 +863,7 @@ def max_and_argmax(x: Reals[8]) -> Product[Real, Bint[8]]: def test_function_nested_eager(): - @funsor.function(Reals[8], (Real, Bint[8])) + @funsor.function(Reals[8], Tuple[Real, Bint[8]]) def max_and_argmax(x): return tuple(_numeric_max_and_argmax(x)) @@ -879,7 +879,7 @@ def max_and_argmax(x): def test_function_nested_lazy(): - @funsor.function(Reals[8], (Real, Bint[8])) + @funsor.function(Reals[8], Tuple[Real, Bint[8]]) def max_and_argmax(x): return tuple(_numeric_max_and_argmax(x)) diff --git a/test/test_transpose.py b/test/test_transpose.py index bd5af145..8003ce8b 100644 --- a/test/test_transpose.py +++ b/test/test_transpose.py @@ -210,7 +210,8 @@ def test_tower_sum(height): assert transpose(top)[x] is Number(2.0**height) -@pytest.mark.parametrize("height", [0, 1, 2, 3, 10]) # , 100, 1000]) +# Note: we get overflow issue for height=10. +@pytest.mark.parametrize("height", [0, 1, 2, 3, 9]) # , 10, 100, 1000]) def test_tower_prod(height): x = random_tensor(OrderedDict(i=Bint[2], j=Bint[3])) with lazy: