aspuru-guzik-group/funsies

Cannot run crest using funsies

Opened this issue · 2 comments

Hello, I have tried to run crest using funsies:

"""Generate a single conformer from a SMILES string."""
from __future__ import annotations

import argparse
import funsies as f
from funsies.types import Encoding

parser = argparse.ArgumentParser(
    description="Compute the spectrum of a molecule using the Vertical Gradient method."
)

parser.add_argument("-c", "--charge", help="charge", type=int, default=0)

args = parser.parse_args()


CHARGE = args.charge

xtbopt = "/home/leticia/Projects/SN1/xtbopt.xyz"
with f.Fun():
	crest_conf = f.shell("crest xtbopt.xyz", inp={"xtbopt.xyz": xtbopt}, out=["crest_best.xyz"], env={"OMP_NUM_THREADS": "40"})

But I got this error:

if you don't want it to be converted to json (and wrapped with "), 
you NEED to pass it as bytes (by .encode()-ing it first)

Important:

  • redis-server is working properly

I had the same problem

Hi,

That's because you need to pass the content of the file as the value, not the path to the file. Something like

with open("/home/leticia/Projects/SN1/xtbopt.xyz", "rb") as fi:
    xtbopt = fi.read()

To get the data out to a file you'll need to do something like,

f.execute(crest_conf)
f.wait_for(crest_conf)
f.takeout(crest_conf.out['crest_best.xyz'], "path to output")