Skip to content
Snippets Groups Projects
Commit 154c3de1 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

tooling: black & isort → ruff

parent 96c516ae
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ has-binaries = false ...@@ -17,6 +17,7 @@ has-binaries = false
extend-exclude = ["cmake"] extend-exclude = ["cmake"]
[tool.ruff.lint] [tool.ruff.lint]
extend-ignore = ["RUF012"]
extend-select = ["I", "NPY", "RUF", "UP", "W"] extend-select = ["I", "NPY", "RUF", "UP", "W"]
[tool.tomlsort] [tool.tomlsort]
......
...@@ -125,10 +125,9 @@ def convex_hull_ineq(pts, cData=None, ineqFromCdata=None, gX=None, g=None, w=Non ...@@ -125,10 +125,9 @@ def convex_hull_ineq(pts, cData=None, ineqFromCdata=None, gX=None, g=None, w=Non
error = False error = False
for pt in allpts: for pt in allpts:
print("pt ", pt) print("pt ", pt)
assert ( assert (resA.dot(pt.reshape((-1, 1))) - resb).max() < 0.001, (
resA.dot(pt.reshape((-1, 1))) - resb "antecedent point not in End polytope"
).max() < 0.001, "antecedent point not in End polytope" + str( + str((resA.dot(pt.reshape((-1, 1))) - resb).max())
(resA.dot(pt.reshape((-1, 1))) - resb).max()
) )
if (H.dot(w(m, pt).reshape((-1, 1))) - h).max() > 0.001: if (H.dot(w(m, pt).reshape((-1, 1))) - h).max() > 0.001:
error = True error = True
......
...@@ -108,7 +108,7 @@ def ineq_to_file(ineq, filename): ...@@ -108,7 +108,7 @@ def ineq_to_file(ineq, filename):
def ineq_from_file(filename): def ineq_from_file(filename):
f1 = open(filename, "r") f1 = open(filename)
res = load(f1) res = load(f1)
return Inequalities(res["A"], res["b"], res["N"], res["V"]) return Inequalities(res["A"], res["b"], res["N"], res["V"])
...@@ -158,8 +158,8 @@ def test_rotate_inequalities(): ...@@ -158,8 +158,8 @@ def test_rotate_inequalities():
data = __gen_data() data = __gen_data()
ineq = rotate_inequalities(data[1], tr) ineq = rotate_inequalities(data[1], tr)
ok_points = [tr.dot(np.array(el + [1]))[0:3] for el in data[2]] ok_points = [tr.dot(np.array([*el, 1]))[0:3] for el in data[2]]
not_ok_points = [tr.dot(np.array(el + [1]))[0:3] for el in data[3]] not_ok_points = [tr.dot(np.array([*el, 1]))[0:3] for el in data[3]]
for p in ok_points: for p in ok_points:
assert is_inside(ineq, p), "point " + str(p) + " should be inside object" assert is_inside(ineq, p), "point " + str(p) + " should be inside object"
for p in not_ok_points: for p in not_ok_points:
......
...@@ -19,7 +19,7 @@ import numpy as np ...@@ -19,7 +19,7 @@ import numpy as np
from numpy import linalg from numpy import linalg
class Quaternion(object): class Quaternion:
""" """
Quaternion class : Quaternion class :
------------------ ------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment