Skip to content

Commit 39934ca

Browse files
committed
Upgrade pmg version and swap in Critic2Caller
1 parent 825218f commit 39934ca

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

atomate/qchem/firetasks/critic2.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import warnings
1212

1313
from pymatgen.io.qchem.inputs import QCInput
14+
from pymatgen.command_line.critic2_caller import Critic2Caller
1415
from monty.serialization import loadfn, dumpfn
1516

1617
from custodian import Custodian
@@ -77,29 +78,7 @@ def run_task(self, fw_spec):
7778
input_script += [""]
7879
input_script = "\n".join(input_script)
7980

80-
with open('input_script.cri', 'w') as f:
81-
f.write(input_script)
82-
args = ["critic2", "input_script.cri"]
83-
84-
rs = subprocess.Popen(args,
85-
stdin=subprocess.PIPE,
86-
stdout=subprocess.PIPE,
87-
stderr=subprocess.PIPE,
88-
close_fds=True)
89-
90-
stdout, stderr = rs.communicate()
91-
stdout = stdout.decode()
92-
93-
if stderr:
94-
stderr = stderr.decode()
95-
warnings.warn(stderr)
96-
with open('stdout.cri', 'w') as f:
97-
f.write(stdout)
98-
with open('stderr.cri', 'w') as f:
99-
f.write(stderr)
100-
101-
if rs.returncode != 0:
102-
raise RuntimeError("critic2 exited with return code {}.".format(rs.returncode))
81+
caller = Critic2Caller(input_script)
10382

10483
if compress_at_end:
10584
compress_file(cube)

atomate/utils/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from fireworks import LaunchPad
1111
from pymongo import MongoClient
1212

13-
from pymatgen import SETTINGS
13+
from pymatgen.settings import SETTINGS
1414

1515
__author__ = "Kiran Mathew"
1616
__credits__ = "Anubhav Jain"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tqdm==4.58.0
88
pybtex==0.24.0
99
ruamel.yaml==0.16.12
1010
pandas==1.2.2
11-
pymatgen==2021.2.16
11+
pymatgen==2021.3.3
1212
custodian==2021.2.8
1313
networkx==2.5
1414
pydash==4.9.2

0 commit comments

Comments
 (0)