Skip to content

Commit e6194cf

Browse files
committed
update testing notebooks that require expyre
1 parent 16f6040 commit e6194cf

File tree

2 files changed

+43
-45
lines changed

2 files changed

+43
-45
lines changed

.github/workflows/pytests.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -44,41 +44,41 @@ jobs:
4444
- name: Install latest ASE from gitlab
4545
run: pip install git+https://gitlab.com/ase/ase.git
4646

47-
- name: Install intel-mkl-full for phono3py
48-
run: |
49-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
50-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
51-
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
52-
sudo apt-get update
53-
sudo apt-get install intel-mkl-64bit-2018.2-046
54-
55-
- name: Install phono3py from source
56-
run: |
57-
source /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/bin/mklvars.sh intel64
58-
59-
git clone https://github.com/phonopy/phonopy
60-
cd phonopy
61-
python3 setup.py build
62-
python3 -m pip install .
63-
cd ..
64-
65-
git clone https://github.com/phonopy/phono3py
66-
cd phono3py
67-
python3 setup.py build
68-
python3 setup.py install
69-
cd ..
47+
# - name: Install intel-mkl-full for phono3py
48+
# run: |
49+
# wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
50+
# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
51+
# sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
52+
# sudo apt-get update
53+
# sudo apt-get install intel-mkl-64bit-2018.2-046
54+
55+
# - name: Install phono3py from source
56+
# run: |
57+
# source /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/bin/mklvars.sh intel64
58+
59+
# git clone https://github.com/phonopy/phonopy
60+
# cd phonopy
61+
# python3 setup.py build
62+
# python3 -m pip install .
63+
# cd ..
64+
65+
# git clone https://github.com/phonopy/phono3py
66+
# cd phono3py
67+
# python3 setup.py build
68+
# python3 setup.py install
69+
# cd ..
7070

7171
- name: Install Quippy from PyPI
7272
run: pip install quippy-ase
7373

74-
- name: Julia and ace fit
75-
run: |
76-
pip install pip install threadpoolctl
77-
wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.1-linux-x86_64.tar.gz
78-
tar xzf julia-1.8.1-linux-x86_64.tar.gz
79-
# note that this hardwires a particular compatible ACE1pack version
80-
echo 'using Pkg; pkg"registry add https://github.com/JuliaRegistries/General"; pkg"registry add https://github.com/JuliaMolSim/MolSim.git"; pkg"add [email protected], ACE1, JuLIP, IPFitting, ASE"' > ace1pack_install.jl
81-
${PWD}/julia-1.8.1/bin/julia ace1pack_install.jl
74+
# - name: Julia and ace fit
75+
# run: |
76+
# pip install pip install threadpoolctl
77+
# wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.1-linux-x86_64.tar.gz
78+
# tar xzf julia-1.8.1-linux-x86_64.tar.gz
79+
# # note that this hardwires a particular compatible ACE1pack version
80+
# echo 'using Pkg; pkg"registry add https://github.com/JuliaRegistries/General"; pkg"registry add https://github.com/JuliaMolSim/MolSim.git"; pkg"add [email protected], ACE1, JuLIP, IPFitting, ASE"' > ace1pack_install.jl
81+
# ${PWD}/julia-1.8.1/bin/julia ace1pack_install.jl
8282

8383
- name: Install wfl (expyre and universalSOAP are dependencies)
8484
run: pip install .

tests/test_doc_examples.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import shutil
33
import json
44
import pytest
5-
import expyre
5+
from expyre import config
66

77
from .calculators.test_aims import aims_prerequisites
88

@@ -13,26 +13,24 @@ def _get_coding_blocks(nb_file):
1313
nb = json.load(fo)
1414
return [''.join(cell['source']) for cell in nb['cells'] if cell['cell_type'] == 'code']
1515

16-
github_slurm_config = pytest.mark.skipif(
17-
condition = "github" not in expyre.config.systems,
18-
reason="Missing configuration file for remote execution"
19-
)
20-
2116

2217
@pytest.mark.parametrize(
23-
('nb_file', 'idx_execute'),
18+
('nb_file', 'idx_execute', 'needs_expyre'),
2419
(
25-
pytest.param('examples.buildcell.ipynb', 'all', id='buildcell',
20+
pytest.param('examples.buildcell.ipynb', 'all', False, id='buildcell',
2621
marks=pytest.mark.skipif(not shutil.which("buildcell"), reason="buildcell not in PATH")),
27-
pytest.param('examples.dimers.ipynb', 'all', id='dimer structures'),
28-
pytest.param('examples.select_fps.ipynb', 'all', id='select fps'),
29-
pytest.param('examples.fhiaims_calculator.ipynb', 'all', id='fhiaims_calculator',
22+
pytest.param('examples.dimers.ipynb', 'all', False, id='dimer structures'),
23+
pytest.param('examples.select_fps.ipynb', 'all', False, id='select fps'),
24+
pytest.param('examples.fhiaims_calculator.ipynb', 'all', False, id='fhiaims_calculator',
3025
marks=aims_prerequisites),
31-
pytest.param("examples.daisy_chain_mlip_fitting.ipynb", "all", id="daisy_chain_mlip_fitting",
32-
marks=github_slurm_config)
26+
pytest.param("examples.daisy_chain_mlip_fitting.ipynb", "all", False, id="daisy_chain_mlip_fitting")
3327
)
3428
)
35-
def test_example(tmp_path, nb_file, idx_execute, monkeypatch):
29+
def test_example(tmp_path, nb_file, idx_execute, monkeypatch, needs_expyre, expyre_systems):
30+
if needs_expyre and "github" not in expyre_systems:
31+
print(f'Notebook {nb_file} requires ExPyRe, but system "github" is not in config.json or'
32+
f'"EXPYRE_PYTEST_SYSTEMS" environment variable.')
33+
return
3634
print("running test_example", nb_file)
3735
basepath = os.path.join(f'{os.path.dirname(__file__)}/../docs/source')
3836
coding_blocks = _get_coding_blocks(f'{basepath}/{nb_file}')

0 commit comments

Comments
 (0)