Skip to content

Commit

Permalink
Separate caching for block2
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunWeatherly committed Jan 17, 2025
1 parent 4778738 commit ef240f9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/quemb_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ jobs:
if: steps.restore-quemb-cache.outputs.cache-hit != 'true'
run: |
pip install -r tests/test_requirements.txt
PYSCFHOME=$(pip show pyscf-dmrgscf | grep 'Location' | tr ' ' '\n' | tail -n 1)
cp src/quemb/shared/external/dmrgscf_settings.py ${PYSCFHOME}/pyscf/dmrgscf/settings.py
pip install .
- name: Save quemb Cache
Expand All @@ -130,6 +128,31 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: ${{ steps.restore-quemb-cache.outputs.cache-primary-key }}

- name: Restore block2 Cache
id: restore-block2-cache
uses: actions/cache/restore@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ runner.OS }}-block2-cache-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}-${{ hashFiles('tests/test_requirements.txt') }}}}

- name: Install block2
if: steps.restore-block2-cache.outputs.cache-hit != 'true'
run: |
pip install mkl==2025.0.1
pip install pybind11
pip install block2 --extra-index-url=https://block-hczhai.github.io/block2-preview/pypi/
pip install git+https://github.com/pyscf/dmrgscf
PYSCFHOME=$(pip show pyscf-dmrgscf | grep 'Location' | tr ' ' '\n' | tail -n 1)
cp src/quemb/shared/external/dmrgscf_settings.py ${PYSCFHOME}/pyscf/dmrgscf/settings.py
pip install .
- name: Save block2 Cache
id: save-block2-cache
uses: actions/cache/save@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ steps.restore-block2-cache.outputs.cache-primary-key }}


- name: Test with pytest
Expand Down
3 changes: 0 additions & 3 deletions tests/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# the additional (!) requirements for testing the code
# the dependencies of `quemb` itself are given in the setup.py
mkl==2025.0.1
block2
git+https://github.com/pyscf/dmrgscf
pytest

0 comments on commit ef240f9

Please sign in to comment.