Skip to content

Commit 44b1bcc

Browse files
Fix failing tests from ruff/newton_raphson (ignore S307 "possibly insecure function") (#8862)
* chore: Fix failing tests (ignore S307 "possibly insecure function") * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: Move noqa back to right line --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a0eec90 commit 44b1bcc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: arithmetic_analysis/newton_raphson.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ def newton_raphson(
2525
"""
2626
x = a
2727
while True:
28-
x = Decimal(x) - (Decimal(eval(func)) / Decimal(eval(str(diff(func)))))
28+
x = Decimal(x) - (
29+
Decimal(eval(func)) / Decimal(eval(str(diff(func)))) # noqa: S307
30+
)
2931
# This number dictates the accuracy of the answer
30-
if abs(eval(func)) < precision:
32+
if abs(eval(func)) < precision: # noqa: S307
3133
return float(x)
3234

3335

0 commit comments

Comments
 (0)