Merge branch 'master' into develop

This commit is contained in:
Florent Guiotte 2019-03-26 17:32:50 +01:00
commit dddd558aeb
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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"