You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines and that you comply with the following criteria:
[x] You have sticked to Python. Please talk to us before adding other programming languages to HADDOCK3
[x] Your PR is about CNS
[x] Your code is well documented: proper docstrings and explanatory comments for those tricky parts
[x] You structured the code into small functions as much as possible. You can use classes if there is a (state) purpose
[x] Your code follows our coding style
[x] You wrote tests for the new code
[x] tox tests pass. Run tox command inside the repository folder
[ ] -test.cfg examples execute without errors. Inside examples/ run python run_tests.py -b
[x] PR does not add any dependencies, unless permission granted by the HADDOCK team
[x] PR does not break licensing
[x] Your PR is about writing documentation for already existing code :fire:
[x] Your PR is about writing tests for already existing code :godmode:
This PR partially addresses #917 by adding a new general parameter called less_io - which when triggered will not save the .inp and .out files generated as input/output for CNS.
To achieve this I had to do some refactoring of the libsubprocess.CNSJob.run method to allow for polymorphism. Tried to keep it simple, if input_file and output_file are Path - it will follow the default old using the TextWrapperIO objects as input in the subprocess call.
Also had to change a bit libparallel - tried to simplify it for readabality and also addedd a mechanism to return the result of the run method of the tasks. This should make it easier for other modules using this library to not rely on filesystem operations - but I'll go deeper into that in another PR.
I've also added unittests for both libsubprocess and libparallel since there were none. Besides that I've also added an integration test for the CNSJob. Executing its run method both via file-based and memory based scheduler, to make sure it all works fine. For that I had to add a .pdb and a .psf file, hence why the large number of lines - you can safely ignore those and filter by .py when reviewing
You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines and that you comply with the following criteria:
tox
tests pass. Runtox
command inside the repository folder-test.cfg
examples execute without errors. Insideexamples/
runpython run_tests.py -b
This PR partially addresses #917 by adding a new general parameter called
less_io
- which when triggered will not save the.inp
and.out
files generated as input/output for CNS.To achieve this I had to do some refactoring of the
libsubprocess.CNSJob.run
method to allow for polymorphism. Tried to keep it simple, ifinput_file
andoutput_file
arePath
- it will follow the default old using theTextWrapperIO
objects as input in the subprocess call.Also had to change a bit
libparallel
- tried to simplify it for readabality and also addedd a mechanism to return the result of therun
method of the tasks. This should make it easier for other modules using this library to not rely on filesystem operations - but I'll go deeper into that in another PR.I've also added unittests for both
libsubprocess
andlibparallel
since there were none. Besides that I've also added an integration test for theCNSJob
. Executing itsrun
method both via file-based and memory based scheduler, to make sure it all works fine. For that I had to add a.pdb
and a.psf
file, hence why the large number of lines - you can safely ignore those and filter by.py
when reviewing