Skip to content

Commit

Permalink
Merge pull request #104 from BoothGroup/ci_update
Browse files Browse the repository at this point in the history
Adds bare run, drops 3.7, adds 3.11 to CI
  • Loading branch information
cjcscott committed Jun 22, 2023
2 parents 5627e55 + f3024a6 commit 43395d6
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ on:
- cron: '0 2 * * *'

jobs:
build:
full:
name: python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- {python-version: "3.7", os: ubuntu-latest, documentation: False}
- {python-version: "3.8", os: ubuntu-latest, documentation: True}
- {python-version: "3.9", os: ubuntu-latest, documentation: False}
- {python-version: "3.10", os: ubuntu-latest, documentation: False}
- {python-version: "3.11", os: ubuntu-latest, documentation: False}

steps:
- uses: actions/checkout@v2
Expand All @@ -34,7 +34,7 @@ jobs:
run: |
python -m pip install wheel --user
python -m pip install setuptools --upgrade --user
python -m pip install .[dmet] --user
python -m pip install .[dmet,ebcc] --user
- name: Run unit tests
run: |
python -m pip install pytest pytest-cov --user
Expand All @@ -61,3 +61,29 @@ jobs:
force_orphan: true
if: ${{ matrix.documentation && github.ref == 'refs/heads/master' && github.event_name != 'schedule' }}

bare:
name: python 3.8 on ubuntu-latest with no optional dependencies
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install Vayesta
run: |
python -m pip install wheel --user
python -m pip install setuptools --upgrade --user
python -m pip install . --user
- name: Run unit tests
run: |
python -m pip install pytest pytest-cov --user
python .github/workflows/run_tests.py
9 changes: 9 additions & 0 deletions vayesta/tests/dmet/test_hubbard.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys
import pytest
import unittest
from vayesta import dmet
from vayesta.tests.common import TestCase
Expand All @@ -8,6 +10,13 @@ class HubbardDMETTests(TestCase):
PLACES_ENERGY = 6
CONV_TOL = 1e-8

@classmethod
def setUpClass(cls):
try:
import cvxpy
except ImportError:
pytest.skip("Requires cvxpy")

def _test_converged(self, emb, known_values=None):
"""Test that the DMET has converged.
"""
Expand Down
6 changes: 6 additions & 0 deletions vayesta/tests/dmet/test_molecule.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys
import pytest
import unittest
from vayesta import dmet
from vayesta.tests.common import TestCase
Expand All @@ -12,6 +14,10 @@ class MoleculeTest(TestCase):

@classmethod
def setUpClass(cls):
try:
import cvxpy
except ImportError:
pytest.skip("Requires cvxpy")
cls.mf = testsystems.h6_sto6g.rhf()

@classmethod
Expand Down
9 changes: 9 additions & 0 deletions vayesta/tests/edmet/test_dfedmet_hubbard.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys
import pytest
import unittest

from vayesta import edmet
Expand All @@ -8,6 +10,13 @@
class HubbardDFEDMETTests(TestCase):
PLACES_ENERGY = 9

@classmethod
def setUpClass(cls):
try:
import cvxpy
except ImportError:
pytest.skip("Requires cvxpy")

def _test_energy(self, emb, dfedmet, known_values):
"""Test that the energy contributions match a known value and the non-density fitted value.
"""
Expand Down
9 changes: 9 additions & 0 deletions vayesta/tests/edmet/test_dfedmet_molecule.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys
import pytest
import unittest

import vayesta
Expand All @@ -9,6 +11,13 @@ class MolecularDFEDMETTest(TestCase):
ENERGY_PLACES = 8
CONV_TOL = 1e-9

@classmethod
def setUpClass(cls):
try:
import cvxpy
except ImportError:
pytest.skip("Requires cvxpy")

def _test_energy(self, emb, known_values):
"""Tests that the energy matfhes a known values.
"""
Expand Down
9 changes: 9 additions & 0 deletions vayesta/tests/edmet/test_edmet_hubbard.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys
import pytest
import unittest

from vayesta import edmet
Expand All @@ -8,6 +10,13 @@
class EDMET_Hubbard_Tests(TestCase):
PLACES_ENERGY = 6

@classmethod
def setUpClass(cls):
try:
import cvxpy
except ImportError:
pytest.skip("Requires cvxpy")

def _test_energy(self, emb, known_values):
"""Test that the energy matches a known value.
"""
Expand Down
9 changes: 9 additions & 0 deletions vayesta/tests/edmet/test_edmet_molecule.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys
import pytest
import unittest

import vayesta
Expand All @@ -10,6 +12,13 @@ class MolecularEDMETTest(TestCase):
ENERGY_PLACES = 7
CONV_TOL = 1e-9

@classmethod
def setUpClass(cls):
try:
import cvxpy
except ImportError:
pytest.skip("Requires cvxpy.")

def _test_energy(self, emb, known_values):
"""Tests that the energy matfhes a known values.
"""
Expand Down

0 comments on commit 43395d6

Please sign in to comment.