Merge pull request #36 from kousuke-nakano/crystal_to_trexio_converter #82
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 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 ==" | |
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 | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 1.0' | |
echo "=== Check TREXIO file converted from PySCF ===" | |
trexio check-mos -n 50 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 | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 1.0' | |
echo "=== Check TREXIO file converted from ORCA ===" | |
trexio check-mos -n 50 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 | |
python -c 'with open("error-res") as f: error = f.readline().strip(); assert float(error) < 1.0' | |
# benchmark helper converters | |
trexio convert-to -t molden -o trexio_molden.h5 trexio_gamess.h5 |