Skip to content

Commit

Permalink
Patch SciPy import error and bump version to 1.0.8 (#43)
Browse files Browse the repository at this point in the history
* Patch version of SciPy.

* Bump version to 1.0.8

* Remove python versions from GA test workflow.

* Remove python versions.

* Delete lock file.
  • Loading branch information
f3rmion authored Oct 31, 2022
1 parent b6c34b4 commit f0e4431
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 32 deletions.
7 changes: 5 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@
locations = "src", "tests", "noxfile.py"


python_versions = ["3.9", "3.8", "3.7"]
python_versions = ["3.9", "3.8"]


@nox.session(python=python_versions)
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)

Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -10,19 +10,19 @@ keywords = ["chemistry", "computational-chemistry", "quantum-chemistry", "machin
authors = ["Eike Caldeweyher <[email protected]>", "Rocco Meli <[email protected]>", "Philipp Pracht <[email protected]>"]

[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"
Expand Down
2 changes: 1 addition & 1 deletion src/kallisto/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.7"
__version__ = "1.0.8"
4 changes: 3 additions & 1 deletion src/kallisto/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 12 additions & 11 deletions src/kallisto/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]))]
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/kallisto/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions src/kallisto/rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/kallisto/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def createUnits(version):
units["_me"]
* units["_e"] ** 3
/ 16
/ pi ** 2
/ pi**2
/ units["_eps0"] ** 2
/ units["_hbar"] ** 2
)
Expand Down
12 changes: 8 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@


def test_version():
assert __version__ == "1.0.7"
assert __version__ == "1.0.8"

0 comments on commit f0e4431

Please sign in to comment.