Opened 6 years ago

Closed 6 years ago

#2973 closed defect (fixed)

Numpy type problem reading .cmap file

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

Description

The following bug report has been submitted:
Platform:        Darwin-18.7.0-x86_64-i386-64bit
ChimeraX Version: 0.93 (2020-03-17)
Description
Opening a .cmp file

Log:
UCSF ChimeraX version: 0.93 (2020-03-17)  
© 2016-2020 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open /Users/pett/rm/out2.cmap format cmap

Traceback (most recent call last):  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/gui.py", line 610, in customEvent  
func(*args, **kw)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/widgets/htmlview.py", line 429, in defer  
cxcmd(session, topic)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/widgets/htmlview.py", line 445, in cxcmd  
run(session, cmd)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/commands/run.py", line 31, in run  
results = command.run(text, log=log)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2845, in run  
result = ci.function(session, **kw_args)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/commands/open.py", line 68, in open  
path_models = session.models.open(paths, format=format, name=name, **kw)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/models.py", line 729, in open  
session, filenames, format=format, name=name, **kw)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/io.py", line 500, in open_multiple_data  
models, status = open_func(session, paths, mname, **kw)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/volume.py", line 3691, in open_map_format  
return open_map(session, path, name=name, format=format, **kw)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/volume.py", line 3278, in open_map  
grids = data.open_file(path, file_type = format, log = session.logger, **kw)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/data/fileformats.py", line 162, in open_file  
data.extend(open_func(p, **okw))  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/data/cmap/__init__.py", line 18, in open  
return read_chimera_map(path)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/data/cmap/cmap_grid.py", line 65, in read_chimera_map  
d = Chimera_HDF_Data(path)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/data/cmap/cmap_format.py", line 49, in __init__  
imlist = [Chimera_HDF_Image(g,a) for g,a in agroups]  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/data/cmap/cmap_format.py", line 49, in <listcomp>  
imlist = [Chimera_HDF_Image(g,a) for g,a in agroups]  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/data/cmap/cmap_format.py", line 207, in __init__  
self.symmetries = self.find_symmetries(group)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/map/data/cmap/cmap_format.py", line 292, in find_symmetries  
sym = Places(place_array = va.symmetries)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/geometry/place.py", line 625, in __init__  
self._check_array('place_array', place_array, double=True)  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/geometry/place.py", line 637, in _check_array  
raise ValueError('Places %s argument must have type %s, got %s' % (name,
str(dtype), str(array.dtype)))  
ValueError: Places place_array argument must have type <class
'numpy.float64'>, got float32  
  
ValueError: Places place_array argument must have type , got float32  
  
File "/Applications/ChimeraX
3-17-20.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/geometry/place.py", line 637, in _check_array  
raise ValueError('Places %s argument must have type %s, got %s' % (name,
str(dtype), str(array.dtype)))  
  
See log for complete Python traceback.  
  




OpenGL version: 4.1 INTEL-12.10.16
OpenGL renderer: Intel(R) Iris(TM) Pro Graphics 6200
OpenGL vendor: Intel Inc.

Change History (2)

comment:1 by Eric Pettersen, 6 years ago

Component: UnassignedVolume Data
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionNumpy type problem reading .cmap file

Using daily build downloaded on St. Patty's day.

comment:2 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Chimera map files containing symmetries as float32 (as written by Chimera/ChimeraX) were not being read because the reader mistakenly required float64. Made the reader convert float32 to float64 before making Places object.

Note: See TracTickets for help on using tickets.