-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a2ea7a
commit 655c0ae
Showing
3 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
export OMP_NUM_THREADS=2 | ||
export PYTHONPATH=$(pwd):$PYTHONPATH | ||
ulimit -s 20000 | ||
|
||
version=$(python -c 'import sys; print("{0}.{1}".format(*sys.version_info[:2]))') | ||
PYTHONHASHSEED=0 pytest ciderpress/ -s -c pytest.ini ciderpress |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Run PySCF Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
pull_request: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup conda environment | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
micromamba-version: '1.5.6-0' # any version from https://github.com/mamba-org/micromamba-releases | ||
environment-file: nocomp_env.yml | ||
environment-name: run_tests | ||
init-shell: >- | ||
bash | ||
powershell | ||
cache-environment: true | ||
post-cleanup: 'all' | ||
create-args: >- | ||
python=3.10 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install dependencies and build | ||
run: | | ||
sudo apt-get -qq install gcc libblas-dev cmake | ||
- name: Build things | ||
run: | | ||
source .github/workflows/load_conda.sh | ||
python setup.py build_ext --inplace | ||
python scripts/download_functionals.py | ||
- name: Test with unittest | ||
run: | | ||
# See https://github.com/pytest-dev/pytest/issues/1075 | ||
source .github/workflows/load_conda.sh | ||
sh .github/workflows/run_tests.sh | ||
# PYTHONHASHSEED=0 OMP_NUM_THREADS=2 python -m unittest discover ciderpress/dft/tests/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python | ||
# CiderPress: Machine-learning based density functional theory calculations | ||
# Copyright (C) 2024 The President and Fellows of Harvard College | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/> | ||
# | ||
# Author: Kyle Bystrom <kylebystrom@gmail.com> | ||
# | ||
|
||
import os | ||
import subprocess | ||
|
||
basedir = __file__ | ||
savedir = os.path.basename(os.path.join(basedir, "../functionals")) | ||
|
||
os.makedirs(savedir, exist_ok=True) | ||
|
||
links = { | ||
"NL_GGA": "1UNxxvYpxc8RkywxIynbenkLEMGviIce1", | ||
"NL_MGGA_DTR": "1-233LBivti-UDfbSuOMdPZuyC_Gibto0", | ||
"NL_MGGA_PBE": "15x8s_Pf3_iYoAHl_sWChB2q1HFif1jFA", | ||
"NL_MGGA": "1wwYFSJsZX_jhBSlsXVeggQutODXC2KP0", | ||
"SL_GGA": "1qD_IpXQNYUbT8Y7nLt4e4pA1E1dNntu7", | ||
"SL_MGGA": "18OFNglYpcPXHzXwFcRXeJn9VCLFtC7Zd", | ||
} | ||
|
||
os.chdir(savedir) | ||
cmd = "wget --no-check-certificate 'https://docs.google.com/uc?export=download&id={}' -O {}" | ||
for name, linkid in links.items(): | ||
fname = "CIDER23_{}.yaml".format(name) | ||
mycmd = cmd.format(linkid, fname) | ||
subprocess.call(mycmd, shell=True) |