NLeSC / Massive-PotreeConverter

Convert massive pointcloud, for example ahn2 (640 Billion points) to potree format.
Apache License 2.0
81 stars 19 forks source link

TypeError: glob() got an unexpected keyword argument 'recursive' #15

Open DanielSmon opened 7 years ago

DanielSmon commented 7 years ago

Hi,

I've pulled the latest Docker image from nlesc/massive-potreeconverter, and I'm getting the following error running mpc-info when I supply a directory path, such as:

docker run --mount source=data-ingest,target=/data1 --mount source=data-processed,target=/data2 --mount source=data-temp,target=/data3 nlesc/massive-potreeconverter mpc-info -i /data1 -c 4
('Input folder: ', '/data1/')
('Number of processes: ', 4)
('Target tile number of points: ', 5000000000)
('Target OctTree node number of points: ', 60000)
Starting get_info.pyc...
Execution failed!
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pympc/get_info.py", line 84, in main
    run(args.input, args.proc, args.avgtile, args.avgnode)
  File "/usr/local/lib/python2.7/dist-packages/pympc/get_info.py", line 9, in run
    (_, tcount, tminx, tminy, tminz, tmaxx, tmaxy, tmaxz, _, _, _) = utils.getPCFolderDetails(inputFolder, numberProcs)
  File "/usr/local/lib/python2.7/dist-packages/pympc/utils.py", line 112, in getPCFolderDetails
    inputFiles = getFiles(absPath, recursive=True)
  File "/usr/local/lib/python2.7/dist-packages/pympc/utils.py", line 67, in getFiles
    files.extend(glob.glob(os.path.join(inputElement,'*.' + ext),recursive = recursive))
TypeError: glob() got an unexpected keyword argument 'recursive'

If I specify a las file directly, it works:

docker run --mount source=data-ingest,target=/data1 --mount source=data-processed,target=/data2 --mount source=data-temp,target=/data3 nlesc/massive-potreeconverter mpc-info -i /data1/mymodel/apointcloud.las -c 4
('Input folder: ', '/data1/mymodel/apointcloud.las')
('Number of processes: ', 4)
('Target tile number of points: ', 5000000000)
('Target OctTree node number of points: ', 60000)
Starting get_info.pyc...
Completed 0.00%lasinfo /data1/mymodel/apointcloud.las -nc -nv -nco
Completed 100.00%!()
('AABB: ', 327699, 3640884, 32, 329172, 3641628, 140)
('#Points:', 3939233)
('Average density [pts / m2]:', 3.594479301257765)
Suggested number of tiles: 1. For this number of points Massive-PotreeConverter is not really required!
('Suggested Potree-OctTree CAABB: ', 327699, 3640884, 32, 329172, 3642357, 1505)
('Suggested Potree-OctTree spacing: ', 7.0)
('Suggested Potree-OctTree number of levels: ', 5)
Suggested potreeconverter command:
$(which PotreeConverter) -o <potree output directory> -l 5 -s 7 --CAABB "327699 3640884 32 329172 3642357 1505" --output-format LAZ -i <laz input directory>
Finished in 0.02 seconds

I saw that there was a recent commit to update the file search code, which makes use of glob. But I don't have much python experience to quickly troubleshoot. Anyone else experiencing this issue?

Cheers, Daniel

goord commented 7 years ago

Hi, it appears I introduced this bug. Apparently the recursive keyword is only supported in python 3.5

goord commented 7 years ago

This should be fixed in a24d2b8266881ba3ba6a34cec2f67b8a26e096fb Can you please test once more after pulling the latest version? Thanks.

DanielSmon commented 7 years ago

@goord thanks for doing that so quickly! I will test it tomorrow at the latest and post my results.

Cheers, Daniel

DanielSmon commented 7 years ago

@goord I've tested the latest Docker image, and can confirm this issue is resolved in the latest version.

Thanks again! Daniel