mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Add more ruff rules (#8767)
* Add more ruff rules * Add more ruff rules * pre-commit: Update ruff v0.0.269 -> v0.0.270 * Apply suggestions from code review * Fix doctest * Fix doctest (ignore whitespace) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -31,16 +31,18 @@ def schur_complement(
|
||||
shape_c = np.shape(mat_c)
|
||||
|
||||
if shape_a[0] != shape_b[0]:
|
||||
raise ValueError(
|
||||
f"Expected the same number of rows for A and B. \
|
||||
Instead found A of size {shape_a} and B of size {shape_b}"
|
||||
msg = (
|
||||
"Expected the same number of rows for A and B. "
|
||||
f"Instead found A of size {shape_a} and B of size {shape_b}"
|
||||
)
|
||||
raise ValueError(msg)
|
||||
|
||||
if shape_b[1] != shape_c[1]:
|
||||
raise ValueError(
|
||||
f"Expected the same number of columns for B and C. \
|
||||
Instead found B of size {shape_b} and C of size {shape_c}"
|
||||
msg = (
|
||||
"Expected the same number of columns for B and C. "
|
||||
f"Instead found B of size {shape_b} and C of size {shape_c}"
|
||||
)
|
||||
raise ValueError(msg)
|
||||
|
||||
a_inv = pseudo_inv
|
||||
if a_inv is None:
|
||||
|
Reference in New Issue
Block a user