From 0f9558aedf5f496520000062c25fc4b48e8cdd34 Mon Sep 17 00:00:00 2001 From: "Curtis, Darren S" <> Date: Thu, 7 May 2020 08:50:21 -0700 Subject: [PATCH] Fix protein-rna test --- .gitignore | 5 +++- apbs/examples/protein-rna/apbs_dx.py | 38 +++++++++++++++------------- apbs/examples/protein-rna/test.sh | 2 +- apbs/tests/test_cases.cfg | 2 +- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 17a5cd32b..8918326d9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,10 +22,13 @@ **/.ipynb_checkpoints **/.pytest_cache **/.vscode +**/apbs*.in **/apbslib.py **/build **/c_cpp_properties.json -apbs**.in +**/dxmath*.in +**/ndens*.dx +**/qdens*.dx apbs/externals/fetk include/maloc io.mc diff --git a/apbs/examples/protein-rna/apbs_dx.py b/apbs/examples/protein-rna/apbs_dx.py index 1fd2841dd..7dc8ca53b 100644 --- a/apbs/examples/protein-rna/apbs_dx.py +++ b/apbs/examples/protein-rna/apbs_dx.py @@ -1,25 +1,29 @@ #!/bin/python -my_list = ('0.025', '0.050', '0.075', '0.100', '0.125', '0.150', '0.175', - '0.200', '0.225', '0.250', '0.275', '0.300', '0.325', '0.400', '0.500', - '0.600', '0.700', '0.800') +""" +Create files for the protein-rna tests +""" + +MY_LIST = ('0.025', '0.050', '0.075', '0.100', '0.125', '0.150', '0.175', + '0.200', '0.225', '0.250', '0.275', '0.300', '0.325', '0.400', '0.500', + '0.600', '0.700', '0.800') with open("template.txt", "r") as temp: - template_text = temp.read() + TEMPLATE_TEXT = temp.read() -for item in my_list: - input_txt = template_text.replace("IONSTR", item) - file_name = "apbs-" + item + ".in" - print("Creating file now:", file_name) - with open(file_name, "w") as temp: - temp.write(input_txt) +for item in MY_LIST: + input_txt = TEMPLATE_TEXT.replace("IONSTR", item) + file_name = "apbs-" + item + ".in" + print("Creating file now:", file_name) + with open(file_name, "w") as temp: + temp.write(input_txt) with open("dxmath.txt", "r") as temp: - template_2_text = temp.read() + TEMPLATE_2_TEXT = temp.read() -for item in my_list: - input_2_txt = template_2_text.replace("IONSTR", item) - file_2_name = "dxmath-" + item + ".in" - print "Creating file_2 now:", file_2_name - with open(file_2_name, "w") as temp: - temp.write(input_2_txt) +for item in MY_LIST: + input_2_txt = TEMPLATE_2_TEXT.replace("IONSTR", item) + file_2_name = "dxmath-" + item + ".in" + print("Creating file_2 now: %s" % file_2_name) + with open(file_2_name, "w") as temp: + temp.write(input_2_txt) diff --git a/apbs/examples/protein-rna/test.sh b/apbs/examples/protein-rna/test.sh index 388a7edd4..56b9655e5 100644 --- a/apbs/examples/protein-rna/test.sh +++ b/apbs/examples/protein-rna/test.sh @@ -8,7 +8,7 @@ fi if [[ "$3" = "ocd" ]]; then ocd='ocd' else - ocd='noocd' + ocd='noocd' fi logfile=TESTRESULTS.log diff --git a/apbs/tests/test_cases.cfg b/apbs/tests/test_cases.cfg index 2e13840fa..2e3354915 100644 --- a/apbs/tests/test_cases.cfg +++ b/apbs/tests/test_cases.cfg @@ -109,7 +109,7 @@ gly_energyforce : 6.176608555569E-05 6.210593742215E-05 [protein-rna] input_dir : ../examples/protein-rna -setup : python apbs_unix_dx.py +setup : python apbs_dx.py apbs-0.025 : 3.186122223752E+04 3.662855899462E+04 8.477786964834E+03 1.000545153104E+04 2.329205982055E+04 2.653636629928E+04 8.674116429353E+01 apbs-0.050 : 3.184763478312E+04 3.661493366846E+04 8.475252516617E+03 1.000292179294E+04 2.327168361816E+04 2.651594350839E+04 9.606836713866E+01 apbs-0.075 : 3.184033569905E+04 3.660761530545E+04 8.473669396547E+03 1.000134276339E+04 2.326088212207E+04 2.650511882057E+04 1.011537214883E+02