Opened 6 years ago

Closed 6 years ago

#2633 closed defect (fixed)

Problem updating pseudobond labels

Reported by: Eric Pettersen Owned by: Tom Goddard
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc: Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description (last modified by Eric Pettersen)

The following bug report has been submitted:
Platform:        Darwin-18.7.0-x86_64-i386-64bit
ChimeraX Version: 0.91 (2019-11-27)
Description
Showing labeled pseudobonds as part of interactive clash detection.  Found problem after fixing #2630.  To reproduce:

open 3w7f
view /a:248
sel /a:248
clashes sel restrict cross showDist t reveal t continuous t
ui mousemode rightMode "bond rotation"

...then use right mouse over bonds in Tyr 248

Log:
UCSF ChimeraX version: 0.91 (2019-11-27)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 3w7f

3w7f title:  
Crystal structure of the C(30) carotenoid dehydrosqualene synthase from
staphylococcus aureus complexed with farnesyl thiopyrophosphate [more info...]  
  
Chain information for 3w7f #1  
---  
Chain | Description  
A B | Dehydrosqualene synthase  
  
Non-standard residues in 3w7f #1  
---  
FPS — S-[(2E,6E)-3,7,11-trimethyldodeca-2,6,10-trienyl] trihydrogen
thiodiphosphate (farnesyl thiopyrophosphate)  
MG — magnesium ion  
  
3w7f mmCIF Assemblies  
---  
1| author_and_software_defined_assembly  
2| author_and_software_defined_assembly  
  
  

> select /a:248

12 atoms, 12 bonds, 1 model selected  

> view /a:248

> clashes sel restrict cross showDist true reveal true continuous true

No clashes  

> ui mousemode rightMode "bond rotation"

Traceback (most recent call last):  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/triggerset.py", line 130, in invoke  
return self._func(self._name, data)  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label3d.py", line 434, in _update_graphics_if_needed  
self._rebuild_label_graphics()  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label3d.py", line 446, in _rebuild_label_graphics  
va = self._label_vertices()  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label3d.py", line 516, in _label_vertices  
va = concatenate([l._label_rectangle(spos, cposd) for l in self._labels])  
ValueError: zero-dimensional arrays cannot be concatenated  
  
Error processing trigger "graphics update":  
ValueError: zero-dimensional arrays cannot be concatenated  
  
File
"/Users/pett/src/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/label/label3d.py", line 516, in _label_vertices  
va = concatenate([l._label_rectangle(spos, cposd) for l in self._labels])  
  
See log for complete Python traceback.  
  

> torsion /A:248@CD1,CG,CB,CA -79.80




OpenGL version: 4.1 ATI-2.11.21
OpenGL renderer: AMD Radeon Pro 575X OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (5)

comment:1 by Eric Pettersen, 6 years ago

Cc: Elaine Meng added
Component: UnassignedGraphics
Description: modified (diff)
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned

comment:2 by Eric Pettersen, 6 years ago

Summary: ChimeraX bug report submissionProblem updating pseudobond labels

comment:3 by Tom Goddard, 6 years ago

This error appears to be because the clashes command is continuously monitoring for atom motion using the atomic "changes" trigger and if an atom moves it may delete a pseudobond that had a label on it. But the label code is also listening to the atomic "changes" trigger to see if anything labeled gets deleted. The error happens because clashes gets the changes trigger after labels and deletes a pseudobond, then labels tries to position the label for the dead pseudobond when it updates its graphics in the subsequent "graphics update" trigger.

All this results in numpy.concatenate([None]) being called generating the ValueError: zero-dimensional arrays cannot be concatenated.

Either label needs to handle labels on deleted objects gracefully, or it needs to cull labels on deleted objects by a different mechanism that avoids this race situation.

comment:4 by Tom Goddard, 6 years ago

There is a "changes done" atomic trigger. But some other handler could delete a labeled object in that trigger. So it seems like the only safe approach is for the label code to look for dead labels when the graphics is being updated and handle it. A dead label won't be cleaned up at that point since that might require deleting a label model which is not allowed during graphics update. So the label will get cleaned up on the next frame, but will draw nothing on the current frame.

Need a test case since the label code may be relying on labels being alive in several places in the graphics update code.

comment:5 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Made label code look for deleted labels when rebuilding graphics.

Note: See TracTickets for help on using tickets.