Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

PDB 3NH3 HIS:244 breaks parser with occupancy of -1.0. Changed initia…

…l last_occupancy of DisorderedAtom to -99.
  • Loading branch information...
commit c1772106c2c83e0198668698f7caa1b37a32e7b0 1 parent 40298a6
João Rodrigues authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  Bio/PDB/
2  Bio/PDB/
@@ -301,7 +301,7 @@ def __init__(self, id):
o id - string, atom name
- self.last_occupancy=-1
+ self.last_occupancy=-99
DisorderedEntityWrapper.__init__(self, id)
# Special methods

2 comments on commit c177210


So this is a magic number now? Can you add a comment to make that clear?

Also consider these alternatives (for choosing the highest-occupancy atom in disordered_add, if I'm reading that correctly):

max(None, -1)
max(float("-Inf"), None)


-1 was a magic number already, which apparently didn't work for this case. I never saw a negative occupancy, but apparently they might exist (under some very dubious pretense though..). I chose -99 because I doubt that that will be a valid number, since occupancy is (usually) between 0 and 1. Peter however, suggested to use None and I agree. It seems a safer option indeed.

Please sign in to comment.
Something went wrong with that request. Please try again.