Skip to content
This repository was archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from DeepRank/setup_ci
Browse files Browse the repository at this point in the history
Setup ci
  • Loading branch information
manonreau authored Nov 13, 2020
2 parents a11e73d + 9f1a155 commit 7125ea9
Show file tree
Hide file tree
Showing 16 changed files with 29,877 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: build

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
version: [3.7, 3.8]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.version }}
conda-channels: anaconda
- run: conda --version
- run: which python
- run: conda install mpi4py h5py pytorch torchvision cpuonly -c pytorch -c conda-forge

- name: Install the package
run: pip install .[test]
env:
CONDA_PREFIX: /usr/share/miniconda

- name: Test with pytest
env:
CONDA_PREFIX: /usr/share/miniconda
run: |
pytest --cov-config setup.cfg
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ GraphProt.egg-info
# hdf5
*.hdf5
*.tar

# test
htmlcov
.coverage
covergage.xml
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GraphProt

[![Build Status](https://github.com/DeepRank/GraphProt/workflows/build/badge.svg)](https://github.com/DeepRank/GraphProt/actions)

Use Graph CNN to rank conformations.

![alt-text](./graphprot.png)
Expand Down
21 changes: 21 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[metadata]
description-file = README.rst

[aliases]
# Define `python setup.py test`
test=pytest

[coverage:run]
branch = True
source = graphprot

[tool:pytest]
testpaths = tests
addopts = --cov --cov-report xml --cov-report term --cov-report html

# Define `python setup.py build_sphinx`
# [build_sphinx]
# source-dir = docs
# build-dir = docs/_build
# all_files = 1
# builder = html
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
description='Graph Neural network Scoring of protein-protein conformations',
long_description=readme + '\n\n',
long_description_content_type='text/markdown',
author=["Nicolas Renaud"],
author=["Nicolas Renaud", "Manon Reau"],
author_email='n.renaud@esciencecenter.nl',
url='https://github.com/DeepRank/GraphProt',
packages=find_packages(),
Expand Down
6,044 changes: 6,044 additions & 0 deletions tests/data/pdb/1ATN/1ATN_1w.pdb

Large diffs are not rendered by default.

6,044 changes: 6,044 additions & 0 deletions tests/data/pdb/1ATN/1ATN_2w.pdb

Large diffs are not rendered by default.

6,044 changes: 6,044 additions & 0 deletions tests/data/pdb/1ATN/1ATN_3w.pdb

Large diffs are not rendered by default.

6,044 changes: 6,044 additions & 0 deletions tests/data/pdb/1ATN/1ATN_4w.pdb

Large diffs are not rendered by default.

373 changes: 373 additions & 0 deletions tests/data/pssm/1ATN/1ATN.A.pdb.pssm

Large diffs are not rendered by default.

259 changes: 259 additions & 0 deletions tests/data/pssm/1ATN/1ATN.B.pdb.pssm

Large diffs are not rendered by default.

4,942 changes: 4,942 additions & 0 deletions tests/data/ref/1ATN/1ATN.pdb.save

Large diffs are not rendered by default.

Binary file added tests/hdf5/1ATN_residue.hdf5
Binary file not shown.
16 changes: 16 additions & 0 deletions tests/test_create_graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unittest
from graphprot.GraphGenMP import GraphHDF5


class TestCreateGraph(unittest.TestCase):

def setUp(self):

self.pdb_path = './tests/data/pdb/1ATN/'
self.pssm_path = './tests/data/pssm/1ATN/'
self.ref = './tests/data/ref/1ATN/'

def test_create(self):
GraphHDF5(pdb_path=self.pdb_path, ref_path=self.ref, pssm_path=self.pssm_path,
graph_type='residue', outfile='1ATN_residue.hdf5',
nproc=1, tmpdir='./tmpdir')
30 changes: 30 additions & 0 deletions tests/test_nn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest

from graphprot.NeuralNet import NeuralNet
from graphprot.ginet import GINet
from graphprot.foutnet import FoutNet


__PLOT__ = False


class TestNeuralNet(unittest.TestCase):

def setUp(self):
self.database = 'tests//hdf5/1ATN_residue.hdf5'

def test_neural_net(self):
NN = NeuralNet(self.database, GINet,
node_feature=['type', 'polarity', 'bsa',
'depth', 'hse', 'ic', 'pssm'],
edge_feature=['dist'],
target='irmsd',
index=None,
task='reg',
batch_size=64,
percent=[0.8, 0.2])

NN.train(nepoch=25, validate=False)

if __PLOT__:
NN.plot_scatter()
12 changes: 12 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Module containing some utilities for testing."""

from pathlib import Path
import pkg_resources as pkg

__all__ = ["PATH_GRAPHPROT", "PATH_TEST"]

# Environment data
PATH_GRAPHPROT = Path(pkg.resource_filename('graphprot', ''))
ROOT = PATH_GRAPHPROT.parent

PATH_TEST = ROOT / "tests"

0 comments on commit 7125ea9

Please sign in to comment.