Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .github/workflows/pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
env:
coverage-on-version: "3.10"
use-mpi: True
PIP_CONSTRAINT: pip_constraint.txt
defaults:
run:
shell: bash -l {0}
Expand All @@ -40,13 +39,11 @@ jobs:

- name: Install dependencies from pip
run: |
echo "numpy<2" >> $PIP_CONSTRAINT
python3 -m pip install wheel setuptools numpy scipy click matplotlib pyyaml spglib rdkit==2024.3.3 flake8 pytest pytest-cov requests
python3 -c "import numpy; print('numpy version', numpy.__version__)"

- name: Install latest ASE from pypi
run: |
echo PIP_CONSTRAINT $PIP_CONSTRAINT
# avoid broken extxyz writing (3.25, fixed in 3.26)
# avoid broken optimizer.converged() (3.26) https://gitlab.com/ase/ase/-/issues/1744
python3 -m pip install 'ase<3.25'
Expand Down Expand Up @@ -83,9 +80,6 @@ jobs:
fi
source $mklvars intel64

# pip constraint needs to be an absolute filename
export PIP_CONSTRAINT=$PWD/$PIP_CONSTRAINT

git clone https://github.com/phonopy/phonopy
cd phonopy
echo python3 -m pip install -e . -vvv
Expand All @@ -103,14 +97,10 @@ jobs:
python3 -m pip install quippy-ase
python3 -c "import numpy; print('numpy version', numpy.__version__)"

- name: Install xTB (before things that need pandas like MACE and wfl, since it will break pandas-numpy compatibility by downgrading numpy)
- name: Install tblite
run: |
# force compatible numpy version
conda install 'numpy<2'
conda install -c conda-forge xtb-python
conda install -c conda-forge tblite-python
python3 -m pip install typing-extensions
# install pandas now to encourage compatible numpy version after conda regressed it
python3 -m pip install pandas
python3 -c "import numpy; print('numpy version', numpy.__version__)"

- name: MACE
Expand Down
20 changes: 9 additions & 11 deletions docs/source/examples.daisy_chain_mlip_fitting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,17 @@
" Installation: `pip install quippy-ase`\n",
"\n",
"\n",
"- GFN2-xTB: a semi-empirical method designed for molecular systems, used as a reference method. \n",
"- GFN2-xTB: a semi-empirical method designed for molecular systems, used as a reference method. We use the `tblite` implementation of GFN2-xTB. \n",
"\n",
" Documentation: \n",
" - https://xtb-docs.readthedocs.io/en/latest/contents.html\n",
" - https://xtb-python.readthedocs.io/en/latest/\n",
" Documentation: https://tblite.readthedocs.io/\n",
"\n",
" Installation: `conda install -c conda-forge xtb-python`\n",
" Installation: `conda install -c conda-forge tblite-python`\n",
"\n",
"- RDKit: a chemoinformatics package that wfl uses to convert 2D SMILES strings (e.g. \"CCO\" for ethanol) into 3D `Atoms` objects. \n",
"\n",
" Documentation: https://rdkit.org/\n",
"\n",
" Installation: `conda install -c conda-forge rdkit`\n"
" Installation: `conda install -c conda-forge rdkit`"
]
},
{
Expand All @@ -61,7 +59,7 @@
"\n",
"from ase import Atoms\n",
"\n",
"from xtb.ase.calculator import XTB\n",
"from tblite.ase import TBLite\n",
"\n",
"from quippy.potential import Potential\n",
"\n",
Expand Down Expand Up @@ -103,9 +101,9 @@
"\n",
"`(Initalizer, [args], {kwargs})`\n",
"\n",
"e.g. xtb would normally be called with \n",
"e.g. GFN2-xTB would normally be called with \n",
"\n",
"`xtb_calc = XTB(method=\"GFN2-xTB\")`\n",
"`xtb_calc = TBLite(method=\"GFN2-xTB\")`\n",
"\n",
"but instead in wfl scripts we define it as"
]
Expand All @@ -116,7 +114,7 @@
"metadata": {},
"outputs": [],
"source": [
"xtb_calc = (XTB, [], {\"method\": \"GFN2-xTB\"})"
"xtb_calc = (TBLite, [], {\"method\": \"GFN2-xTB\"})"
]
},
{
Expand Down Expand Up @@ -673,4 +671,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
2 changes: 1 addition & 1 deletion docs/source/examples.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Examples often show examples of more than one thing. Below is a list of common o
- EMT:
- [First example](first_example.md)
- [Iterative GAP fitting ](examples.mlip_fitting.md)
- XTB:
- GFN2-xTB:
- [Normal Modes of molecules](examples.normal_modes.md)
- [Molecular Dynamics](examples.md.md)
- [GAP fit workflow with many wfl use-case examples ](examples.daisy_chain_mlip_fitting.ipynb)
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples.md.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following script takes atomic structures from "configs.xyz", runs Berendsen

```
import os
from xtb.ase.calculator import XTB
from tblite.ase import TBLite
from expyre.resources import Resources
from wfl.autoparallelize import RemoteInfo
from wfl.autoparallelize import AutoparaInfo
Expand Down Expand Up @@ -39,7 +39,7 @@ remote_info = RemoteInfo(
pre_cmds = ["conda activate my-env"]
)

calc = (XTB, [], {'method':'GFN2-xTB'})
calc = (TBLite, [], {'method':'GFN2-xTB'})

ci = ConfigSet(input_fname)
co = OutputSpec(out_fname)
Expand All @@ -49,7 +49,7 @@ co = OutputSpec(out_fname)
# script would make it create and submit new jobs rather than monitor the ones already running.
os.environ["WFL_DETERMINISTIC_HACK"] = "true"

# xTB has some internal parallelisation that needs turning off by setting this env. variable.
# GFN2-xTB uses OpenMP internally, which clashes with the multiprocessing.pool parallelisation wfl uses, so turn it off.
os.environ["OMP_NUM_THREADS"] = "1"

ci = md.md(
Expand Down
10 changes: 5 additions & 5 deletions docs/source/examples.normal_modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ Workflow can numerically generate normal modes of a molecule with specified calc

## Generate

The following script generates normal modes of methane and water with a [xTB](https://xtb-python.readthedocs.io/en/latest/index.html) calculator. The unit normal mode displacements are stored in `Atoms.arrays` and associated frequencies in `Atoms.info`.
The following script generates normal modes of methane and water with a [GFN2-xTB](https://tblite.readthedocs.io/) calculator. The unit normal mode displacements are stored in `Atoms.arrays` and associated frequencies in `Atoms.info`.

```python
from ase.build import molecule
from xtb.ase.calculator import XTB
from tblite.ase import TBLite
from wfl.configset import ConfigSet, OutputSpec
from wfl.generate import normal_modes as nm

mols = [molecule("CH4"), molecule("H2O")]
configset = ConfigSet(mols)
outputspec = OutputSpec("molecules.normal_modes.xyz")

calc = (XTB, [], {'method':'GFN2-xTB'})
calc = (TBLite, [], {'method':'GFN2-xTB'})
prop_prefix = 'xtb2_'

nm.generate_normal_modes_parallel_hessian(inputs=configset,
Expand All @@ -34,7 +34,7 @@ To generate normal modes via finite differences, each of N atoms are displaced b

```python
from ase.build import molecule
from xtb.ase.calculator import XTB
from tblite.ase import TBLite
from wfl.configset import ConfigSet, OutputSpec
from wfl.generate import normal_modes as nm
from wfl.autoparallelize import AutoparaInfo
Expand All @@ -43,7 +43,7 @@ mols = [molecule("CH4"), molecule("H2O")]
configset = ConfigSet(mols)
outputspec = OutputSpec("molecules.normal_modes.xyz")

calc = (XTB, [], {'method':'GFN2-xTB'})
calc = (TBLite, [], {'method':'GFN2-xTB'})
prop_prefix = 'xtb2_'

nm.generate_normal_modes_parallel_atoms(inputs=configset,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name = "wfl"
requires-python = ">=3.9"
dependencies = [ "click>=7.0", "numpy<2", "ase>=3.22.1", "pyyaml", "spglib",
dependencies = [ "click>=7.0", "numpy>=1.23", "ase>=3.22.1", "pyyaml", "spglib",
"docstring_parser", "expyre-wfl", "universalSOAP", "pandas" ]
readme = "README.md"
license = { file = "LICENSE" }
Expand Down
2 changes: 1 addition & 1 deletion tests/conda-build/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ requirements:

run:
- python
- numpy=1.19
- numpy>=1.23
- ase
- scipy
- click
Expand Down
2 changes: 1 addition & 1 deletion wfl/generate/supercells.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _largest_isotropic_supercell(at, max_n_atoms, vary_cell_vectors=None):
min_cell_i = np.argmin(np.linalg.norm(t_cell[vary_cell_vectors], axis=1))
min_cell_i = vary_cell_vectors[min_cell_i]
n_dups[min_cell_i] += 1
if np.product(n_dups) * len(at) > max_n_atoms:
if np.prod(n_dups) * len(at) > max_n_atoms:
n_dups[min_cell_i] -= 1
break
return n_dups
Expand Down
2 changes: 1 addition & 1 deletion wfl/select/flat_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _select_by_bin(weights, bin_edges, quantities, n, rng, kT=-1.0, replace=Fals
raise ValueError("Not defined for non-positive n")

if kT is None or kT <= 0:
kT = np.Infinity
kT = np.inf

bin_centers = 0.5 * (bin_edges[:-1] + bin_edges[1:])
bin_centers -= bin_centers[0]
Expand Down
2 changes: 1 addition & 1 deletion wfl/utils/ndim_neighbor_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def calc_list_cells(positions, ranges, Cartesian_distance=True):

# First configs in pair.
_first_at_neightuple_n = configs_in_bin_ba[:, config_pairs_pn[0]]
for i_offset in range(np.product(2 * neigh_search + 1)):
for i_offset in range(np.prod(2 * neigh_search + 1)):
dD = []
for i_dim in range(n_dims):
dD.append(i_offset % (2 * neigh_search[i_dim] + 1))
Expand Down
Loading