Skip to content

Commit 1075b84

Browse files
authored
Merge pull request #308 from duartegroup/v1.4.1
V1.4.1
2 parents 4d66675 + dafe17f commit 1075b84

File tree

166 files changed

+1791
-1294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+1791
-1294
lines changed

.github/workflows/pytest.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,19 @@ jobs:
3535
with:
3636
python-version: ${{ matrix.python-version }}
3737
activate-environment: test
38-
mamba-version: "*"
3938
channels: conda-forge
4039

40+
- name: Install mamba solver
41+
run: |
42+
conda install -n base conda-libmamba-solver
43+
4144
- name: Install
4245
run: |
43-
mamba install \
46+
conda install \
4447
--file requirements.txt \
4548
--file tests/requirements.txt \
46-
--channel conda-forge
49+
--channel conda-forge \
50+
--solver=libmamba
4751
python -m pip install . --no-deps
4852
4953
- name: Test

.github/workflows/pytest_cov.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,19 @@ jobs:
3636
with:
3737
python-version: ${{ matrix.python-version }}
3838
activate-environment: test
39-
mamba-version: "*"
4039
channels: conda-forge
4140

41+
- name: Install mamba solver
42+
run: |
43+
conda install -n base conda-libmamba-solver
44+
4245
- name: Install
4346
run: |
44-
mamba install \
47+
conda install \
4548
--file requirements.txt \
4649
--file tests/requirements.txt \
47-
--channel conda-forge
50+
--channel conda-forge \
51+
--solver=libmamba
4852
source .github/scripts/install_xtb_ci.sh
4953
python -m pip install . --no-deps
5054

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.2.0
3+
rev: v4.4.0
44
hooks:
55
- id: trailing-whitespace
66
- id: mixed-line-ending
77

88
- repo: https://github.com/psf/black
9-
rev: 22.10.0
9+
rev: 23.9.1
1010
hooks:
1111
- id: black
1212
language_version: python3
1313

1414
- repo: https://github.com/pre-commit/mirrors-mypy
15-
rev: v1.0.1
15+
rev: v1.5.1
1616
hooks:
1717
- id: mypy
1818
exclude: "tests/|doc/|examples/"

autode/__init__.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import importlib.metadata
2+
13
from autode import methods
24
from autode import geom
35
from autode import pes
@@ -25,14 +27,10 @@
2527
from autode.utils import temporary_config
2628

2729
"""
28-
Bumping the version number requires following the release proceedure:
29-
30-
- Update changelog (doc/changelog.rst)
30+
Bumping the version number requires following the release procedure:
3131
3232
- Run tests/benchmark.py with both organic and organometallic sets
3333
34-
- Change __version__ here and in setup.py
35-
3634
- Release on conda-forge
3735
- Fork https://github.com/conda-forge/autode-feedstock
3836
- Make a local branch
@@ -41,8 +39,7 @@
4139
- Merge when tests pass
4240
"""
4341

44-
__version__ = "1.4.0"
45-
42+
__version__ = importlib.metadata.version("autode")
4643

4744
__all__ = [
4845
"KeywordsSet",

autode/atoms.py

-5
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ def group(self) -> int:
219219
"""
220220

221221
for group_idx in range(1, 18):
222-
223222
if self.label in PeriodicTable.group(group_idx):
224223
return group_idx
225224

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

244243
for period_idx in range(1, 7):
245-
246244
if self.label in PeriodicTable.period(period_idx):
247245
return period_idx
248246

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

694692
for atom in self:
695-
696693
mass, (x, y, z) = atom.mass, atom.coord
697694

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

889886
for i in range(3, len(self)):
890-
891887
# Calculate the 0->i atomic vector, which must not have any
892888
# component in the direction in the normal if the atoms are planar
893889
if np.dot(normal_vec, arr[i, :] - x0) > distance_tol_float:
@@ -1253,7 +1249,6 @@ def dihedral(self, w: int, x: int, y: int, z: int) -> Angle:
12531249

12541250

12551251
class PeriodicTable:
1256-
12571252
# fmt: off
12581253
table = np.array(
12591254
[['H', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'He'],

autode/bond_rearrangement.py

-4
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ def add_bond_rearrangment(bond_rearrangs, reactant, product, fbonds, bbonds):
246246
bbond_atoms = [atom for bbond in bbonds for atom in bbond]
247247
for fbond in fbonds:
248248
for idx in fbond:
249-
250249
if (
251250
reactant.graph.degree(idx)
252251
== reactant.atoms[idx].maximal_valance
@@ -358,7 +357,6 @@ def get_fbonds_bbonds_2b(
358357
for bbond1, bbond2 in itertools.product(
359358
all_possible_bbonds[0], all_possible_bbonds[1]
360359
):
361-
362360
possible_brs = add_bond_rearrangment(
363361
possible_brs, reac, prod, fbonds=[], bbonds=[bbond1, bbond2]
364362
)
@@ -672,7 +670,6 @@ def strip_equiv_bond_rearrs(possible_brs, mol, depth=6):
672670

673671
# Compare bond_rearrang to all those already considered to be unique,
674672
for unique_br in unique_brs:
675-
676673
if unique_br.get_active_atom_neighbour_lists(
677674
species=mol, depth=depth
678675
) == br.get_active_atom_neighbour_lists(species=mol, depth=depth):
@@ -736,7 +733,6 @@ def prune_small_ring_rearrs(possible_brs, mol):
736733

737734
# Check against all other rearrangements
738735
for j, other_br in enumerate(possible_brs):
739-
740736
# Only consider brs with the same set of elements
741737
if elems[i] != elems[j]:
742738
continue

autode/bracket/base.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ def converged(self) -> bool:
7676
"""Whether the bracketing method has converged or not"""
7777
assert self.imgpair is not None, "Must have an image pair"
7878

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

8583
@property
@@ -175,6 +173,7 @@ def _calculate(
175173
self._step()
176174

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

210209
self.print_geometries()
211210
self.plot_energies()
212-
if self.ts_guess is not None:
211+
if self.converged and self.ts_guess is not None:
213212
self.ts_guess.print_xyz_file(filename=f"{self._name}_ts_guess.xyz")
214213
return None
215214

autode/bracket/dhs.py

+3
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,9 @@ def _get_dhs_step(self, side: ImageSide) -> CartesianCoordinates:
715715
gs_step = np.zeros_like(dhs_step)
716716
# hack to ensure the first step is 100% DHS (as GS is not possible)
717717
dhs_step = dhs_step / (1 - self._gs_mix)
718+
else:
719+
# rescale GS step as well so that one vector doesn't dominate
720+
gs_step *= self._step_size / np.linalg.norm(gs_step)
718721

719722
old_coord = self.imgpair.get_coord_by_side(side)
720723
new_coord = (

0 commit comments

Comments
 (0)