-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make qcengine_list tolerant of qcengine not installed
- Loading branch information
Showing
1 changed file
with
9 additions
and
6 deletions.
There are no files selected for viewing
15 changes: 9 additions & 6 deletions
15
qcfractalcompute/qcfractalcompute/run_scripts/qcengine_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import json | ||
|
||
import qcengine | ||
|
||
# This script returns the programs/procedures available in qcengine | ||
# as a dictionary of {program: version} | ||
# It is meant to be used with subprocess to get the available programs | ||
# in a conda environment | ||
|
||
if __name__ == "__main__": | ||
r = qcengine.list_available_programs() | qcengine.list_available_procedures() | ||
try: | ||
import qcengine | ||
|
||
progs = {x: qcengine.get_program(x).get_version() for x in qcengine.list_available_programs()} | ||
procs = {x: qcengine.get_procedure(x).get_version() for x in qcengine.list_available_procedures()} | ||
progs["qcengine"] = qcengine.__version__ | ||
|
||
progs = {x: qcengine.get_program(x).get_version() for x in qcengine.list_available_programs()} | ||
procs = {x: qcengine.get_procedure(x).get_version() for x in qcengine.list_available_procedures()} | ||
progs["qcengine"] = qcengine.__version__ | ||
except ImportError: | ||
progs = {} | ||
procs = {} | ||
|
||
print(json.dumps({**progs, **procs})) |