Quick fix, load_txt legit header
This commit is contained in:
parent
32f4bb28ff
commit
5249a96bd7
@ -91,7 +91,7 @@ def load_txt(fname, header, delimiter=' '):
|
||||
----------
|
||||
fname : str, Path
|
||||
Path to the text file to load.
|
||||
header : array
|
||||
header : array, tuple
|
||||
Names of the columns contained in the text point cloud file.
|
||||
delimiter : str, optional
|
||||
String used to separate values. The default is whitespace.
|
||||
@ -132,7 +132,7 @@ def load_txt(fname, header, delimiter=' '):
|
||||
dtype=[('spatial', np.float, 3)])
|
||||
|
||||
log.debug('Extract feature data')
|
||||
header_c = header.copy()
|
||||
header_c = list(header)
|
||||
for i in ('x', 'y', 'z'):
|
||||
header_c.remove(i)
|
||||
|
||||
|
@ -66,6 +66,11 @@ def test_load_txt(datadir, fname, head, separator, exp_point_count, exp_field_co
|
||||
except IOError:
|
||||
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['spatial'].shape[-1] == 3, "Return ndarray with spatial field"
|
||||
|
Loading…
Reference in New Issue
Block a user