Debian Codegraph @

cclib/bridge/cclib2pyquante.py

raw
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (c) 2017, the cclib development team
4 #
5 # This file is part of cclib (http://cclib.github.io) and is distributed under
6 # the terms of the BSD 3-Clause License.
7
8 """Bridge for using cclib data in PyQuante (http://pyquante.sourceforge.net)."""
9
10 from cclib.parser.utils import find_package
11
12 _found_pyquante = find_package("PyQuante")
13 if _found_pyquante:
14 from PyQuante.Molecule import Molecule
15
16
17 def _check_pyquante(found_pyquante):
18 if not found_pyquante:
19 raise ImportError("You must install `PyQuante` to use this function")
20
21
22 def makepyquante(atomcoords, atomnos, charge=0, mult=1):
23 """Create a PyQuante Molecule."""
24 _check_pyquante(_found_pyquante)
25 return Molecule("notitle",
26 list(zip(atomnos, atomcoords)),
27 units="Angstrom",
28 charge=charge, multiplicity=mult)
29
30
31 del find_package