File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ import subprocess
2+
3+ import pdal
4+ import pytest
5+ import utils
6+
7+
8+ def test_compare (autzen_2010_file : str , autzen_2023_file : str ):
9+ """Test compare function"""
10+
11+ output_path = utils .test_data_output_filepath (f"autzen-compare.copc.laz" , "compare" )
12+
13+ res = subprocess .run (
14+ [
15+ utils .pdal_wrench_path (),
16+ "compare" ,
17+ f"--input={ autzen_2010_file } " ,
18+ f"--input-compare={ autzen_2023_file } " ,
19+ f"--output={ output_path .as_posix ()} " ,
20+ "--sample-pct=100" ,
21+ ],
22+ check = True ,
23+ )
24+
25+ assert res .returncode == 0
26+ assert output_path .exists ()
27+
28+ pipeline = pdal .Reader (filename = output_path .as_posix ()).pipeline ()
29+ pipeline .execute ()
30+
31+ dimensions = pipeline .arrays [0 ].dtype .names
32+
33+ assert "m3c2_distance" in dimensions
34+ assert "m3c2_uncertainty" in dimensions
35+ assert "m3c2_significant" in dimensions
36+ assert "m3c2_std_dev1" in dimensions
37+ assert "m3c2_std_dev2" in dimensions
38+ assert "m3c2_count1" in dimensions
39+ assert "m3c2_count2" in dimensions
40+
41+ values = pipeline .arrays [0 ]["m3c2_distance" ]
42+ assert values .min () == pytest .approx (- 3.8898310663727376 , abs = 1e-15 )
43+ assert values .max () == pytest .approx (5.081599567261037 , abs = 1e-15 )
You can’t perform that action at this time.
0 commit comments