From 49519aafa344890941b6e6965285954dca582fff Mon Sep 17 00:00:00 2001 From: Sergey Lyskov Date: Fri, 25 Aug 2017 21:39:00 -0400 Subject: [PATCH 1/2] Adding example app and tests for it --- apps/+example/example.py | 43 ++++++++++++++++++ apps/+example/test_example.py | 31 +++++++++++++ .../huabai/PP2_hash_table/._calc_const_PP2.py | Bin 4096 -> 0 bytes .../huabai/PP2_hash_table/._hash_orient.py | Bin 4096 -> 0 bytes .../._hash_orient_forPP2unique.py | Bin 4096 -> 0 bytes .../huabai/PP2_hash_table/._test.py | Bin 4096 -> 0 bytes 6 files changed, 74 insertions(+) create mode 100644 apps/+example/example.py create mode 100644 apps/+example/test_example.py delete mode 100644 apps/PeptideDesign/huabai/PP2_hash_table/._calc_const_PP2.py delete mode 100644 apps/PeptideDesign/huabai/PP2_hash_table/._hash_orient.py delete mode 100644 apps/PeptideDesign/huabai/PP2_hash_table/._hash_orient_forPP2unique.py delete mode 100644 apps/PeptideDesign/huabai/PP2_hash_table/._test.py diff --git a/apps/+example/example.py b/apps/+example/example.py new file mode 100644 index 0000000..844edc9 --- /dev/null +++ b/apps/+example/example.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# :noTabs=true: + +# (c) Copyright Rosetta Commons Member Institutions. +# (c) This file is part of the Rosetta software suite and is made available under license. +# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. +# (c) For more information, see http://www.rosettacommons.org. Questions about this can be +# (c) addressed to University of Washington CoMotion, email: license@uw.edu. + +## @file example.py +## @brief Example PyRosetta app +## @author Sergey Lyskov + +from __future__ import print_function + +import sys, argparse + +import pyrosetta + +def app_function(s): + ''' dummy app function + ''' + return '__q' + s + 'w__' + + +def main(args): + ''' Example PyRosetta app script ''' + + parser = argparse.ArgumentParser() + parser.add_argument('-j', '--jobs', default=1, const=0, nargs="?", type=int, help="Number of processors to use on when building, use '-j' with no arguments to launch job-per-core. (default: 1) ") + parser.add_argument("--multi-choice", default='Release', choices=['Release', 'Debug', 'MinSizeRel', 'RelWithDebInfo'], help="Specify one of the allowed values") + parser.add_argument('-s', '--skip-generation-phase', action="store_true", help="Example of true/false option") + + global Options + Options = parser.parse_args() + + print( 'PyRosetta example app, running with options: {Options}...'.format(**vars()) ) + print('PyRosetta example app... Done!') + + +if __name__ == "__main__": + main(sys.argv) diff --git a/apps/+example/test_example.py b/apps/+example/test_example.py new file mode 100644 index 0000000..7b5b2b6 --- /dev/null +++ b/apps/+example/test_example.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# :noTabs=true: + +# (c) Copyright Rosetta Commons Member Institutions. +# (c) This file is part of the Rosetta software suite and is made available under license. +# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. +# (c) For more information, see http://www.rosettacommons.org. Questions about this can be +# (c) addressed to University of Washington CoMotion, email: license@uw.edu. + +## @file test_example.py +## @brief test file example.py app +## @author Sergey Lyskov + +from __future__ import print_function + +import example + +import pytest + + +def test_app_function(): + ''' defining test function as 'test_' + test-name, such function will be automatically executed by test framework + ''' + assert example.app_function('A') == '__qAw__' + + +def test_app_function2(): + ''' This test will always fail + ''' + assert False diff --git a/apps/PeptideDesign/huabai/PP2_hash_table/._calc_const_PP2.py b/apps/PeptideDesign/huabai/PP2_hash_table/._calc_const_PP2.py deleted file mode 100644 index 87ae8e919e5bc563792ba3fe4506eb93008ab9bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vVql!} z5~71)4p2EinifVNA1W@MoS&q9#3*+(1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0!Ljcs-1Yt0c3(3eV zRwzm>&Mz%WPE|$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vVql!L z2cm;v4p2EinifVNA1W@MoS&q9#3*+(1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0!Ljcs-1Yt0c3(3eV zRwzm>&Mz%WPE|$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vVqjbl z1ku4T2dJDMO$#HC4;2?r&d=3LEGWoH)eA|jC~?h8&QHnAO9v__ElJb0ur@R{F)}o_ zv@k(4Vw5`?0;3@?8UmvsFd71*Aut*OqaiRF0;3@?8UmvsFd71=Apq)Zf-o4!g=AzF zD-@*`=a&{Grz)i77iBAC=9Q%8m1O4UCFbN*D&(Z5l_(_TB<5uU`@&FNLz+VMKin%a J408Yf0|3szDXstj diff --git a/apps/PeptideDesign/huabai/PP2_hash_table/._test.py b/apps/PeptideDesign/huabai/PP2_hash_table/._test.py deleted file mode 100644 index b1bd66147277bd922aa6d966352839ff7195e11e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vVqly# z52Ax%4p2EinifVNA1W@MoS&q9#3*+(1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0!Ljcs-1Yt0c3(3eV zRwzm>&Mz%WPE| Date: Sun, 27 Aug 2017 13:33:45 -0400 Subject: [PATCH 2/2] fixing app_function2 test --- apps/+example/test_example.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/+example/test_example.py b/apps/+example/test_example.py index 7b5b2b6..40cdb16 100644 --- a/apps/+example/test_example.py +++ b/apps/+example/test_example.py @@ -25,7 +25,7 @@ def test_app_function(): assert example.app_function('A') == '__qAw__' -def test_app_function2(): - ''' This test will always fail - ''' - assert False +# def test_app_function2(): +# ''' This test will always fail +# ''' +# assert False