davidcaron / pye57

Read and write e57 point clouds from Python
MIT License
68 stars 42 forks source link

Handle dtypes like =d correctly. #44

Closed chpatrick closed 4 months ago

chpatrick commented 12 months ago

"info.format" can contain either "d" or "=d" for native endianness, this handles that case.

dancergraham commented 7 months ago

Hello this seemed to fail but the logs are now longer available to explain why - do you recall what the problem was ? Thanks,

dancergraham commented 7 months ago

ahh I'm starting to understand the vocabulary here - this is describing buffer format descriptors, right https://docs.python.org/3/library/struct.html

dancergraham commented 7 months ago

from reading the documentation it seems to me that =d and d are not necessarily the same - d would use standard size, whereas =d would use platform dependent c native size. I don't know enough about the different sizes of these data types on different platforms to know whether these differences are significant in practice ?

dancergraham commented 4 months ago

Hello @chpatrick can you provide any more information on this - are specific scanners generating files with =d ?

chpatrick commented 4 months ago

The format string here depends on what Python decides for the buffer you provide, not the scanner. I'm not sure what the best thing is to do regarding the size.

dancergraham commented 4 months ago

OK the tests pass I'm merging it like this for now and interested to read up some more on the subject. If you have any code which generates =d codes then I'm interested in trying it on both Windows and Linux to make sure it works OK