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

GCP .get_version() method raises exception when running qcengine info #293

Open
coltonbh opened this issue Mar 10, 2021 · 2 comments
Open

Comments

@coltonbh
Copy link
Contributor

Describe the bug
The .get_version() method on the gcp program raises an exception if the program is not found.

To Reproduce
qcengine info produces the following exception:

❯ qcengine info
>>> Version information
QCEngine:    v0.18.0+1.g02aa5ef.dirty
QCElemental: v0.17.0

>>> Program information
Available programs:
/usr/local/bin/gcp: invalid option -- 'e'
Try '/usr/local/bin/gcp --help' for more information.
Traceback (most recent call last):
  File "/Users/cbh/.pyenv/versions/miniconda3-4.7.12/envs/p4env/bin/qcengine", line 33, in <module>
    sys.exit(load_entry_point('qcengine', 'console_scripts', 'qcengine')())
  File "/Users/cbh/dev/mtzgroup/QCEngine/qcengine/cli.py", line 163, in main
    info_cli(args)
  File "/Users/cbh/dev/mtzgroup/QCEngine/qcengine/cli.py", line 126, in info_cli
    info_programs()
  File "/Users/cbh/dev/mtzgroup/QCEngine/qcengine/cli.py", line 88, in info_programs
    version = get_program(prog_name).get_version()
  File "/Users/cbh/dev/mtzgroup/QCEngine/qcengine/programs/gcp.py", line 71, in get_version
    raise UnknownError(f"Could not identify GCP version")
qcengine.exceptions.UnknownError: Could not identify GCP version

Expected behavior
The version should either be returned or if not available should simply print out the standard v??? version. It should not raise an exception.

@loriab
Copy link
Collaborator

loriab commented Mar 10, 2021

Where might your gcp be from? There's conda gcp from -c psi4 (from a Grimme tarball). That one should be ok. It had the quirk of too much printing (see below), but I've fixed that on master. Then there's conda mctc-gcp from -c conda-forge (from a GH repo). That one was also clean as I recall. Do you know which source code and if you compiled it yourself? What does gcp --help give? Thanks for debugging help.

(py39) psilocaluser@bash:psinet:/psi/gits/QCEngine: (dftd4) qcengine info
>>> Version information
QCEngine:    v0.18.0+4.g0f5427e.dirty
QCElemental: v0.19.0

>>> Program information
Available programs:
dftd3:       v3.2.1
input error
['|', 'Version', '2.02', 'Nov', '2016', '|']
gcp:         v2.2
mp2d:        v1.1

Other supported programs:
adcc cfour dftd4 entos gamess molpro mopac mrchem nwchem openmm psi4 qchem qcore rdkit terachem torchani turbomole xtb

@coltonbh
Copy link
Contributor Author

it appears that gcp is an alias for Git-Cherry-Pick. So my machines returns True for the program existing but it is referring to a completely separate program. Perhaps it would be good to wrap these lookups in some sort of try/except statement generally as every machine I've ever run qcengine info on raises some kind of exception. If an exception is raised, perhaps say the program is not available--or something like that :)

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

2 participants