From c9f5eb7a79bbaa1fc8d7fef64b01fd4cbea59154 Mon Sep 17 00:00:00 2001 From: han16nah <41050948+han16nah@users.noreply.github.com> Date: Tue, 31 Oct 2023 06:32:33 +0100 Subject: [PATCH] fix tests (#390) --- pytests/test_demo_scenes.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pytests/test_demo_scenes.py b/pytests/test_demo_scenes.py index b5f516176..c7c4e3e68 100644 --- a/pytests/test_demo_scenes.py +++ b/pytests/test_demo_scenes.py @@ -193,19 +193,21 @@ def eval_detailedVoxels_uls(dirname): @pytest.mark.exe def test_xyzVoxels_tls_exe(): dirname_exe = run_helios_executable(Path('data') / 'surveys' / 'voxels' / 'tls_sphere_xyzloader_normals.xml', - options=['--lasOutput']) + options=['--lasOutput', + '--gpsStartTime', '2022-01-01 00:00:00']) eval_xyzVoxels_tls(dirname_exe) @pytest.mark.pyh def test_xyzVoxels_tls_pyh(): - dirname_pyh = run_helios_pyhelios(Path('data') / 'surveys' / 'voxels' / 'tls_sphere_xyzloader_normals.xml') + dirname_pyh = run_helios_pyhelios(Path('data') / 'surveys' / 'voxels' / 'tls_sphere_xyzloader_normals.xml', + start_time='2022-01-01 00:00:00') eval_xyzVoxels_tls(dirname_pyh) def eval_xyzVoxels_tls(dirname): assert (dirname / 'leg000_points.las').exists() - assert abs((dirname / 'leg000_points.las').stat().st_size - 19_287_965) < MAX_DIFFERENCE_BYTES + assert abs((dirname / 'leg000_points.las').stat().st_size - 19_288_187) < MAX_DIFFERENCE_BYTES # clean up if DELETE_FILES_AFTER: shutil.rmtree(dirname) @@ -248,7 +250,8 @@ def eval_interpolated_traj(dirname): def test_quadcopter_exe(): dirname_exe = run_helios_executable(Path('data') / 'surveys' / 'toyblocks' / 'uls_toyblocks_survey_scene_combo.xml', options=['--lasOutput', - '--zipOutput']) + '--zipOutput', + '--gpsStartTime', '2022-01-01 00:00:00']) eval_quadcopter(dirname_exe) @@ -257,7 +260,8 @@ def test_quadcopter_exe(): @pytest.mark.pyh def test_quadcopter_pyh(): dirname_pyh = run_helios_pyhelios(Path('data') / 'surveys' / 'toyblocks' / 'uls_toyblocks_survey_scene_combo.xml', - zip_output=True) + zip_output=True, + start_time='2022-01-01 00:00:00') eval_quadcopter(dirname_pyh) @@ -265,11 +269,11 @@ def eval_quadcopter(dirname): assert (dirname / 'leg000_points.laz').exists() assert (dirname / 'leg000_trajectory.txt').exists() # assert abs( - # (dirname / 'leg000_points.laz').stat().st_size - 1_968_855) < MAX_DIFFERENCE_BYTES # Win: 1_970_582 + # (dirname / 'leg000_points.laz').stat().st_size - 1_974_592) < MAX_DIFFERENCE_BYTES # assert abs( - # (dirname / 'leg002_points.laz').stat().st_size - 2_150_438) < MAX_DIFFERENCE_BYTES # Win: 2_154_149 + # (dirname / 'leg002_points.laz').stat().st_size - 2_153_266) < MAX_DIFFERENCE_BYTES # assert abs( - # (dirname / 'leg004_points.laz').stat().st_size - 3_812_298) < MAX_DIFFERENCE_BYTES # Win: 3_810_208 + # (dirname / 'leg004_points.laz').stat().st_size - 3_818_282) < MAX_DIFFERENCE_BYTES las = laspy.read(dirname / 'leg000_points.laz') data = np.array([las.x, las.y, las.z]).T expected = np.array([[-7.00000e+01, -3.35592e+01, 3.73900e-03], @@ -429,19 +433,22 @@ def test_strip_id_pyh(): def test_strip_id_exe(): dirname_exe = run_helios_executable(Path('data') / 'test' / 'als_hd_height_above_ground_stripid_light.xml', - options=["--lasOutput", "--zipOutput"]) + options=['--lasOutput', '--zipOutput']) las_version = "1.4" eval_las(dirname_exe, las_version, check_empty=True) @pytest.mark.pyh def test_dyn_pyh(): dirname_pyh = run_helios_pyhelios(Path('data') / 'surveys' / 'dyn' / 'tls_dyn_cube.xml', - las_output=True, zip_output=True) + las_output=True, zip_output=True, + start_time='2022-01-01 00:00:00') + eval_dyn(dirname_pyh) @pytest.mark.exe def test_dyn_exe(): dirname_exe = run_helios_executable(Path('data') / 'surveys' / 'dyn' / 'tls_dyn_cube.xml', - options=["--lasOutput", "--zipOutput"]) + options=['--lasOutput', '--zipOutput', + '--gpsStartTime', '2022-01-01 00:00:00']) eval_dyn(dirname_exe)