Skip to content

Commit

Permalink
lint: remove unneeded else
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeolson committed Oct 31, 2023
1 parent 933ae02 commit fb27c0d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
9 changes: 4 additions & 5 deletions pyamg/krylov/_fgmres.py
Expand Up @@ -113,11 +113,10 @@ def fgmres(A, b, x0=None, tol=1e-5,
if restrt is not None:
if restart is not None:
raise ValueError('Only use restart, not restrt (deprecated).')
else:
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)

# Convert inputs to linear system, with error checking
A, M, x, b, postprocess = make_system(A, M, x0, b)
Expand Down
9 changes: 4 additions & 5 deletions pyamg/krylov/_gmres.py
Expand Up @@ -102,11 +102,10 @@ def gmres(A, b, x0=None, tol=1e-5, restart=None, maxiter=None,
if restrt is not None:
if restart is not None:
raise ValueError('Only use restart, not restrt (deprecated).')
else:
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)

# pass along **kwargs
if orthog == 'householder':
Expand Down
9 changes: 4 additions & 5 deletions pyamg/krylov/_gmres_householder.py
Expand Up @@ -111,11 +111,10 @@ def gmres_householder(A, b, x0=None, tol=1e-5,
if restrt is not None:
if restart is not None:
raise ValueError('Only use restart, not restrt (deprecated).')
else:
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)

# Convert inputs to linear system, with error checking
A, M, x, b, postprocess = make_system(A, M, x0, b)
Expand Down
9 changes: 4 additions & 5 deletions pyamg/krylov/_gmres_mgs.py
Expand Up @@ -133,11 +133,10 @@ def gmres_mgs(A, b, x0=None, tol=1e-5,
if restrt is not None:
if restart is not None:
raise ValueError('Only use restart, not restrt (deprecated).')
else:
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)
restart = restrt
msg = ('The keyword argument "restrt" is deprecated and will '
'be removed in 2024. Use "restart" instead.')
warnings.warn(msg, DeprecationWarning, stacklevel=1)

# Convert inputs to linear system, with error checking
A, M, x, b, postprocess = make_system(A, M, x0, b)
Expand Down

0 comments on commit fb27c0d

Please sign in to comment.