Opened 7 years ago

Closed 6 years ago

#1779 closed defect (fixed)

ISOLDE picking: unsupported operand type(s) for -: 'NoneType' and 'NoneType'

Reported by: goddard@… Owned by: Tristan Croll
Priority: normal Milestone:
Component: Third Party Version:
Keywords: Cc: Tom Goddard
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Windows-10-10.0.17763
ChimeraX Version: 0.8 (2018-12-17)
Description
Right click and drag in ISOLDE, showing demo data, produced this error.

Log:
Startup Messages  
---  
warning | 'clip' is a prefix of an existing command 'clipper'  
note | Traceback (most recent call last):  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-  
packages\chimerax\core\toolshed\\\\__init__.py", line 338, in __init__  
self.init_available_from_cache(logger)  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-  
packages\chimerax\core\toolshed\\\\__init__.py", line 445, in  
init_available_from_cache  
abc.load_from_cache()  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-  
packages\chimerax\core\toolshed\available.py", line 61, in load_from_cache  
b = _build_bundle(d)  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-  
packages\chimerax\core\toolshed\available.py", line 242, in _build_bundle  
keywords = _extract_extra_keywords(keywords)  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-  
packages\chimerax\core\toolshed\installed.py", line 270, in  
_extract_extra_keywords  
all_kwds = [k.strip() for k in kwds.split(',')]  
AttributeError: 'list' object has no attribute 'split'  
  
UCSF ChimeraX version: 0.8 (2018-12-17)  
How to cite UCSF ChimeraX  
Downloading bundle ChimeraX_ISOLDE-1.0b2-cp36-cp36m-win_amd64.whl  
unloading module chimerax.isolde  
Successfully installed ChimeraX-ISOLDE-1.0b2  
Installed ChimeraX-ISOLDE (1.0b2)  

'clip' is a prefix of an existing command 'clipper'  

> toolshed show ISOLDE

Summary of feedback from opening C:\Program Files\ChimeraX-0.8\bin\lib\site-
packages\chimerax\isolde\demo_data\3io0\before.pdb  
---  
warning | Ignored bad PDB record found on line 3846  
END  
  
before.pdb title:  
Crystal structure of etub from clostridium kluyveri [more info...]  
  
Chain information for before.pdb #1  
---  
Chain | Description  
A | predicted microcompartment protein  
  
before.pdb title:  
Crystal structure of etub from clostridium kluyveri [more info...]  
  
Chain information for before.pdb  
---  
Chain | Description  
1.3/A | predicted microcompartment protein  
  

> set bgColor black

> ui mousemode rightMode zoom

> ui mousemode rightMode zoom

> vr on

started SteamVR rendering  

> clip off

VR mode select  

> vr off

> vr off

> select up

19 atoms, 18 bonds, 1 model selected  

> vr off

reverting to start  

> ui mousemode rightMode zoom

> select up

17 atoms, 16 bonds, 1 model selected  

> vr off

> vr on

started SteamVR rendering  
VR mode contour level  

> volume #1.1.1.3 level 0.2104

> volume #1.1.1.3 level 0.1786

> volume #1.1.1.3 level 0.1799

> volume #1.1.1.3 level 0.1752

> volume #1.1.1.3 level 0.4274

> volume #1.1.1.1 level 0.1753

Traceback (most recent call last):  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-
packages\chimerax\mouse_modes\mousemodes.py", line 436, in <lambda>  
gw.mousePressEvent = lambda e, s=self: s._dispatch_mouse_event(e,
"mouse_down")  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-
packages\chimerax\mouse_modes\mousemodes.py", line 367, in
_dispatch_mouse_event  
f(MouseEvent(event))  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-
packages\chimerax\isolde\tugging.py", line 95, in mouse_down  
pick = picking.pick_closest_to_line(self.session, x, y, self._atoms, 0.5)  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-
packages\chimerax\isolde\picking.py", line 25, in pick_closest_to_line  
length = numpy.linalg.norm(xyz2-xyz1)  
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'  
  
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'  
  
File "C:\Program Files\ChimeraX-0.8\bin\lib\site-
packages\chimerax\isolde\picking.py", line 25, in pick_closest_to_line  
length = numpy.linalg.norm(xyz2-xyz1)  
  
See log for complete Python traceback.  
  




OpenGL version: 3.3.0 NVIDIA 418.81
OpenGL renderer: Quadro P6000/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation

Change History (6)

in reply to:  1 ; comment:1 by goddard@…, 7 years ago

The error I am reporting is the second one in ISOLDE.  It happened on a right click -- did not require a drag, just right mouse button down.


comment:2 by pett, 7 years ago

Component: UnassignedThird Party
Owner: set to Tristan Croll
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionISOLDE picking: unsupported operand type(s) for -: 'NoneType' and 'NoneType'

in reply to:  3 ; comment:3 by tic20@…, 7 years ago

Hmm, yes - my mouse picking mode expects there to be front and rear clipping planes. I’ve been meaning to give it a re-think. The reasons it exists at all are:

(A) at the time I wrote it, it was impossible to make Volumes and other drawings non-pickable; and

(B) while a simulation is running, it makes sense to limit selection to only the mobile atoms.

 
 
Tristan Croll
Research Fellow
Cambridge Institute for Medical Research
University of Cambridge CB2 0XY
 

 


comment:4 by Tristan Croll, 7 years ago

Owner: changed from Tristan Croll to Tom Goddard

This looks like it's actually a problem with stereo cameras, and will affect your own TugAtomsMode in the same way. The problem is the call to View.clip_plane_points(). In view.py, line 799:

    def clip_plane_points(self, window_x, window_y, camera=None, view_num=None):
        '''
        Return two scene points at the near and far clip planes at
        the specified window pixel position.  The points are in scene
        coordinates.  '''
        c = camera if camera else self.camera
        origin, direction = c.ray(window_x, window_y, self.window_size)	# Scene coords
        if origin is None:
            return (None, None)

... and in camera.py, only MonoCamera and OrthoGraphicCamera provide implementations of ray() to override the base method:

    def ray(self, window_x, window_y, window_size):
        '''
        Return origin and direction in scene coordinates of sight line
        for the specified window pixel position.
        '''
        return (None, None)

One possible approach would be for the stereo cameras to allow designation of a "dominant" eye to determine which of the two views the ray is calculated on?

comment:5 by Tom Goddard, 6 years ago

Cc: Tom Goddard added
Owner: changed from Tom Goddard to Tristan Croll

View.clip_plane_points() can return None, None. Cameras do not need to support casting a ray from a window position (such as the VR camera where the mouse and window positions are not used). Code that uses clip_plane_points() needs to look for None return values.

comment:6 by Tristan Croll, 6 years ago

Resolution: fixed
Status: assignedclosed

Long since fixed (sorry for not closing at the time). ISOLDE's tugging now uses the standard first_intercept() rather than its own bespoke selection approach.

Note: See TracTickets for help on using tickets.