Skip to content

Commit 3bc3113

Browse files
authored
Bump to version 0.4.4 (#602)
* Bump to version 0.4.4 * Attempt to make docs build pass * Address numerical issues
1 parent 0294f5e commit 3bc3113

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ipython<=8.6.0 # restrict for https://github.com/ipython/ipython/issues/13845
22
makefun
33
multipledispatch
4-
nbsphinx==0.8.1
4+
nbsphinx==0.8.9
55
numpy>=1.7
66
opt_einsum>=2.3.2
77
pytest>=4.1

docs/source/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090
# You can specify multiple suffix as a list of string:
9191
#
9292
# source_suffix = ['.rst', '.md']
93-
source_suffix = [".rst", ".ipynb"]
93+
# NOTE: `.rst` is the default suffix of sphinx, and nbsphinx will
94+
# automatically add support for `.ipynb` suffix.
9495

9596
# do not execute cells
9697
nbsphinx_execute = "never"
@@ -106,7 +107,7 @@
106107
#
107108
# This is also used if you do content translation via gettext catalogs.
108109
# Usually you set "language" from the command line for these cases.
109-
language = None
110+
language = "en"
110111

111112
# List of patterns, relative to source directory, that match files and
112113
# directories to ignore when looking for source files.

funsor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
testing,
5454
)
5555

56-
__version__ = "0.4.3" # mirrored in setup.py
56+
__version__ = "0.4.4" # mirrored in setup.py
5757

5858
__all__ = [
5959
"__version__",

funsor/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def check_funsor(x, inputs, output, data=None):
245245
else:
246246
assert (x_data == data).all()
247247
else:
248-
if get_backend() == "jax":
248+
if get_backend() in ["jax", "numpy"]:
249249
# JAX has numerical errors for reducing ops.
250250
assert_close(x_data, data)
251251
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
setup(
2525
name="funsor",
26-
version="0.4.3", # mirrored in funsor/__init__.py
26+
version="0.4.4", # mirrored in funsor/__init__.py
2727
description="A tensor-like library for functions and distributions",
2828
packages=find_packages(include=["funsor", "funsor.*"]),
2929
url="https://github.com/pyro-ppl/funsor",

test/test_tensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pickle
88
from collections import OrderedDict
99
from functools import reduce
10-
from typing import get_type_hints
10+
from typing import Tuple, get_type_hints
1111

1212
import numpy as np
1313
import pytest
@@ -863,7 +863,7 @@ def max_and_argmax(x: Reals[8]) -> Product[Real, Bint[8]]:
863863

864864

865865
def test_function_nested_eager():
866-
@funsor.function(Reals[8], (Real, Bint[8]))
866+
@funsor.function(Reals[8], Tuple[Real, Bint[8]])
867867
def max_and_argmax(x):
868868
return tuple(_numeric_max_and_argmax(x))
869869

@@ -879,7 +879,7 @@ def max_and_argmax(x):
879879

880880

881881
def test_function_nested_lazy():
882-
@funsor.function(Reals[8], (Real, Bint[8]))
882+
@funsor.function(Reals[8], Tuple[Real, Bint[8]])
883883
def max_and_argmax(x):
884884
return tuple(_numeric_max_and_argmax(x))
885885

test/test_transpose.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ def test_tower_sum(height):
210210
assert transpose(top)[x] is Number(2.0**height)
211211

212212

213-
@pytest.mark.parametrize("height", [0, 1, 2, 3, 10]) # , 100, 1000])
213+
# Note: we get overflow issue for height=10.
214+
@pytest.mark.parametrize("height", [0, 1, 2, 3, 9]) # , 10, 100, 1000])
214215
def test_tower_prod(height):
215216
x = random_tensor(OrderedDict(i=Bint[2], j=Bint[3]))
216217
with lazy:

0 commit comments

Comments
 (0)