Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Commit

Permalink
add packing & unpacking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Aug 10, 2018
1 parent c7fc085 commit 018804a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pylastests/test_packing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import numpy as np

from pylastests.test_common import las

las = las


def test_unpacking(las):
packed_points = las.points_data
unpacked_points = packed_points.to_unpacked()

assert packed_points.point_format.dimension_names == unpacked_points.point_format.dimension_names
for dim_name in unpacked_points.point_format.dimension_names:
assert np.allclose(packed_points[dim_name], unpacked_points[dim_name])


def test_packing(las):
packed_points = las.points_data
unpacked_points = packed_points.to_unpacked()
repacked_points = unpacked_points.to_packed()

assert packed_points.point_format.dimension_names == repacked_points.point_format.dimension_names
for dim_name in repacked_points.point_format.dimension_names:
assert np.allclose(packed_points[dim_name], repacked_points[dim_name])

0 comments on commit 018804a

Please sign in to comment.