Skip to content

Commit

Permalink
Fixing sum for python < 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaem committed Aug 5, 2021
1 parent d505014 commit a3775b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
5 changes: 2 additions & 3 deletions shenfun/la.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def Solver(mats):
mat = mats
if isinstance(mats, list):
bc_mats = extract_bc_matrices([mats])
mat = sum(mats[1:], start=mats[0])
mat = sum(mats[1:], mats[0])
return mat.get_solver()([mat]+bc_mats)

class SparseMatrixSolver:
Expand All @@ -58,7 +58,7 @@ def __init__(self, mat):
self.bc_mats = []
if isinstance(mat, list):
bc_mats = extract_bc_matrices([mat])
mat = sum(mat[1:], start=mat[0])
mat = sum(mat[1:], mat[0])
self.bc_mats = bc_mats
self.mat = mat
self._lu = None
Expand Down Expand Up @@ -972,7 +972,6 @@ def apply_constraint(A, b, offset, i, constraint):
return A, b

row = offset + constraint[1]

assert isinstance(constraint, tuple)
assert len(constraint) == 3
val = constraint[2]
Expand Down
15 changes: 1 addition & 14 deletions shenfun/matrixbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def diags(self, it=(0,), format='csr'):
bm[-1].append(d)
return bmat(bm, format=format)

def solve(self, b, u=None, constraints=(), return_system=False, Alu=None, BM=None):
def solve(self, b, u=None, constraints=()):
r"""
Solve matrix system Au = b
Expand Down Expand Up @@ -971,19 +971,6 @@ def solve(self, b, u=None, constraints=(), return_system=False, Alu=None, BM=Non
explicit boundary condition, like the pure Chebyshev or Legendre
bases.
Other Parameters
----------------
return_system : bool, optional
If True then return the assembled block matrix as well as the
solution in a 2-tuple (solution, matrix). This is helpful for
repeated solves, because the returned matrix may then be
factorized once and reused.
Only for non-periodic problems
Alu : pre-factorized matrix, optional
Computed with Alu = splu(self), where self is the assembled block
matrix. Only for non-periodic problems.
"""
from .la import BlockMatrixSolver
sol = BlockMatrixSolver(self)
Expand Down

0 comments on commit a3775b8

Please sign in to comment.