Skip to content

Commit

Permalink
Merge branch 'main' into castep-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gelzinyte committed Jul 30, 2024
2 parents 426bd37 + aa1411e commit 2367ddf
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 34 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,12 @@ jobs:
git clone https://github.com/phonopy/phonopy
cd phonopy
python3 setup.py build
python3 -m pip install .
python3 -m pip install -e .
cd ..
git clone https://github.com/phonopy/phono3py
cd phono3py
python3 setup.py build
python3 setup.py install
python3 -m pip install -e .
cd ..
- name: Install Quippy from PyPI
Expand Down
59 changes: 37 additions & 22 deletions .github/workflows/pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
env:
coverage-on-version: "3.9"
use-mpi: True
PIP_CONSTRAINT: pip_constraint.txt
defaults:
run:
shell: bash -l {0}
Expand All @@ -38,10 +39,13 @@ jobs:
python3 --version
- name: Install dependencies from pip
run: python3 -m pip install wheel setuptools numpy scipy click matplotlib pyyaml spglib rdkit flake8 pytest pytest-cov requests
run: |
echo "numpy<2" >> $PIP_CONSTRAINT
python3 -m pip install wheel setuptools numpy scipy click matplotlib pyyaml spglib rdkit flake8 pytest pytest-cov requests
- name: Install latest ASE from gitlab
- name: Install latest ASE from pypi
run: |
echo PIP_CONSTRAINT $PIP_CONSTRAINT
python3 -m pip install ase
echo -n "ASE VERSION "
python3 -c "import ase; print(ase.__file__, ase.__version__)"
Expand All @@ -62,27 +66,28 @@ jobs:
run: |
# find mklvars
for pkg in $( apt list --installed | fgrep "installed" | fgrep "mkl" | sed "s#/.*##" ); do
if dpkg -L $pkg | egrep -q 'vars.sh$'; then
mklvars=$( dpkg -L $pkg | egrep 'vars.sh$' )
if dpkg -L $pkg | egrep -q 'env/vars.sh$'; then
mklvars=$( dpkg -L $pkg | egrep 'env/vars.sh$' )
break
fi
done
if [ -z $mklvars ]; then
echo 'Failed to find *vars.sh in any pkg named *mkl*'
if [ $( echo $mklvars | wc -w ) != 1 ]; then
echo "wrong number of mkl setvars.sh '$mklvars'" 1>&2
exit 1
fi
source $mklvars intel64
export PIP_CONSTRAINT=$PWD/$PIP_CONSTRAINT
git clone https://github.com/phonopy/phonopy
cd phonopy
python3 setup.py build
python3 -m pip install .
echo python3 -m pip install -e . -vvv
python3 -m pip install -e . -vvv
cd ..
git clone https://github.com/phonopy/phono3py
cd phono3py
python3 setup.py build
python3 setup.py install
python3 -m pip install -e . -vvv
cd ..
- name: Install Quippy from PyPI
Expand All @@ -99,16 +104,32 @@ jobs:
run: |
echo "search for torch version"
set +o pipefail
torch_version=$( python3 -m pip install torch== 2>&1 | fgrep 'from versions' | sed -e 's/.* //' -e 's/)//' )
echo "found torch version $torch_version, installing cpu-only variant"
# search for available torch version with +cpu support
for torch_version_test in $( python3 -m pip install torch== 2>&1 | fgrep 'from versions' |
sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac ); do
set +e
python3 -m pip install --dry-run torch==${torch_version_test}+cpu \
-f https://download.pytorch.org/whl/torch_stable.html > /dev/null 2>&1
search_stat=$?
set -e
if [ $search_stat == 0 ]; then
torch_version=${torch_version_test}
break
fi
done
if [ -z $torch_version ]; then
echo "Failed to find any pytorch version with +cpu variant" 1>&2
exit 1
fi
echo "found torch version ${torch_version}+cpu, installing"
python3 -m pip install torch==${torch_version}+cpu -f https://download.pytorch.org/whl/torch_stable.html
echo "installing mace"
python3 -m pip install git+https://github.com/ACEsuit/mace.git@main
python3 -c "import mace; print(mace.__file__)"
- name: Julia and ace fit
run: |
python3 -m pip install pip install threadpoolctl
python3 -m pip install threadpoolctl
wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.1-linux-x86_64.tar.gz
tar xzf julia-1.8.1-linux-x86_64.tar.gz
# note that this hardwires a particular compatible ACE1pack version
Expand All @@ -124,11 +145,9 @@ jobs:
- name: Install MOPAC
run: |
wget https://github.com/openmopac/mopac/releases/download/v22.0.6/mopac-22.0.6-linux.tar.gz
tar -xzvf mopac-22.0.6-linux.tar.gz
- name: add mopac to path
run: echo $GITHUB_WORKSPACE/mopac-22.0.6-linux/bin >> $GITHUB_PATH
wget http://openmopac.net/mopac-22.1.1-linux.tar.gz
tar -xzvf mopac-22.1.1-linux.tar.gz
echo $GITHUB_WORKSPACE/mopac-22.1.1-linux/bin >> $GITHUB_PATH
- name: Install buildcell
run: |
Expand Down Expand Up @@ -205,10 +224,6 @@ jobs:
- name: Test with pytest - coverage
if: env.coverage-on-version == matrix.python-version
run: |
echo "BOB pre actual pytest"
which python3
python3 -m pip list | grep numpy
python3 -c "import numpy; print(numpy.__file__, numpy.__version__)"
rm -rf $HOME/pytest_cov
mkdir $HOME/pytest_cov
#
Expand Down
13 changes: 6 additions & 7 deletions docs/source/examples.daisy_chain_mlip_fitting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,13 @@
"\n",
"ref_errors = {\n",
" 'atomization_energy/atom': {\n",
" 'train': {'RMSE': 0.026086070005729697, 'MAE': 0.02188233965637977, 'count': 50},\n",
" '_ALL_': {'RMSE': 0.02631013293566519, 'MAE': 0.02217457525203221, 'count': 100},\n",
" 'test': {'RMSE': 0.026532303741682858, 'MAE': 0.02246681084768465, 'count': 50}},\n",
" 'train': {'RMSE': 0.020425437431681327, 'MAE': 0.016212666323964592, 'count': 50}, \n",
" '_ALL_': {'RMSE': 0.01965484792256244, 'MAE': 0.015378010911287552, 'count': 100}, \n",
" 'test': {'RMSE': 0.01885278757750655, 'MAE': 0.014543355498610513, 'count': 50}}, \n",
" 'forces/comp': {\n",
" 'train': {'RMSE': 0.6700484048236104, 'MAE': 0.48912067870708253, 'count': 5097},\n",
" '_ALL_': {'RMSE': 0.674843619212047, 'MAE': 0.49305958821652923, 'count': 10188},\n",
" 'test': {'RMSE': 0.6796105918104188, 'MAE': 0.49700313992928696, 'count': 5091}}\n",
"}\n",
" 'train': {'RMSE': 0.6318812940305143, 'MAE': 0.4633571169452562, 'count': 5133},\n",
" '_ALL_': {'RMSE': 0.6455044814693653, 'MAE': 0.4741960245074422, 'count': 10212}, \n",
" 'test': {'RMSE': 0.6589864341996843, 'MAE': 0.48515017148848205, 'count': 5079}}}\n",
"\n",
"print(errors)\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "wfl"
version = "0.3.0"
requires-python = ">=3.9"
dependencies = [ "click>=7.0", "numpy", "ase>=3.22.1", "pyyaml", "spglib",
dependencies = [ "click>=7.0", "numpy<2", "ase>=3.22.1", "pyyaml", "spglib",
"docstring_parser", "expyre-wfl", "universalSOAP" ]
readme = "README.md"
license = { file = "LICENSE" }
Expand Down
3 changes: 3 additions & 0 deletions tests/local_scripts/gelzinyte.workstation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

export ASE_CONFIG_PATH=${HOME}/.config/ase/pytest.config.ini

# MOPAC isn't updated with the profile
export ASE_MOPAC_COMMAND="${HOME}/programs/mopac-22.1.1-linux/bin/mopac PREFIX.mop 2> /dev/null"

# Aims
pytest -v -s -rxXs ../calculators/test_aims.py

0 comments on commit 2367ddf

Please sign in to comment.