Skip to content

Commit

Permalink
fix tests (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
han16nah committed Oct 31, 2023
1 parent fa605eb commit de56a9e
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions pytests/test_demo_scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)


Expand All @@ -257,19 +260,20 @@ 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)


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],
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit de56a9e

Please sign in to comment.