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

modernise packaging, and better manage optional depencencies #56

Merged
merged 10 commits into from
Jun 13, 2024
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ dependencies = [
qml = ["ase"]
regression = ["scikit-learn"]
wigner = ["sympy"]
gmol = ["cell2mol"]
equio = ["equistore-core @ git+https://github.com/lab-cosmo/equistore.git@e5b9dc365369ba2584ea01e9d6a4d648008aaab8#subdirectory=python/equistore-core"]
all = ["qstack[qml,regression,wigner,equio]"]
all = ["qstack[qml,regression,wigner,equio,gmol]"]

#dev = ["tqdm"] # those are deps for the tests

Expand Down
14 changes: 12 additions & 2 deletions qstack/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,18 @@ def gmol_to_mol(fin, basis="def2-svp"):
pyscf Mole: pyscf Mole object.
"""

from cell2mol.tmcharge_common import Cell, atom, molecule, ligand, metal
from cell2mol.tmcharge_common import labels2formula
try:
from cell2mol.tmcharge_common import Cell, atom, molecule, ligand, metal
from cell2mol.tmcharge_common import labels2formula
except ImportError:
print("""

ERROR: cannot import ĉell2mol. Have you installed qstack with the \gmol\" option?\n\n
liam-o-marsh marked this conversation as resolved.
Show resolved Hide resolved
(for instance, with `pip install qstack[gmol] or `pip install qstack[all]``)

""")
raise


# Open and read the file
if fin.endswith(".gmol"):
Expand Down
Loading