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

Cannot run crest using funsies #7

Open
Leticia-maria opened this issue Apr 9, 2022 · 2 comments
Open

Cannot run crest using funsies #7

Leticia-maria opened this issue Apr 9, 2022 · 2 comments

Comments

@Leticia-maria
Copy link

Leticia-maria commented Apr 9, 2022

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
@ThiagoReschutzegger
Copy link

I had the same problem

@clavigne
Copy link
Collaborator

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")

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

3 participants