Skip to content

Commit b5a1de5

Browse files
committed
Merge branch 'main' into volmesh-query
2 parents 80c68b6 + 5c7b7ad commit b5a1de5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import math
44
import numpy
55

6+
from compas.geometry import allclose
7+
68

79
def pytest_ignore_collect(path):
810
if "rhino" in str(path):
@@ -34,3 +36,8 @@ def add_math(doctest_namespace):
3436
@pytest.fixture(autouse=True)
3537
def add_np(doctest_namespace):
3638
doctest_namespace["np"] = numpy
39+
40+
41+
@pytest.fixture(autouse=True)
42+
def add_allclose(doctest_namespace):
43+
doctest_namespace["allclose"] = allclose

src/compas/numerical/linalg.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,9 @@ def spsolve_with_known(A, b, x, known):
708708
>>> A = array([[2, 1, 3], [2, 6, 8], [6, 8, 18]])
709709
>>> b = array([[1], [3], [5]])
710710
>>> x = array([[0.3], [0], [0]])
711-
>>> solve_with_known(A, b, x, [0])
712-
array([[ 3.00000000e-01],
713-
[ 4.00000000e-01],
714-
[-6.66247443e-17]])
711+
>>> x = solve_with_known(A, b, x, [0])
712+
>>> allclose(x, array([[0.3], [0.4], [0.0]]))
713+
True
715714
716715
"""
717716
unknown = list(set(range(x.shape[0])) - set(known))

0 commit comments

Comments
 (0)