equinor / segyio

Fast Python library for SEGY files.
Other
469 stars 213 forks source link

Request - Provide file-object instead of file-name #573

Open SahandJ opened 1 month ago

SahandJ commented 1 month ago

Would it be possible to use segyio but instead of providing the file-name, rather provide a file-object as returned by open(), or more specifically smart_open from the smart-open library?

From my understanding, the file has to be on disk as segyio.open requires the file-name as an argument. However it looks like the read/write is done through C++ and I'm not sure if that would accept a file-object (I'm not very experienced with C++)

I hope that this would be something that could be added in the future. Currently we can use FUSE to fuse the remote cloud fs on disk.

sveinung-r commented 1 month ago

Hi,

As you mentioned the io happens in C, and thus adding support for file-object requires a significant re-design. There is unfortunately no such effort currently planned from our side.