haddocking / haddock3

Official repo of the modular BioExcel version of HADDOCK
https://www.bonvinlab.org/haddock3
Apache License 2.0
101 stars 33 forks source link

Reduce number of files in `mode = "local"` #918

Closed rvhonorato closed 2 months ago

rvhonorato commented 3 months ago

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:


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