Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e2d44b1

Browse filesBrowse files
Fix ci tests (bdaiinstitute#96)
Co-authored-by: Andrew Messing <amessing@theaiinstitute.com>
1 parent 8e1080c commit e2d44b1
Copy full SHA for e2d44b1

File tree

Expand file treeCollapse file tree

11 files changed

+87
-18
lines changed
Filter options
Expand file treeCollapse file tree

11 files changed

+87
-18
lines changed

‎.github/workflows/master.yml

Copy file name to clipboardExpand all lines: .github/workflows/master.yml
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [windows-latest, ubuntu-latest, macos-latest]
20-
# python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
21-
python-version: [3.7, 3.8, 3.9, 3.11]
20+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
2221

2322
steps:
2423
- uses: actions/checkout@v2

‎pyproject.toml

Copy file name to clipboardExpand all lines: pyproject.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies = [
4646
"Homepage" = "https://github.com/petercorke/spatialmath-python"
4747
"Bug Tracker" = "https://github.com/petercorke/spatialmath-python/issues"
4848
"Documentation" = "https://petercorke.github.io/petercorke/spatialmath-python"
49-
"Source" = "https://github.com/petercorke/petercorke/spatialmath-python"
49+
"Source" = "https://github.com/petercorke/spatialmath-python"
5050

5151
[project.optional-dependencies]
5252

‎tests/base/test_graphics.py

Copy file name to clipboardExpand all lines: tests/base/test_graphics.py
+41Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import unittest
22
import numpy as np
33
import matplotlib.pyplot as plt
4+
import pytest
5+
import sys
46
from spatialmath.base import *
57

68
# test graphics primitives
@@ -11,22 +13,37 @@ class TestGraphics(unittest.TestCase):
1113
def teardown_method(self, method):
1214
plt.close("all")
1315

16+
@pytest.mark.skipif(
17+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
18+
)
1419
def test_plotvol2(self):
1520
plotvol2(5)
1621

22+
@pytest.mark.skipif(
23+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
24+
)
1725
def test_plotvol3(self):
1826
plotvol3(5)
1927

28+
@pytest.mark.skipif(
29+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
30+
)
2031
def test_plot_point(self):
2132
plot_point((2, 3))
2233
plot_point(np.r_[2, 3])
2334
plot_point((2, 3), "x")
2435
plot_point((2, 3), "x", text="foo")
2536

37+
@pytest.mark.skipif(
38+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
39+
)
2640
def test_plot_text(self):
2741
plot_text((2, 3), "foo")
2842
plot_text(np.r_[2, 3], "foo")
2943

44+
@pytest.mark.skipif(
45+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
46+
)
3047
def test_plot_box(self):
3148
plot_box("r--", centre=(-2, -3), wh=(1, 1))
3249
plot_box(lt=(1, 1), rb=(2, 0), filled=True, color="b")
@@ -36,38 +53,59 @@ def test_plot_box(self):
3653
plot_box(lbwh=(1, 2, 3, 4))
3754
plot_box(centre=(1, 2), wh=(2, 3))
3855

56+
@pytest.mark.skipif(
57+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
58+
)
3959
def test_plot_circle(self):
4060
plot_circle(1, (0, 0), "r") # red circle
4161
plot_circle(2, (0, 0), "b--") # blue dashed circle
4262
plot_circle(0.5, (0, 0), filled=True, color="y") # yellow filled circle
4363

64+
@pytest.mark.skipif(
65+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
66+
)
4467
def test_ellipse(self):
4568
plot_ellipse(np.diag((1, 2)), (0, 0), "r") # red ellipse
4669
plot_ellipse(np.diag((1, 2)), (0, 0), "b--") # blue dashed ellipse
4770
plot_ellipse(
4871
np.diag((1, 2)), centre=(1, 1), filled=True, color="y"
4972
) # yellow filled ellipse
5073

74+
@pytest.mark.skipif(
75+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
76+
)
5177
def test_plot_homline(self):
5278
plot_homline((1, 2, 3))
5379
plot_homline((2, 1, 3))
5480
plot_homline((1, -2, 3), "k--")
5581

82+
@pytest.mark.skipif(
83+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
84+
)
5685
def test_cuboid(self):
5786
plot_cuboid((1, 2, 3), color="g")
5887
plot_cuboid((1, 2, 3), centre=(2, 3, 4), color="g")
5988
plot_cuboid((1, 2, 3), filled=True, color="y")
6089

90+
@pytest.mark.skipif(
91+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
92+
)
6193
def test_sphere(self):
6294
plot_sphere(0.3, color="r")
6395
plot_sphere(1, centre=(1, 1, 1), filled=True, color="b")
6496

97+
@pytest.mark.skipif(
98+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
99+
)
65100
def test_ellipsoid(self):
66101
plot_ellipsoid(np.diag((1, 2, 3)), color="r") # red ellipsoid
67102
plot_ellipsoid(
68103
np.diag((1, 2, 3)), centre=(1, 2, 3), filled=True, color="y"
69104
) # yellow filled ellipsoid
70105

106+
@pytest.mark.skipif(
107+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
108+
)
71109
def test_cylinder(self):
72110
plot_cylinder(radius=0.2, centre=(0.5, 0.5, 0), height=[-0.2, 0.2])
73111
plot_cylinder(
@@ -79,6 +117,9 @@ def test_cylinder(self):
79117
color="red",
80118
)
81119

120+
@pytest.mark.skipif(
121+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
122+
)
82123
def test_cone(self):
83124
plot_cone(radius=0.2, centre=(0.5, 0.5, 0), height=0.3)
84125
plot_cone(

‎tests/base/test_transforms2d.py

Copy file name to clipboardExpand all lines: tests/base/test_transforms2d.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from math import pi
1414
import math
1515
from scipy.linalg import logm, expm
16+
import pytest
17+
import sys
1618

1719
from spatialmath.base.transforms2d import *
1820
from spatialmath.base.transformsNd import (
@@ -259,6 +261,9 @@ def test_trinterp2(self):
259261
trinterp2(start=None, end=T1, s=0.5), xyt2tr([0.5, 1, 0.15])
260262
)
261263

264+
@pytest.mark.skipif(
265+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
266+
)
262267
def test_plot(self):
263268
plt.figure()
264269
trplot2(transl2(1, 2), block=False, frame="A", rviz=True, width=1)

‎tests/base/test_transforms3d.py

Copy file name to clipboardExpand all lines: tests/base/test_transforms3d.py
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -514,20 +514,19 @@ def test_tr2angvec(self):
514514
eps = 1e-08
515515

516516
# show that tr2angvec works on true rotation matrix
517-
R = SO3.Ry(true_ang)
518-
ang, vec = t3d.tr2angvec(R.A, check=True)
519-
nt.assert_equal(ang, true_ang)
520-
nt.assert_equal(vec, true_vec)
517+
ang, vec = tr2angvec(roty(true_ang), check=True)
518+
nt.assert_almost_equal(ang, true_ang)
519+
nt.assert_almost_equal(vec, true_vec)
521520

522521
# check a rotation matrix that should fail
523-
badR = SO3.Ry(true_ang).A[:, :] + eps
522+
badR = roty(true_ang) + eps
524523
with self.assertRaises(ValueError):
525-
t3d.tr2angvec(badR, check=True)
524+
tr2angvec(badR, check=True)
526525

527526
# run without check
528-
ang, vec = t3d.tr2angvec(badR, check=False)
527+
ang, vec = tr2angvec(badR, check=False)
529528
nt.assert_almost_equal(ang, true_ang)
530-
nt.assert_equal(vec, true_vec)
529+
nt.assert_almost_equal(vec, true_vec)
531530

532531
def test_print(self):
533532
R = rotx(0.3) @ roty(0.4)

‎tests/base/test_transforms3d_plot.py

Copy file name to clipboardExpand all lines: tests/base/test_transforms3d_plot.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from math import pi
1515
import math
1616
from scipy.linalg import logm, expm
17+
import pytest
18+
import sys
1719

1820
from spatialmath.base.transforms3d import *
1921
from spatialmath.base.transformsNd import isR, t2r, r2t, rt2tr
@@ -22,6 +24,9 @@
2224

2325

2426
class Test3D(unittest.TestCase):
27+
@pytest.mark.skipif(
28+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
29+
)
2530
def test_plot(self):
2631
plt.figure()
2732
# test options
@@ -65,6 +70,9 @@ def test_plot(self):
6570

6671
plt.close("all")
6772

73+
@pytest.mark.skipif(
74+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
75+
)
6876
def test_animate(self):
6977
tranimate(transl(1, 2, 3), repeat=False, wait=True)
7078

‎tests/test_geom2d.py

Copy file name to clipboardExpand all lines: tests/test_geom2d.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from spatialmath.pose2d import SE2
1111

1212
import unittest
13+
import pytest
14+
import sys
1315
import numpy.testing as nt
1416
import spatialmath.base as smb
1517

@@ -85,6 +87,9 @@ def test_intersect_line(self):
8587
l = Line2.Join((-10, 1.1), (10, 1.1))
8688
self.assertFalse(p.intersects(l))
8789

90+
@pytest.mark.skipif(
91+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
92+
)
8893
def test_plot(self):
8994
p = Polygon2(np.array([[-1, 1, 1, -1], [-1, -1, 1, 1]]))
9095
p.plot()

‎tests/test_geom3d.py

Copy file name to clipboardExpand all lines: tests/test_geom3d.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import unittest
1313
import numpy.testing as nt
1414
import spatialmath.base as base
15+
import pytest
16+
import sys
1517

1618

1719
class Line3Test(unittest.TestCase):
@@ -123,6 +125,9 @@ def test_closest(self):
123125
nt.assert_array_almost_equal(p, [5, 1, 2])
124126
self.assertAlmostEqual(d, 2)
125127

128+
@pytest.mark.skipif(
129+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
130+
)
126131
def test_plot(self):
127132
P = [2, 3, 7]
128133
Q = [2, 1, 0]

‎tests/test_pose2d.py

Copy file name to clipboardExpand all lines: tests/test_pose2d.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import numpy.testing as nt
22
import matplotlib.pyplot as plt
33
import unittest
4+
import sys
5+
import pytest
46

57
"""
68
we will assume that the primitives rotx,trotx, etc. all work
@@ -227,6 +229,7 @@ def test_printline(self):
227229
# self.assertIsInstance(s, str)
228230
# self.assertEqual(s.count('\n'), 2)
229231

232+
@pytest.mark.skipif(sys.platform.startswith("darwin"), reason="tkinter bug with mac")
230233
def test_plot(self):
231234
plt.close('all')
232235

@@ -493,12 +496,16 @@ def test_display(self):
493496

494497
T1.printline()
495498

499+
@pytest.mark.skipif(
500+
sys.platform.startswith("darwin"), reason="tkinter bug with mac"
501+
)
496502
def test_graphics(self):
497503

498504
plt.close('all')
499505
T1 = SE2.Rand()
500506
T2 = SE2.Rand()
501507

508+
502509
T1.plot(block=False, dims=[-2,2])
503510

504511
T1.animate(repeat=False, dims=[-2,2], nframes=10)

‎tests/test_pose3d.py

Copy file name to clipboardExpand all lines: tests/test_pose3d.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import numpy.testing as nt
22
import matplotlib.pyplot as plt
33
import unittest
4+
import sys
5+
import pytest
46

57
"""
68
we will assume that the primitives rotx,trotx, etc. all work
79
"""
810
from math import pi
911
from spatialmath import SE3, SO3, SE2
1012
import numpy as np
11-
# from spatialmath import super_pose as sp
1213
from spatialmath.base import *
13-
from spatialmath.base import argcheck
14-
import spatialmath as sm
1514
from spatialmath.baseposematrix import BasePoseMatrix
1615
from spatialmath.twist import BaseTwist
1716

@@ -225,21 +224,21 @@ def test_constructor_TwoVec(self):
225224
# x and y given
226225
R = SO3.TwoVectors(x=v1, y=v2)
227226
self.assertIsInstance(R, SO3)
228-
nt.assert_almost_equal(np.linalg.det(R), 1, 5)
227+
nt.assert_almost_equal(R.det(), 1, 5)
229228
# x axis should equal normalized x vector
230229
nt.assert_almost_equal(R.R[:, 0], v1 / np.linalg.norm(v1), 5)
231230

232231
# y and z given
233232
R = SO3.TwoVectors(y=v2, z=v3)
234233
self.assertIsInstance(R, SO3)
235-
nt.assert_almost_equal(np.linalg.det(R), 1, 5)
234+
nt.assert_almost_equal(R.det(), 1, 5)
236235
# y axis should equal normalized y vector
237236
nt.assert_almost_equal(R.R[:, 1], v2 / np.linalg.norm(v2), 5)
238237

239238
# x and z given
240239
R = SO3.TwoVectors(x=v3, z=v1)
241240
self.assertIsInstance(R, SO3)
242-
nt.assert_almost_equal(np.linalg.det(R), 1, 5)
241+
nt.assert_almost_equal(R.det(), 1, 5)
243242
# x axis should equal normalized x vector
244243
nt.assert_almost_equal(R.R[:, 0], v3 / np.linalg.norm(v3), 5)
245244

@@ -274,7 +273,8 @@ def test_printline(self):
274273
s = R.printline(file=None)
275274
# self.assertIsInstance(s, str)
276275
# self.assertEqual(s.count('\n'), 2)
277-
276+
277+
@pytest.mark.skipif(sys.platform.startswith("darwin"), reason="tkinter bug with mac")
278278
def test_plot(self):
279279
plt.close('all')
280280

‎zz

Copy file name to clipboardExpand all lines: zz
Whitespace-only changes.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.