From f0e44312742a7031c4e932c3dcd1c1bebfb5acb4 Mon Sep 17 00:00:00 2001 From: Eike Caldeweyher <46899008+f3rmion@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:07:42 +0100 Subject: [PATCH] Patch SciPy import error and bump version to 1.0.8 (#43) * Patch version of SciPy. * Bump version to 1.0.8 * Remove python versions from GA test workflow. * Remove python versions. * Delete lock file. --- noxfile.py | 7 +++++-- pyproject.toml | 14 +++++++------- src/kallisto/__init__.py | 2 +- src/kallisto/console.py | 4 +++- src/kallisto/methods.py | 23 ++++++++++++----------- src/kallisto/molecule.py | 6 +++++- src/kallisto/rmsd.py | 14 +++++++++++--- src/kallisto/units.py | 2 +- tests/test_cli.py | 12 ++++++++---- tests/test_version.py | 2 +- 10 files changed, 54 insertions(+), 32 deletions(-) diff --git a/noxfile.py b/noxfile.py index a651700..d055b08 100644 --- a/noxfile.py +++ b/noxfile.py @@ -11,7 +11,7 @@ locations = "src", "tests", "noxfile.py" -python_versions = ["3.9", "3.8", "3.7"] +python_versions = ["3.9", "3.8"] @nox.session(python=python_versions) @@ -19,7 +19,10 @@ def tests(session: Session) -> None: args = session.posargs or ["--cov", "-m", "not e2e"] session.run("poetry", "install", "--no-dev", external=True) install_with_constraints( - session, "coverage[toml]", "pytest", "pytest-cov", + session, + "coverage[toml]", + "pytest", + "pytest-cov", ) session.run("pytest", *args) diff --git a/pyproject.toml b/pyproject.toml index 82c7d9f..2e2d6ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "kallisto" -version = "1.0.7" +version = "1.0.8" description = "The Kallisto software enables the efficient calculation of atomic features that can be used within a quantitative structure-activity relationship (QSAR) approach. Furthermore, several modelling helpers are implemented." license = "Apache 2.0" readme = "README.md" @@ -10,19 +10,19 @@ keywords = ["chemistry", "computational-chemistry", "quantum-chemistry", "machin authors = ["Eike Caldeweyher ", "Rocco Meli ", "Philipp Pracht "] [tool.poetry.dependencies] -python = "^3.7" -click = "^7.1.2" +python = "^3.8" +click = "^8.0.0" numpy = "^1.19.0" -scipy = "^1.5.2" +scipy = "1.9.2" [tool.poetry.dev-dependencies] pytest = "^5.2" pytest-cov = {version = "^2.10.0", extras = ["toml"]} coverage = {version = "^5.2", extras = ["toml"]} -black = "^19.10b0" +black = "^22.1.0" flake8 = "^3.8.3" -flake8-bandit = "^2.1.2" -flake8-black = "^0.2.0" +flake8-bandit = "^3.0.0" +flake8-black = "^0.3.0" flake8-bugbear = "^20.1.4" flake8-import-order = "^0.18.1" safety = "^1.9.0" diff --git a/src/kallisto/__init__.py b/src/kallisto/__init__.py index 9e604c0..e13bd59 100644 --- a/src/kallisto/__init__.py +++ b/src/kallisto/__init__.py @@ -1 +1 @@ -__version__ = "1.0.7" +__version__ = "1.0.8" diff --git a/src/kallisto/console.py b/src/kallisto/console.py index 6aaacbc..c0d449a 100644 --- a/src/kallisto/console.py +++ b/src/kallisto/console.py @@ -423,7 +423,9 @@ def lig(config, inp: str, center: int, out: click.File): k = 0 for path in substructures: silentPrinter( - config.silent, "Substructure {}: {}".format(k, path), out, + config.silent, + "Substructure {}: {}".format(k, path), + out, ) k += 1 diff --git a/src/kallisto/methods.py b/src/kallisto/methods.py index 3664579..793feb2 100644 --- a/src/kallisto/methods.py +++ b/src/kallisto/methods.py @@ -10,9 +10,9 @@ def getCoordinationNumbers( ): """A method to compute coordination numbers (cns). - CN values are calculated for a given structure and are returned as an - array. Choose functional type by "cn" defining standard (exp), covalent (cov), - or error (err).""" + CN values are calculated for a given structure and are returned as an + array. Choose functional type by "cn" defining standard (exp), covalent (cov), + or error (err).""" from kallisto.data import covalent_radius as rcov from kallisto.data import pauling_en @@ -65,7 +65,7 @@ def getCoordinationNumbers( # Fitted to match Wiberg bond orders of diatomic molecules k4 = 4.10451 k5 = 19.08857 - k6 = 2 * 11.28174 ** 2 + k6 = 2 * 11.28174**2 kn = 7.50 for i in range(nat): @@ -107,7 +107,7 @@ def getProximityShells( # Fitted to match Wiberg bond orders of diatomic molecules k4 = 4.10451 k5 = 19.08857 - k6 = 2 * 11.28174 ** 2 + k6 = 2 * 11.28174**2 kn = 7.50 threshold = 800.0 @@ -148,10 +148,10 @@ def getAtomicPartialCharges( at: np.ndarray, coords: np.ndarray, cns: np.ndarray, charge: int ): """A method to compute atomic electronegativity equilibration partial - charges (eeqs). + charges (eeqs). - EEQ values are calculated for a given structure and are returned as an - array.""" + EEQ values are calculated for a given structure and are returned as an + array.""" from kallisto.data import eeq_alp, eeq_cnfak, eeq_en, eeq_gamm from numpy import linalg as LA @@ -269,7 +269,8 @@ def getPolarizabilities(at: np.ndarray, covcn: np.ndarray, qs: np.ndarray, charg cncount[int(icn)] += 1 for jj in range(23): alphar[jj][j][ia] = np.maximum( - ascale[j][ia] * (alphaiw[jj][j][ia] - hcount[j][ia] * alpha[jj]), 0, + ascale[j][ia] * (alphaiw[jj][j][ia] - hcount[j][ia] * alpha[jj]), + 0, ) for j in range(refn[ia]): icn = cncount[int(np.rint(refcn[j][ia]))] @@ -379,8 +380,8 @@ def getVanDerWaalsRadii( ): """A method to compute environment and charge dependent van der Waals radii (vdws). - VDW values are calculated from atomic polarizabilities for a given structure - and are returned as an array.""" + VDW values are calculated from atomic polarizabilities for a given structure + and are returned as an array.""" from kallisto.data import chemical_symbols from kallisto.data.vdw import rahm, truhlar diff --git a/src/kallisto/molecule.py b/src/kallisto/molecule.py index a6f4040..e6a76cd 100644 --- a/src/kallisto/molecule.py +++ b/src/kallisto/molecule.py @@ -29,7 +29,11 @@ class Molecule(object): Atomic charges.""" def __init__( - self, symbols=None, positions=None, numbers=None, charges=None, + self, + symbols=None, + positions=None, + numbers=None, + charges=None, ): molecule = None diff --git a/src/kallisto/rmsd.py b/src/kallisto/rmsd.py index b255fdd..eb68fcc 100644 --- a/src/kallisto/rmsd.py +++ b/src/kallisto/rmsd.py @@ -4,7 +4,7 @@ from typing import Tuple import numpy as np -from scipy.sparse.linalg.eigen.arpack import eigsh +from scipy.sparse.linalg import eigsh from scipy.spatial import distance from scipy.spatial.transform import Rotation as R @@ -199,7 +199,12 @@ def exchangeSubstructure( # get all bonding partner oldSubBonds = oldsub.get_bonds(partner="X") outxyz = matchSubstrates( - bonds, newsub, newSubBonds, oldsub, oldSubBonds, centralAtom, + bonds, + newsub, + newSubBonds, + oldsub, + oldSubBonds, + centralAtom, ) # atoms from complex excluding old substrate @@ -223,7 +228,10 @@ def exchangeSubstructure( shift = outxyz[0, :] - refShift for j in range(newnat): outxyz2[j, :] = getRodriguezRotation( - outxyz[j, :], origin, partner, theta, + outxyz[j, :], + origin, + partner, + theta, ) outxyz2[j, :] += shift diff --git a/src/kallisto/units.py b/src/kallisto/units.py index 54a865e..5af09c7 100644 --- a/src/kallisto/units.py +++ b/src/kallisto/units.py @@ -78,7 +78,7 @@ def createUnits(version): units["_me"] * units["_e"] ** 3 / 16 - / pi ** 2 + / pi**2 / units["_eps0"] ** 2 / units["_hbar"] ** 2 ) diff --git a/tests/test_cli.py b/tests/test_cli.py index 7705bb5..f425f9a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -176,7 +176,8 @@ def test_cli_vdw_angstrom(runner, pyridine_xyz): def test_cli_vdw_angstrom_truhlar(runner, pyridine_xyz): result = runner.invoke( - cli, ["vdw", "--angstrom", "--vdwtype", "truhlar", pyridine_xyz], + cli, + ["vdw", "--angstrom", "--vdwtype", "truhlar", pyridine_xyz], ) assert result.exit_code == 0 @@ -258,7 +259,8 @@ def test_cli_exs_silent(runner, pyridine_xyz): def test_cli_exs(runner, pyridine_xyz): result = runner.invoke( - cli, ["exs", "--center", "0", "--subnr", "2", pyridine_xyz, pyridine_xyz], + cli, + ["exs", "--center", "0", "--subnr", "2", pyridine_xyz, pyridine_xyz], ) assert result.exit_code == 0 newstructure = "newstructure.xyz" @@ -304,14 +306,16 @@ def test_cli_exs_with_rotation(runner, pyridine_xyz): # test cli part for stm def test_cli_stm_silent(runner, iridiumcat_xyz): result = runner.invoke( - cli, ["--silent", "stm", "--origin", "18", "--partner", "23", iridiumcat_xyz], + cli, + ["--silent", "stm", "--origin", "18", "--partner", "23", iridiumcat_xyz], ) assert result.exit_code == 0 def test_cli_stm(runner, iridiumcat_xyz): result = runner.invoke( - cli, ["stm", "--origin", "18", "--partner", "23", iridiumcat_xyz], + cli, + ["stm", "--origin", "18", "--partner", "23", iridiumcat_xyz], ) assert result.exit_code == 0 diff --git a/tests/test_version.py b/tests/test_version.py index 7856c6d..7d40084 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -4,4 +4,4 @@ def test_version(): - assert __version__ == "1.0.7" + assert __version__ == "1.0.8"