This repository was archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from DeepRank/setup_ci
Setup ci
- Loading branch information
Showing
16 changed files
with
29,877 additions
and
1 deletion.
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,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 |
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 |
---|---|---|
|
@@ -15,3 +15,8 @@ GraphProt.egg-info | |
# hdf5 | ||
*.hdf5 | ||
*.tar | ||
|
||
# test | ||
htmlcov | ||
.coverage | ||
covergage.xml |
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
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,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 |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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,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') |
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,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() |
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,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" |