Skip to content

Commit 7ec1f97

Browse files
committed
refactor (reduce pylint issues)
1 parent 4d3b926 commit 7ec1f97

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/nerte/geometry/geometry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from abc import ABC, abstractmethod
44

55
from nerte.geometry.coordinates import Coordinates
6-
from nerte.geometry.vector import AbstractVector, dot, cross, length, normalized
6+
from nerte.geometry.vector import AbstractVector, dot, cross, normalized
77
from nerte.geometry.face import Face
88
from nerte.geometry.ray import Ray
99

src/nerte/geometry/vector_unittest.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
# equivalence of floating point representations with finite precision
1414
𝜀 = 1e-8
1515
# True, iff two floats agree up to the (absolute) precision 𝜀
16-
def equiv(x: float, y: float) -> bool:
16+
def _equiv(x: float, y: float) -> bool:
1717
return abs(x - y) < 𝜀
1818

1919

2020
# True, iff two vectors component-wise agree up to the (absolute) precision 𝜀
21-
def vec_equiv(x: AbstractVector, y: AbstractVector) -> bool:
22-
return equiv(x[0], y[0]) and equiv(x[1], y[1]) and equiv(x[2], y[2])
21+
def _vec_equiv(x: AbstractVector, y: AbstractVector) -> bool:
22+
return _equiv(x[0], y[0]) and _equiv(x[1], y[1]) and _equiv(x[2], y[2])
2323

2424

2525
# standart Carthesian basis
@@ -40,7 +40,7 @@ def assertEquiv(self, x: float, y: float) -> None:
4040
Note: This replaces assertTrue(x == y) for float.
4141
"""
4242
try:
43-
self.assertTrue(equiv(x, y))
43+
self.assertTrue(_equiv(x, y))
4444
except AssertionError as ae:
4545
raise AssertionError(
4646
"Scalar {} is not equivalent to {}.".format(x, y)
@@ -52,7 +52,7 @@ def assertVectorEquiv(self, x: AbstractVector, y: AbstractVector) -> None:
5252
Note: This replaces assertTrue(x == y) for nerte.Vector.
5353
"""
5454
try:
55-
self.assertTrue(vec_equiv(x, y))
55+
self.assertTrue(_vec_equiv(x, y))
5656
except AssertionError as ae:
5757
raise AssertionError(
5858
"Vector {} is not equivalent to {}.".format(x, y)

0 commit comments

Comments
 (0)