Skip to content

Commit 53c0ee1

Browse files
authored
Fixes several issues that broke the testing workflow (#132)
1 parent 6074eb7 commit 53c0ee1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

spatialmath/base/graphics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,9 +1394,9 @@ def plot_cuboid(
13941394
edges = [[0, 1, 3, 2, 0], [4, 5, 7, 6, 4], [0, 4], [1, 5], [3, 7], [2, 6]]
13951395
lines = []
13961396
for edge in edges:
1397-
E = vertices[:, edge]
1398-
# ax.plot(E[0], E[1], E[2], **kwargs)
1399-
lines.append(E.T)
1397+
for line in zip(edge[:-1], edge[1:]):
1398+
E = vertices[:, line]
1399+
lines.append(E.T)
14001400
if "color" in kwargs:
14011401
if "alpha" in kwargs:
14021402
alpha = kwargs["alpha"]

tests/base/test_symbolic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,26 @@ def test_functions(self):
5858
self.assertTrue(isinstance(sqrt(1.0), float))
5959

6060
x = (theta - 1) * (theta + 1) - theta ** 2
61-
self.assertEqual(simplify(x).evalf(), -1)
61+
self.assertTrue(math.isclose(simplify(x).evalf(), -1))
6262

6363
@unittest.skipUnless(_symbolics, "sympy required")
6464
def test_constants(self):
6565

6666
x = zero()
6767
self.assertTrue(isinstance(x, sp.Expr))
68-
self.assertEqual(x.evalf(), 0)
68+
self.assertTrue(math.isclose(x.evalf(), 0))
6969

7070
x = one()
7171
self.assertTrue(isinstance(x, sp.Expr))
72-
self.assertEqual(x.evalf(), 1)
72+
self.assertTrue(math.isclose(x.evalf(), 1))
7373

7474
x = negative_one()
7575
self.assertTrue(isinstance(x, sp.Expr))
76-
self.assertEqual(x.evalf(), -1)
76+
self.assertTrue(math.isclose(x.evalf(), -1))
7777

7878
x = pi()
7979
self.assertTrue(isinstance(x, sp.Expr))
80-
self.assertEqual(x.evalf(), math.pi)
80+
self.assertTrue(math.isclose(x.evalf(), math.pi))
8181

8282

8383
# ---------------------------------------------------------------------------------------#

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy