Skip to content

Commit

Permalink
Merge pull request #308 from duartegroup/v1.4.1
Browse files Browse the repository at this point in the history
V1.4.1
  • Loading branch information
t-young31 authored Oct 31, 2023
2 parents 4d66675 + dafe17f commit 1075b84
Show file tree
Hide file tree
Showing 166 changed files with 1,791 additions and 1,294 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
activate-environment: test
mamba-version: "*"
channels: conda-forge

- name: Install mamba solver
run: |
conda install -n base conda-libmamba-solver
- name: Install
run: |
mamba install \
conda install \
--file requirements.txt \
--file tests/requirements.txt \
--channel conda-forge
--channel conda-forge \
--solver=libmamba
python -m pip install . --no-deps
- name: Test
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pytest_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
activate-environment: test
mamba-version: "*"
channels: conda-forge

- name: Install mamba solver
run: |
conda install -n base conda-libmamba-solver
- name: Install
run: |
mamba install \
conda install \
--file requirements.txt \
--file tests/requirements.txt \
--channel conda-forge
--channel conda-forge \
--solver=libmamba
source .github/scripts/install_xtb_ci.sh
python -m pip install . --no-deps
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.9.1
hooks:
- id: black
language_version: python3

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
rev: v1.5.1
hooks:
- id: mypy
exclude: "tests/|doc/|examples/"
Expand Down
11 changes: 4 additions & 7 deletions autode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import importlib.metadata

from autode import methods
from autode import geom
from autode import pes
Expand Down Expand Up @@ -25,14 +27,10 @@
from autode.utils import temporary_config

"""
Bumping the version number requires following the release proceedure:
- Update changelog (doc/changelog.rst)
Bumping the version number requires following the release procedure:
- Run tests/benchmark.py with both organic and organometallic sets
- Change __version__ here and in setup.py
- Release on conda-forge
- Fork https://github.com/conda-forge/autode-feedstock
- Make a local branch
Expand All @@ -41,8 +39,7 @@
- Merge when tests pass
"""

__version__ = "1.4.0"

__version__ = importlib.metadata.version("autode")

__all__ = [
"KeywordsSet",
Expand Down
5 changes: 0 additions & 5 deletions autode/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ def group(self) -> int:
"""

for group_idx in range(1, 18):

if self.label in PeriodicTable.group(group_idx):
return group_idx

Expand All @@ -242,7 +241,6 @@ def period(self) -> int:
"""

for period_idx in range(1, 7):

if self.label in PeriodicTable.period(period_idx):
return period_idx

Expand Down Expand Up @@ -692,7 +690,6 @@ def moi(self) -> MomentOfInertia:
moi = MomentOfInertia(np.zeros(shape=(3, 3)), units="amu Å^2")

for atom in self:

mass, (x, y, z) = atom.mass, atom.coord

moi[0, 0] += mass * (y**2 + z**2)
Expand Down Expand Up @@ -887,7 +884,6 @@ def are_planar(self, distance_tol: Distance = Distance(1e-3, "Å")) -> bool:
normal_vec = np.cross(arr[1, :] - x0, arr[2, :] - x0)

for i in range(3, len(self)):

# Calculate the 0->i atomic vector, which must not have any
# component in the direction in the normal if the atoms are planar
if np.dot(normal_vec, arr[i, :] - x0) > distance_tol_float:
Expand Down Expand Up @@ -1253,7 +1249,6 @@ def dihedral(self, w: int, x: int, y: int, z: int) -> Angle:


class PeriodicTable:

# fmt: off
table = np.array(
[['H', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'He'],
Expand Down
4 changes: 0 additions & 4 deletions autode/bond_rearrangement.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ def add_bond_rearrangment(bond_rearrangs, reactant, product, fbonds, bbonds):
bbond_atoms = [atom for bbond in bbonds for atom in bbond]
for fbond in fbonds:
for idx in fbond:

if (
reactant.graph.degree(idx)
== reactant.atoms[idx].maximal_valance
Expand Down Expand Up @@ -358,7 +357,6 @@ def get_fbonds_bbonds_2b(
for bbond1, bbond2 in itertools.product(
all_possible_bbonds[0], all_possible_bbonds[1]
):

possible_brs = add_bond_rearrangment(
possible_brs, reac, prod, fbonds=[], bbonds=[bbond1, bbond2]
)
Expand Down Expand Up @@ -672,7 +670,6 @@ def strip_equiv_bond_rearrs(possible_brs, mol, depth=6):

# Compare bond_rearrang to all those already considered to be unique,
for unique_br in unique_brs:

if unique_br.get_active_atom_neighbour_lists(
species=mol, depth=depth
) == br.get_active_atom_neighbour_lists(species=mol, depth=depth):
Expand Down Expand Up @@ -736,7 +733,6 @@ def prune_small_ring_rearrs(possible_brs, mol):

# Check against all other rearrangements
for j, other_br in enumerate(possible_brs):

# Only consider brs with the same set of elements
if elems[i] != elems[j]:
continue
Expand Down
9 changes: 4 additions & 5 deletions autode/bracket/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ def converged(self) -> bool:
"""Whether the bracketing method has converged or not"""
assert self.imgpair is not None, "Must have an image pair"

# NOTE: In bracketing methods, usually the geometry
# optimisation is done in separate micro-iterations,
# which means that the gradient tolerance is checked
# elsewhere, and only distance criteria is checked here
# NOTE: Usually geometry optimisation is done in separate
# micro-iters, so gradient is checked elsewhere
return self.imgpair.dist <= self._dist_tol

@property
Expand Down Expand Up @@ -175,6 +173,7 @@ def _calculate(
self._step()

if self.imgpair.has_jumped_over_barrier:
# TODO: implement image pair regeneration
logger.error(
"One image has probably jumped over the barrier, in"
f" {self._name} TS search. Please check the"
Expand Down Expand Up @@ -209,7 +208,7 @@ def _calculate(

self.print_geometries()
self.plot_energies()
if self.ts_guess is not None:
if self.converged and self.ts_guess is not None:
self.ts_guess.print_xyz_file(filename=f"{self._name}_ts_guess.xyz")
return None

Expand Down
3 changes: 3 additions & 0 deletions autode/bracket/dhs.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ def _get_dhs_step(self, side: ImageSide) -> CartesianCoordinates:
gs_step = np.zeros_like(dhs_step)
# hack to ensure the first step is 100% DHS (as GS is not possible)
dhs_step = dhs_step / (1 - self._gs_mix)
else:
# rescale GS step as well so that one vector doesn't dominate
gs_step *= self._step_size / np.linalg.norm(gs_step)

old_coord = self.imgpair.get_coord_by_side(side)
new_coord = (
Expand Down
Loading

0 comments on commit 1075b84

Please sign in to comment.