diff --git a/.github/workflows/ut.yml b/.github/workflows/ut.yml index e69de29bb..e219fdcad 100644 --- a/.github/workflows/ut.yml +++ b/.github/workflows/ut.yml @@ -0,0 +1,34 @@ +name: DMFF's python tests. + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + source $CONDA/bin/activate + $CONDA/bin/conda update -n base -c defaults conda + conda install pip + conda update pip + conda install numpy openmm pytest -c conda-forge + pip install jax jax_md + - name: Install DMFF + run: | + source $CONDA/bin/activate + pip install . + - name: Run Tests + run: | + source $CONDA/bin/activate + pytest -vs tests/ diff --git a/requirements.txt b/requirements.txt index e69de29bb..7360452fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.18 +jax>=0.3.7 +jax-md>=0.1.28 diff --git a/tests/test_common/test_nblist.py b/tests/test_common/test_nblist.py index a8a04724b..dd00f6d5b 100644 --- a/tests/test_common/test_nblist.py +++ b/tests/test_common/test_nblist.py @@ -6,13 +6,14 @@ class TestNeighborList: @pytest.fixture(scope="class", name='nblist') def test_nblist_init(self): - positions = jnp.array([[12.434, 3.404, 1.540], - [13.030, 2.664, 1.322], - [12.312, 3.814, 0.660], - [14.216, 1.424, 1.103], - [14.246, 1.144, 2.054], - [15.155, 1.542, 0.910]]) - + positions = jnp.array([ + [12.434, 3.404, 1.540], + [13.030, 2.664, 1.322], + [12.312, 3.814, 0.660], + [14.216, 1.424, 1.103], + [14.246, 1.144, 2.054], + [15.155, 1.542, 0.910] + ]) box = jnp.array([31.289, 31.289, 31.289]) r_cutoff = 4.0 nbobj = NeighborList(box, r_cutoff) @@ -21,13 +22,14 @@ def test_nblist_init(self): def test_update(self, nblist): - positions = jnp.array([[12.434, 3.404, 1.540], - [13.030, 2.664, 1.322], - [12.312, 3.814, 0.660], - [14.216, 1.424, 1.103], - [14.246, 1.144, 2.054], - [15.155, 1.542, 0.910]]) - + positions = jnp.array([ + [12.434, 3.404, 1.540], + [13.030, 2.664, 1.322], + [12.312, 3.814, 0.660], + [14.216, 1.424, 1.103], + [14.246, 1.144, 2.054], + [15.155, 1.542, 0.910] + ]) nblist.update(positions) def test_pairs(self, nblist):