[Biopython-dev] Adding QUIET argument to PDBParser()

João Rodrigues anaryin at gmail.com
Tue May 17 12:21:52 UTC 2011


Regarding the missing element never raising an exception, here's what I
propose:

Change the wording of the warnings in the Atom._assign_element method so
that they signal that the element was missing and it either was
auto-assigned or it couldn't be assigned at all.

Right now we have:

            if putative_element.capitalize() in IUPACData.atom_weights:
                msg = "Used element %r for Atom (name=%s) with given
element %r" \
                      % (putative_element, self.name, element)
                element = putative_element
            else:
                msg = "Could not assign element %r for Atom (name=%s)
with given element %r" \
                      % (putative_element, self.name, element)
                element = ""
            warnings.warn(msg, PDBConstructionWarning)


I would suggest changing these two messages to make them more verbose.
Setting PERMISSIVE to 0 still converts these into exceptions, but the
message might not be that explicit that the element was missing to begin
with.

João [...] Rodrigues
http://nmr.chem.uu.nl/~joao



On Tue, May 17, 2011 at 2:12 PM, João Rodrigues <anaryin at gmail.com> wrote:

>
> https://github.com/JoaoRodrigues/biopython/commit/2a694502f6fd116b36d8d2d15b3d4ba23ab92fe8
>




More information about the Biopython-dev mailing list