File: test_benches.py

package info (click to toggle)
python-laspy 2.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,128 kB
  • sloc: python: 9,459; makefile: 20
file content (21 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np

import laspy


def test_bench_sub_field_view_comparison(benchmark):
    las = laspy.create()
    las.x = np.zeros(10**6, np.float64)
    benchmark(lambda: las.classification == 4)


def test_bench_scaled_array_comparison(benchmark):
    las = laspy.create()
    las.x = np.zeros(10**6, np.float64)
    benchmark(lambda: las.x >= 140.7329047)


def test_bench_normal_field_comparison(benchmark):
    las = laspy.create()
    las.x = np.zeros(10**6, np.float64)
    benchmark(lambda: las.X >= 779012)