haddocking / pdb-tools

A dependency-free cross-platform swiss army knife for PDB files.
https://haddocking.github.io/pdb-tools/
Apache License 2.0
384 stars 113 forks source link

Facilitates use of pdb-tools as a library #107

Closed joaomcteixeira closed 3 years ago

joaomcteixeira commented 3 years ago

What was done

How was done

Note!

The only break in backwards compatibility introduced here is the order of the tuples returned by check_input. Tuples (where they are) were swapped such that the file handler is at index 0, instead of index -1. This was done to allow chaining check_input with run; see docs. I believe this does not create problems with version 2 because no one is expected to be importing check_input. Is this right for all HADDOCK services?

Please read the documentation now on init.

Examples

more at the docs

import pdbtools
from pdbtools import *
from pdbtools import pdb_selchain

with open('dummy.pdb') as fin:
    print(''.join(pdb_selchain.run(fin, ['A'])))

version bump

I suggest [FEATURE].

Closes #106

joaomcteixeira commented 3 years ago

I greped both haddock2.4 and haddock2.5 branches for check_input and no output returned. So I am positive no module is importing check_input from pdb-tools. check_input return values was the only API that changes in this PR.

amjjbonvin commented 3 years ago

Indeed - no pdb-tools dependencies in the haddock2.4/2.5 code

On 12 Jul 2021, at 10:59, João M.C. Teixeira @.***> wrote:

I greped both haddock2.4 and haddock2.5 branches for check_input and no output returned. So I am positive no module is importing check_input from pdb-tools. check_input return values was the only API that changes in this PR.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/haddocking/pdb-tools/pull/107#issuecomment-878100304, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOH5IBP4CGK6WHB2YLVBMLTXKVGRANCNFSM473FXYCQ.

joaomcteixeira commented 3 years ago

Great you could double check it. Apart form the return tuple on some of the check_input functions, no other API is broken. The older function names link to the new run.

I like we will be able to do this:

https://github.com/haddocking/pdb-tools/pull/107/files#diff-fdf5a6300e07e6be609fca3db7f1a755e0f519a25476ca4b3aa65db2d0cf4d1fR46-R52

joaomcteixeira commented 3 years ago

Hi all, if anyone has objections on this PR, I will merge it by the end of today. :+1: I will raise version 2.4 despite it should be version 3 by definition, because there is no reported use of the check_input API, there is no need to upgrade to 3. Special cases are also acceptable in SV2.0.