Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECLFile IO and Filelikes #763

Closed
mcgreen-origen opened this issue Dec 10, 2020 · 1 comment
Closed

ECLFile IO and Filelikes #763

mcgreen-origen opened this issue Dec 10, 2020 · 1 comment

Comments

@mcgreen-origen
Copy link

I'm trying to open an ECLFile using the byte stream I have on RAM.

However, it looks like ECLFile is forcing me to save this to disk first and then provide a filepath. I suggest that filelike objects be added to acceptable inputs for ECLFile to avoid saving to disk only to load back into RAM.

Here is example code:

from io import BytesIO
from ecl.eclfile import EclFile

byte_stream = BytesIO()
# any cloud based client would suffice here
_client().download_fileobj(Bucket=bucket, Key=key, Fileobj=byte_stream)

# fails on this line currently, expecting a filepath, not a filelike object
timestep_file = EclFile(byte_stream)
swat_kw = timestep_file.iget_named_kw("SWAT", 0)
@pinkwah
Copy link
Collaborator

pinkwah commented Dec 17, 2020

ecl currently does not support anything that can't get converted into a C FILE *. We already have an issue on this: #732

You can try to write files to /dev/shm on Linux, which a filesystem located entirely in memory.

@pinkwah pinkwah closed this as completed Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants