ball
ball copied to clipboard
Print residue with insertion code
This was a bit of a technical exercise while continuing the thoughts expressed in issue https://github.com/BALL-Project/ball/issues/544 on the visibility of the insertion code. The getFullName method is extended respectively and the python_toString routine falls back to it. The patch required to also update and extend the FullnameType enum for Python.
I think this looks pretty good. One suggestion I would like to make though is to use the FullNameType enum as bitflags that are used to build the combined flags:
enum FullNameType {
NO_VARIANT_EXTENSIONS = 0,
ADD_VARIANT_EXTENSIONS = 1,
ADD_RESIDUE_ID = 2,
// ADD_VARIANT_EXTENSIONS | ADD_RESIDUE_ID
ADD_VARIANT_EXTENSIONS_AND_ID = 3,
ADD_INSERTION_CODE = 4,
// ADD_INSERTION_CODE | ADD_RESIDUE_ID
ADD_RESIDUE_ID_AND_INSERTION_CODE = 5,
// ADD_INSERTION_CODE | ADD_RESIDUE_ID | ADD_VARIANT_EXTENSIONS
ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE = 6
}
The combined flags can stay for convenience (and API compatibility), the checks for building the full name would be a lot easier to read though...
@anhi What would you say about that proposal?
An ABI incompatibility sounds like a close-to-perfect motivation to perform a library jump from 1.4 to 1.5 :) I was just saying that to satisfy my ambitions for Debian. I have not fully grasped what exactly you were commenting, but if manually assigning values, then the value of ADD_INSERTION_CODE | ADD_RESIDUE_ID | ADD_VARIANT_EXTENSIONS I propose to be 7, not 6 - should also help simplifying the implementation quite a bit.