fix VisibleDeprecation Warning (#358)

* try coverage

* add python warning setting

* add random seed for test coverage
This commit is contained in:
Atsushi Sakai
2020-07-10 23:46:19 +09:00
committed by GitHub
parent 72c4a891b3
commit 4c5e3ccc9e
8 changed files with 23 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ def jacob_motion(x, u):
jF = np.array([[0.0, 0.0, -DT * u[0] * math.sin(x[2, 0])], jF = np.array([[0.0, 0.0, -DT * u[0] * math.sin(x[2, 0])],
[0.0, 0.0, DT * u[0] * math.cos(x[2, 0])], [0.0, 0.0, DT * u[0] * math.cos(x[2, 0])],
[0.0, 0.0, 0.0]]) [0.0, 0.0, 0.0]], dtype=np.float64)
G = np.eye(STATE_SIZE) + Fx.T @ jF @ Fx G = np.eye(STATE_SIZE) + Fx.T @ jF @ Fx
@@ -236,8 +236,9 @@ def main():
if show_animation: # pragma: no cover if show_animation: # pragma: no cover
plt.cla() plt.cla()
# for stopping simulation with the esc key. # for stopping simulation with the esc key.
plt.gcf().canvas.mpl_connect('key_release_event', plt.gcf().canvas.mpl_connect(
lambda event: [exit(0) if event.key == 'escape' else None]) 'key_release_event',
lambda event: [exit(0) if event.key == 'escape' else None])
plt.plot(RFID[:, 0], RFID[:, 1], "*k") plt.plot(RFID[:, 0], RFID[:, 1], "*k")
plt.plot(xEst[0], xEst[1], ".r") plt.plot(xEst[0], xEst[1], ".r")

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
echo "Run test suites! " echo "Run test suites! "
export PYTHONWARNINGS=default # show warning
#python -m unittest discover tests #python -m unittest discover tests
#python -Wignore -m unittest discover tests #ignore warning #python -Wignore -m unittest discover tests #ignore warning
coverage run -m unittest discover tests # generate coverage file coverage run -m unittest discover tests # generate coverage file

View File

@@ -1,14 +1,17 @@
from unittest import TestCase from unittest import TestCase
import sys import sys
import os import os
import random
sys.path.append(os.path.dirname(__file__) + "/../") sys.path.append(os.path.dirname(__file__) + "/../")
try: try:
from PathPlanning.BatchInformedRRTStar import batch_informed_rrtstar as m from PathPlanning.BatchInformedRRTStar import batch_informed_rrtstar as m
except: except ImportError:
raise raise
print(__file__) print(__file__)
random.seed(12345)
class Test(TestCase): class Test(TestCase):

View File

@@ -1,5 +1,6 @@
import os import os
import sys import sys
import random
from unittest import TestCase from unittest import TestCase
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../") sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
@@ -7,9 +8,10 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)) +
"/../PathPlanning/ClosedLoopRRTStar/") "/../PathPlanning/ClosedLoopRRTStar/")
try: try:
from PathPlanning.ClosedLoopRRTStar import closed_loop_rrt_star_car as m from PathPlanning.ClosedLoopRRTStar import closed_loop_rrt_star_car as m
except: except ImportError:
raise raise
random.seed(12345)
print(__file__) print(__file__)

View File

@@ -1,6 +1,7 @@
from unittest import TestCase from unittest import TestCase
import numpy as np import numpy as np
np.random.seed(12345)
from PathPlanning.DubinsPath import dubins_path_planning from PathPlanning.DubinsPath import dubins_path_planning

View File

@@ -1,16 +1,19 @@
from unittest import TestCase from unittest import TestCase
import sys import sys
import os import os
import random
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../") sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
sys.path.append(os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(os.path.abspath(__file__))
+ "/../PathPlanning/LQRRRTStar/") + "/../PathPlanning/LQRRRTStar/")
try: try:
from PathPlanning.LQRRRTStar import lqr_rrt_star as m from PathPlanning.LQRRRTStar import lqr_rrt_star as m
except: except ImportError:
raise raise
print(__file__) print(__file__)
random.seed(12345)
class Test(TestCase): class Test(TestCase):

View File

@@ -1,5 +1,6 @@
import os import os
import sys import sys
import random
from unittest import TestCase from unittest import TestCase
sys.path.append(os.path.dirname(__file__) + "/../ArmNavigation/n_joint_arm_to_point_control/") sys.path.append(os.path.dirname(__file__) + "/../ArmNavigation/n_joint_arm_to_point_control/")
@@ -8,6 +9,8 @@ import n_joint_arm_to_point_control as m
print(__file__) print(__file__)
random.seed(12345)
class Test(TestCase): class Test(TestCase):

View File

@@ -1,5 +1,6 @@
import os import os
import sys import sys
import random
from unittest import TestCase from unittest import TestCase
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../") sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
@@ -12,6 +13,8 @@ except ImportError:
print(__file__) print(__file__)
random.seed(12345)
class Test(TestCase): class Test(TestCase):