Here is the relevant code:
for file in files:
with readfile(file) as openfile:
molecules.append(process_file_fn(openfile))
and I am getting this error from the code above:
src/datamodules/components/edm/process.py", line 92, in process_xyz_files with readfile(file) as openfile: AttributeError: __enter__
Here is the definition of the readfile:
if tarfile.is_tarfile(data):
tardata = tarfile.open(data, "r")
files = tardata.getmembers()
def readfile(data_pt): return tardata.extractfile(data_pt)
My data is 1234.xyz.tar.bz2
Any insights/suggestions for me is appreciated. Thank you in advance
I tried to define the mode which is read in both the function and the loop but I am met with the same error.