@@ -36,10 +36,6 @@ class Base(ABC):
3636 The relative tolerance to check against for accuracy.
3737 check_atol : float, optional
3838 The absolute tolerance to check against for accuracy.
39- accuracy_tol : float, optional
40- Relative accuracy tolerance.
41- .. deprecated:: 0.3.0
42- `accuracy_tol` will be removed in pymatsolver 0.4.0. Use `check_rtol` and `check_atol` instead.
4339 **kwargs
4440 Extra keyword arguments. If there are any left here a warning will be raised.
4541 """
@@ -50,7 +46,7 @@ class Base(ABC):
5046 _is_conjugate = False
5147
5248 def __init__ (
53- self , A , is_symmetric = None , is_positive_definite = False , is_hermitian = None , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , accuracy_tol = None , ** kwargs
49+ self , A , is_symmetric = None , is_positive_definite = False , is_hermitian = None , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , ** kwargs
5450 ):
5551 # don't make any assumptions on what A is, let the individual solvers handle that
5652 shape = A .shape
@@ -61,13 +57,8 @@ def __init__(
6157 self ._A = A
6258 self ._dtype = np .dtype (A .dtype )
6359
64- if accuracy_tol is not None :
65- warnings .warn (
66- "accuracy_tol is deprecated and will be removed in v0.4.0, use check_rtol and check_atol." ,
67- FutureWarning ,
68- stacklevel = 3
69- )
70- check_rtol = accuracy_tol
60+ if 'accuracy_tol' in kwargs :
61+ raise TypeError ("'accuracy_tol' was removed in v0.4.0, use 'check_rtol' and 'check_atol'." )
7162
7263 self .check_accuracy = check_accuracy
7364 self .check_rtol = check_rtol
@@ -341,14 +332,6 @@ def solve(self, rhs):
341332 rhs = rhs .conjugate ()
342333 x = self ._solve_single (rhs )
343334 else :
344- if ndim == 2 and rhs .shape [- 1 ] == 1 :
345- warnings .warn (
346- "In Future pymatsolver v0.4.0, passing a vector of shape (n, 1) to the solve method "
347- "will return an array with shape (n, 1), instead of always returning a flattened array. "
348- "This is to be consistent with numpy.linalg.solve broadcasting." ,
349- FutureWarning ,
350- stacklevel = 2
351- )
352335 if rhs .shape [- 2 ] != n :
353336 raise ValueError (f'Second to last dimension should be { n } , got { rhs .shape } ' )
354337 do_broadcast = rhs .ndim > 2
@@ -377,10 +360,6 @@ def solve(self, rhs):
377360 if self .check_accuracy :
378361 self ._compute_accuracy (rhs , x )
379362
380- #TODO remove this in v0.4.0.
381- if x .size == n :
382- x = x .reshape (- 1 )
383-
384363 if self ._is_conjugate :
385364 x = x .conjugate ()
386365 return x
@@ -449,15 +428,11 @@ class Diagonal(Base):
449428 The relative tolerance to check against for accuracy.
450429 check_atol : float, optional
451430 The absolute tolerance to check against for accuracy.
452- accuracy_tol : float, optional
453- Relative accuracy tolerance.
454- .. deprecated:: 0.3.0
455- `accuracy_tol` will be removed in pymatsolver 0.4.0. Use `check_rtol` and `check_atol` instead.
456431 **kwargs
457432 Extra keyword arguments passed to the base class.
458433 """
459434
460- def __init__ (self , A , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , accuracy_tol = None , ** kwargs ):
435+ def __init__ (self , A , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , ** kwargs ):
461436 try :
462437 self ._diagonal = np .asarray (A .diagonal ())
463438 if not np .all (self ._diagonal ):
@@ -469,7 +444,7 @@ def __init__(self, A, check_accuracy=False, check_rtol=1e-6, check_atol=0, accur
469444 is_hermitian = kwargs .pop ("is_hermitian" , None )
470445 is_positive_definite = kwargs .pop ("is_positive_definite" , None )
471446 super ().__init__ (
472- A , is_symmetric = True , is_hermitian = False , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , accuracy_tol = accuracy_tol , ** kwargs
447+ A , is_symmetric = True , is_hermitian = False , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , ** kwargs
473448 )
474449 if is_positive_definite is None :
475450 if self .is_real :
@@ -510,23 +485,19 @@ class Triangle(Base):
510485 The relative tolerance to check against for accuracy.
511486 check_atol : float, optional
512487 The absolute tolerance to check against for accuracy.
513- accuracy_tol : float, optional
514- Relative accuracy tolerance.
515- .. deprecated:: 0.3.0
516- `accuracy_tol` will be removed in pymatsolver 0.4.0. Use `check_rtol` and `check_atol` instead.
517488 **kwargs
518489 Extra keyword arguments passed to the base class.
519490 """
520491
521- def __init__ (self , A , lower = True , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , accuracy_tol = None , ** kwargs ):
492+ def __init__ (self , A , lower = True , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , ** kwargs ):
522493 # pop off unneeded keyword arguments.
523494 is_hermitian = kwargs .pop ("is_hermitian" , False )
524495 is_symmetric = kwargs .pop ("is_symmetric" , False )
525496 is_positive_definite = kwargs .pop ("is_positive_definite" , False )
526497 if not (sp .issparse (A ) and A .format in ['csr' , 'csc' ]):
527498 A = sp .csc_matrix (A )
528499 A .sum_duplicates ()
529- super ().__init__ (A , is_hermitian = is_hermitian , is_symmetric = is_symmetric , is_positive_definite = is_positive_definite , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , accuracy_tol = accuracy_tol , ** kwargs )
500+ super ().__init__ (A , is_hermitian = is_hermitian , is_symmetric = is_symmetric , is_positive_definite = is_positive_definite , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , ** kwargs )
530501
531502 self .lower = lower
532503
@@ -565,17 +536,13 @@ class Forward(Triangle):
565536 The relative tolerance to check against for accuracy.
566537 check_atol : float, optional
567538 The absolute tolerance to check against for accuracy.
568- accuracy_tol : float, optional
569- Relative accuracy tolerance.
570- .. deprecated:: 0.3.0
571- `accuracy_tol` will be removed in pymatsolver 0.4.0. Use `check_rtol` and `check_atol` instead.
572539 **kwargs
573540 Extra keyword arguments passed to the base class.
574541 """
575542
576- def __init__ (self , A , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , accuracy_tol = None , ** kwargs ):
543+ def __init__ (self , A , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , ** kwargs ):
577544 kwargs .pop ("lower" , None )
578- super ().__init__ (A , lower = True , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , accuracy_tol = accuracy_tol , ** kwargs )
545+ super ().__init__ (A , lower = True , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , ** kwargs )
579546
580547
581548class Backward (Triangle ):
@@ -591,19 +558,15 @@ class Backward(Triangle):
591558 The relative tolerance to check against for accuracy.
592559 check_atol : float, optional
593560 The absolute tolerance to check against for accuracy.
594- accuracy_tol : float, optional
595- Relative accuracy tolerance.
596- .. deprecated:: 0.3.0
597- `accuracy_tol` will be removed in pymatsolver 0.4.0. Use `check_rtol` and `check_atol` instead.
598561 **kwargs
599562 Extra keyword arguments passed to the base class.
600563 """
601564
602565 _transpose_class = Forward
603566
604- def __init__ (self , A , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , accuracy_tol = None , ** kwargs ):
567+ def __init__ (self , A , check_accuracy = False , check_rtol = 1e-6 , check_atol = 0 , ** kwargs ):
605568 kwargs .pop ("lower" , None )
606- super ().__init__ (A , lower = False , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , accuracy_tol = accuracy_tol , ** kwargs )
569+ super ().__init__ (A , lower = False , check_accuracy = check_accuracy , check_rtol = check_rtol , check_atol = check_atol , ** kwargs )
607570
608571
609572Forward ._transpose_class = Backward
0 commit comments