AcademySoftwareFoundation / openvdb

OpenVDB - Sparse volume data structure and tools
http://www.openvdb.org/
Apache License 2.0
2.69k stars 659 forks source link

pyopenvdb file streaming #1764

Open chrisflesher opened 9 months ago

chrisflesher commented 9 months ago

Is your feature request related to a problem? Please describe.

Currently pyopenvdb only supports writing to local disk. This prevents writing directly to a destination in some cases (e.g. to cloud storage).

Describe the solution you'd like

The vdb read and write functions accept a file object (or pathlike object) instead of a str.

Describe alternatives you've considered

Currently our workaround is to write to a temporary file on local disk and copy it's contents to the destination.

chrisflesher commented 9 months ago

Here's a recent example of OpenCV modifying their C++ library to accept pathlike objects, maybe it would be a useful example? https://github.com/opencv/opencv/pull/24773/files

danrbailey commented 8 months ago

Though this is not currently a priority for the Steering Committee, we agree that this would be a worthwhile improvement. Note that we've recently adopted pybind11 as our python binding library. Feel free to make a PR if it's something you think you might have time to contribute to OpenVDB. Thanks for the suggestion.