Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#505 closed defect (fixed)

Molecular surface (coloring?) breaks session restore

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: blocker Milestone:
Component: Input/Output Version:
Keywords: Cc: Eric Pettersen, Tom Goddard
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

I had a session with a molecule, molecular surface, and a dx file contoured at two levels as mesh. It saved without apparent error but could not be restored. Session file attached. If i remember correctly, the molecule was #2 and the dx file was #3. I'd had an MRC file open as #1 previously but closed it before saving the session.

open /Users/meng/Desktop/3eebB-apbsdx.cxs format session
Summary of feedbck from opening /Users/meng/Desktop/3eebB-apbsdx.cxs
error Unable to restore session, resetting. Traceback (most recent call last): File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/session.py", line 481, in restore obj = sm.restore_snapshot(self, data) File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 259, in restore_snapshot return cls(c_pointers) File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 1023, in init Collection.init(self, mol_pointers, AtomicStructure, AtomicStructures) File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 112, in init raise ValueError('Collection items of unrecognized type "%s"' % str(type(items))) ValueError: Collection items of unrecognized type ""
Traceback (most recent call last):
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/session.py", line 481, in restore
obj = sm.restore_snapshot(self, data)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 259, in restore_snapshot
return cls(c_pointers)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 1023, in init
Collection.init(self, mol_pointers, AtomicStructure, AtomicStructures)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 112, in init
raise ValueError('Collection items of unrecognized type "%s"' % str(type(items)))
ValueError: Collection items of unrecognized type "<class 'numpy.ndarray'>"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/cmd_line/tool.py", line 158, in execute
cmd.run(cmd_text)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/cli.py", line 2255, in run
result = ci.function(session, kw_args)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/open.py", line 103, in open
models = session.models.open(paths, format=format, name=name,
kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/models.py", line 351, in open
session, filenames, format=format, name=name, kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/io.py", line 368, in open_multiple_data
models, status = open_data(session, fspec, format=format, name=name,
kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/io.py", line 328, in open_data
models, status = open_func(session, stream, dname, kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/session.py", line 630, in open
session.restore(input)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/session.py", line 487, in restore
self.reset()
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/session.py", line 361, in reset
sm.reset_state(container, self)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/models.py", line 206, in reset_state
self.remove([m for m in self.list() if not m.SESSION_ENDURING])
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/models.py", line 318, in remove
parent = self._models[model_id[:-1]]
KeyError: (2,)

Attachments (1)

3eebB-apbsdx.cxs (3.0 MB ) - added by Elaine Meng 9 years ago.

Change History (7)

by Elaine Meng, 9 years ago

Attachment: 3eebB-apbsdx.cxs added

comment:1 by Elaine Meng, 9 years ago

Cc: Eric Pettersen Tom Goddard added

I tried regenerating this session step by step and saving/restoring intermediate sessions. It was OK with my opening both the dx and the molecule, setting 2 contour levels and showing them as mesh, and making sticks fatter. Then after I showed the molecular surface and changed its color, saving worked but the restore failed with a similar error as shown above.

comment:2 by Eric Pettersen, 9 years ago

Owner: changed from Eric Pettersen to Tom Goddard
Status: newassigned
Summary: could not open session saved from same daily buildMolecular surface (coloring?) breaks session restore

comment:3 by Elaine Meng, 9 years ago

Yeah, I'm pretty sure it's just the molecular surface. just tested now on very simple case where all I did was open a structure, show surface, save session. Gave a shorter error upon restore, but still failed...

error Unable to restore session, resetting. Traceback (most recent call last): File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/session.py", line 481, in restore obj = sm.restore_snapshot(self, data) File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 259, in restore_snapshot return cls(c_pointers) File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 1023, in init Collection.init(self, mol_pointers, AtomicStructure, AtomicStructures) File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molarray.py", line 112, in init raise ValueError('Collection items of unrecognized type "%s"' % str(type(items))) ValueError: Collection items of unrecognized type ""

comment:5 by goddard@…, 9 years ago

This error is probably caused by a change I made for Tristan yesterday.  I did not test session restore after that change to how the Collection constructor works.  Should be easy to fix later today.

comment:6 by Tom Goddard, 9 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Session restore code was producing arrays of C++ pointers that did not have correct type (was using int64 instead of uintp). New stricter type checking code I added yesterday to help Tristan Croll debug a type problem, caught that the session restore was not using the correct types.

comment:7 by Eric Pettersen, 8 years ago

Component: UnassignedInput/Output
Note: See TracTickets for help on using tickets.