You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're working on a feature for RADIS App to allow the user to download the spectrum file (arunavabasucom/radis-app#619). To do this, we do spectrum.store(file_path), load the file from disk to serve to the user, and then delete the file. If we could instead pass a buffer object to write the file to memory, we could simplify our implementation of this feature and improve performance by skipping the write to disk. The buffer would have the same interface as someone doing fp = open(file_path) and passing fp to spectrum.store(fp), so RADIS would just write the data there and the client can take care of whether it goes to disk or to an in-memory buffer.
I propose adjusting spectrum.store(file_path) to accept either a string file path (as it is now) or a file handle-like object. If passed a file handle-like object, we would skip the open(...) lines like here:
馃敄 Feature description
We're working on a feature for RADIS App to allow the user to download the spectrum file (arunavabasucom/radis-app#619). To do this, we do
spectrum.store(file_path)
, load the file from disk to serve to the user, and then delete the file. If we could instead pass a buffer object to write the file to memory, we could simplify our implementation of this feature and improve performance by skipping the write to disk. The buffer would have the same interface as someone doingfp = open(file_path)
and passingfp
tospectrum.store(fp)
, so RADIS would just write the data there and the client can take care of whether it goes to disk or to an in-memory buffer.I propose adjusting
spectrum.store(file_path)
to accept either a string file path (as it is now) or a file handle-like object. If passed a file handle-like object, we would skip theopen(...)
lines like here:radis/radis/tools/database.py
Line 211 in 91bfcd0
馃憠 Why you want this feature!!
Simplify RADIS App implementation of serving spectrum download files to users and improve performance.
The text was updated successfully, but these errors were encountered: