Skip to content

Fixes several issues that broke the testing workflow #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spatialmath/base/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,9 +1394,9 @@ def plot_cuboid(
edges = [[0, 1, 3, 2, 0], [4, 5, 7, 6, 4], [0, 4], [1, 5], [3, 7], [2, 6]]
lines = []
for edge in edges:
E = vertices[:, edge]
# ax.plot(E[0], E[1], E[2], **kwargs)
lines.append(E.T)
for line in zip(edge[:-1], edge[1:]):
E = vertices[:, line]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I learn new weird Python hacks every time I read stuff like this.

lines.append(E.T)
if "color" in kwargs:
if "alpha" in kwargs:
alpha = kwargs["alpha"]
Expand Down
10 changes: 5 additions & 5 deletions tests/base/test_symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,26 @@ def test_functions(self):
self.assertTrue(isinstance(sqrt(1.0), float))

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

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

x = zero()
self.assertTrue(isinstance(x, sp.Expr))
self.assertEqual(x.evalf(), 0)
self.assertTrue(math.isclose(x.evalf(), 0))

x = one()
self.assertTrue(isinstance(x, sp.Expr))
self.assertEqual(x.evalf(), 1)
self.assertTrue(math.isclose(x.evalf(), 1))

x = negative_one()
self.assertTrue(isinstance(x, sp.Expr))
self.assertEqual(x.evalf(), -1)
self.assertTrue(math.isclose(x.evalf(), -1))

x = pi()
self.assertTrue(isinstance(x, sp.Expr))
self.assertEqual(x.evalf(), math.pi)
self.assertTrue(math.isclose(x.evalf(), math.pi))


# ---------------------------------------------------------------------------------------#
Expand Down
Loading