Bump version #114
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TOOLS CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test_tools: | |
runs-on: ubuntu-latest | |
name: x86 Ubuntu latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: create a virtual environment | |
run: | | |
python3 -m venv trexio_tools | |
source trexio_tools/bin/activate | |
- name: install dependencies | |
run: pip install -r requirements.txt | |
- name: install trexio_tools | |
run: pip install . | |
- name: check installation | |
run: trexio --help | |
- name: run tests | |
run: | | |
# benchmark the converters from external codes | |
echo "== Starting conversion ==" | |
trexio convert-from -t gaussian -i data/chbrclf.log -b hdf5 trexio_gaussi.h5 | |
trexio convert-from -t gamess -i data/GAMESS_CAS.log -b hdf5 trexio_gamess.h5 | |
trexio convert-from -t pyscf -i data/water.chk -b hdf5 trexio_pyscf_h2o_sph.h5 | |
trexio convert-from -t pyscf -i data/diamond_single_k.chk -b hdf5 trexio_pyscf_1k.h5 | |
trexio convert-from -t pyscf -i data/diamond_k_grid.chk -b hdf5 trexio_pyscf_Nk.h5 | |
trexio convert-from -t crystal -i data/crystal23_mgo_lda.out -m 1 -b hdf5 crystal.hdf5 | |
trexio convert-from -t orca -i data/h2o.json -b hdf5 trexio_orca_h2o_sph.h5 | |
trexio convert-to -t cartesian -o trexio_orca_h2o.h5 trexio_orca_h2o_sph.h5 | |
trexio convert-to -t cartesian -o trexio_pyscf_h2o.h5 trexio_pyscf_h2o_sph.h5 | |
echo "== Done conversion ==" | |
# dummy checks for overwriting | |
trexio convert-from -t gaussian -i data/chbrclf.log -b hdf5 -w False trexio_gaussi.h5 || echo "Failure as it should" | |
trexio convert-from -t gaussian -i data/chbrclf.log -b hdf5 -w True trexio_gaussi.h5 && echo "Success as it should" | |
echo "=== Check TREXIO file converted from GAMESS ===" | |
trexio check-mos -n 50 trexio_gamess.h5 > mos-res | |
grep "Norm of the error" < mos-res | grep -Eo "([0-9]+\.[0-9]*|\.?[0-9]+)([eE][+-][0-9]+)?" > error-res | |
cat error-res | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 0.12' | |
echo "=== Check TREXIO file converted from PySCF ===" | |
trexio check-mos -n 100 trexio_pyscf_h2o.h5 > mos-res | |
grep "Norm of the error" < mos-res | grep -Eo "([0-9]+\.[0-9]*|\.?[0-9]+)([eE][+-][0-9]+)?" > error-res | |
cat error-res | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 0.00018' | |
echo "=== Check TREXIO file converted from ORCA ===" | |
trexio check-mos -n 100 trexio_orca_h2o.h5 > mos-res | |
grep "Norm of the error" < mos-res | grep -Eo "([0-9]+\.[0-9]*|\.?[0-9]+)([eE][+-][0-9]+)?" > error-res | |
cat error-res | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 0.08' | |
# benchmark helper converters | |
trexio convert-to -t molden -o trexio_molden.h5 trexio_gamess.h5 | |
echo "=== Check normalization in spherical file ===" | |
trexio check-mos -n 100 data/methane_sphe.hdf5 > mos-res | |
grep "Norm of the error" < mos-res | grep -Eo "([0-9]+\.[0-9]*|\.?[0-9]+)([eE][+-][0-9]+)?" > error-res | |
cat error-res | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 0.0017' | |
echo "=== Check normalization after transformation into cartesian file ===" | |
trexio convert-to -t cartesian data/methane_sphe.hdf5 -o methane_cart.hdf5 | |
trexio check-mos -n 100 methane_cart.hdf5 > mos-res | |
grep "Norm of the error" < mos-res | grep -Eo "([0-9]+\.[0-9]*|\.?[0-9]+)([eE][+-][0-9]+)?" > error-res | |
cat error-res | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 0.0017' |