Merge branch 'master' into develop
This commit is contained in:
commit
dddd558aeb
@ -91,7 +91,7 @@ def load_txt(fname, header, delimiter=' '):
|
|||||||
----------
|
----------
|
||||||
fname : str, Path
|
fname : str, Path
|
||||||
Path to the text file to load.
|
Path to the text file to load.
|
||||||
header : array
|
header : array, tuple
|
||||||
Names of the columns contained in the text point cloud file.
|
Names of the columns contained in the text point cloud file.
|
||||||
delimiter : str, optional
|
delimiter : str, optional
|
||||||
String used to separate values. The default is whitespace.
|
String used to separate values. The default is whitespace.
|
||||||
@ -132,7 +132,7 @@ def load_txt(fname, header, delimiter=' '):
|
|||||||
dtype=[('spatial', np.float, 3)])
|
dtype=[('spatial', np.float, 3)])
|
||||||
|
|
||||||
log.debug('Extract feature data')
|
log.debug('Extract feature data')
|
||||||
header_c = header.copy()
|
header_c = list(header)
|
||||||
for i in ('x', 'y', 'z'):
|
for i in ('x', 'y', 'z'):
|
||||||
header_c.remove(i)
|
header_c.remove(i)
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,11 @@ def test_load_txt(datadir, fname, head, separator, exp_point_count, exp_field_co
|
|||||||
except IOError:
|
except IOError:
|
||||||
pytest.fail('Opening legit file without exception')
|
pytest.fail('Opening legit file without exception')
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = io.load_txt(fname, tuple(head), separator)
|
||||||
|
except Exception:
|
||||||
|
pytest.fail('Opening legit file with legit header')
|
||||||
|
|
||||||
assert result.size == exp_point_count, "Return correct point count"
|
assert result.size == exp_point_count, "Return correct point count"
|
||||||
|
|
||||||
assert result['spatial'].shape[-1] == 3, "Return ndarray with spatial field"
|
assert result['spatial'].shape[-1] == 3, "Return ndarray with spatial field"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user