#3589 closed defect (not a bug)
Saving instance in session
| Reported by: | Tristan Croll | Owned by: | Eric Pettersen |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Sessions | Version: | |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
The following bug report has been submitted:
Platform: Linux-3.10.0-1127.13.1.el7.x86_64-x86_64-with-centos-7.8.2003-Core
ChimeraX Version: 1.0 (2020-06-04 23:15:07 UTC)
Description
I have a class, `ResidueStepper`, whose role is to handle smoothly "stepping" the view through a model one residue at a time. Currently on creation I add it as a property of the `AtomicStructure` it's attached to. It would be nice to be able to save and restore it with the session so the user can easily pick up where they left off. I've made it a subclass of `State` and implemented `take_snapshot()` and `restore_snapshot()`... but now I realise I don't know how to actually register it to take part in session save/restore (it seems all my other cases have been subclasses of classes for which this is already handled automatically). What do I need to do here?
Log:
UCSF ChimeraX version: 1.0 (2020-06-04)
© 2016-2020 Regents of the University of California. All rights reserved.
> open test.cxs
Deleting atomic symmetry model...
Deleting (LIVE) MDFF potential
Deleting (LIVE) 2mFo-DFc_sharp_29
Deleting (LIVE) 2mFo-DFc
Deleting (LIVE) mFo-DFc
Deleting Crystallographic maps (3io0-sf.mtz)
restore_snapshot for "RotamerRestraintMgr" returned None
Log from Mon Aug 3 18:15:24 2020UCSF ChimeraX version: 1.0 (2020-06-04)
© 2016-2020 Regents of the University of California. All rights reserved.
> open /home/tic20/test.cxs format session
restore_snapshot for "RotamerRestraintMgr" returned None
Log from Mon Aug 3 18:11:42 2020UCSF ChimeraX version: 1.0 (2020-06-04)
© 2016-2020 Regents of the University of California. All rights reserved.
> open test.cxs
Deleting atomic symmetry model...
Deleting (LIVE) 2mFo-DFc
Deleting (LIVE) MDFF potential
Deleting (LIVE) 2mFo-DFc_sharp_29
Deleting (LIVE) mFo-DFc
Deleting Crystallographic maps (3io0-sf.mtz)
restore_snapshot for "RotamerRestraintMgr" returned None
Log from Mon Aug 3 18:11:04 2020UCSF ChimeraX version: 1.0 (2020-06-04)
© 2016-2020 Regents of the University of California. All rights reserved.
How to cite UCSF ChimeraX
Successfully installed 'ChimeraX_ISOLDE-1.0rc1-cp37-cp37m-linux_x86_64.whl'
Looking in indexes: https://pypi.org/simple,
https://cxtoolshed.rbvi.ucsf.edu/pypi/
Processing
./.cache/ChimeraX/1.0/installers/ChimeraX_ISOLDE-1.0rc1-cp37-cp37m-linux_x86_64.whl
Requirement already satisfied, skipping upgrade: ChimeraX-Arrays~=1.0 in
/opt/UCSF/ChimeraX/lib/python3.7/site-packages (from ChimeraX-ISOLDE==1.0rc1)
(1.0)
Requirement already satisfied, skipping upgrade: ChimeraX-Clipper~=0.13.0 in
./.local/share/ChimeraX/1.0/site-packages (from ChimeraX-ISOLDE==1.0rc1)
(0.13.0)
Requirement already satisfied, skipping upgrade: ChimeraX-Atomic>=1.0 in
/opt/UCSF/ChimeraX/lib/python3.7/site-packages (from ChimeraX-ISOLDE==1.0rc1)
(1.0)
Requirement already satisfied, skipping upgrade: ChimeraX-
Core~=1.0rc202005052344 in /opt/UCSF/ChimeraX/lib/python3.7/site-packages
(from ChimeraX-ISOLDE==1.0rc1) (1.0)
Requirement already satisfied, skipping upgrade: ChimeraX-Graphics~=1.0 in
/opt/UCSF/ChimeraX/lib/python3.7/site-packages (from ChimeraX-
Atomic>=1.0->ChimeraX-ISOLDE==1.0rc1) (1.0)
Requirement already satisfied, skipping upgrade: ChimeraX-Geometry~=1.0 in
/opt/UCSF/ChimeraX/lib/python3.7/site-packages (from ChimeraX-
Atomic>=1.0->ChimeraX-ISOLDE==1.0rc1) (1.0)
Installing collected packages: ChimeraX-ISOLDE
Attempting uninstall: ChimeraX-ISOLDE
Found existing installation: ChimeraX-ISOLDE 1.0rc1
Uninstalling ChimeraX-ISOLDE-1.0rc1:
Successfully uninstalled ChimeraX-ISOLDE-1.0rc1
Successfully installed ChimeraX-ISOLDE-1.0rc1
Lock 139937780277904 acquired on
/home/tic20/.cache/ChimeraX/1.0/toolshed/bundle_info.cache.lock
Lock 139937780277904 released on
/home/tic20/.cache/ChimeraX/1.0/toolshed/bundle_info.cache.lock
WARNING: You are using pip version 20.1; however, version 20.2 is available.
You should consider upgrading via the '/usr/bin/chimerax -m pip install
--upgrade pip' command.
> isolde demo crystal_intro
> set selectionWidth 4
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.2/A | predicted microcompartment protein
WARNING: multiple experimental reflection datasets found:
(dataset) FOBS, SIGFOBS,
(dataset) IOBS, SIGIOBS,
(dataset) DANO, SIGDANO,
(dataset) F(+), SIGF(+), F(-), SIGF(-),
(dataset) I(+), SIGI(+), I(-), SIGI(-)
Automatically choosing "(dataset) IOBS, SIGIOBS".
Reflection data provided as intensities. Performing French & Wilson scaling to
convert to amplitudes...
Loaded crystallographic demo: PDB ID 3io0
Done loading forcefield
> save test.cxs
opened ChimeraX session
> isolde stepto
> isolde stepto
> isolde stepto
> isolde stepto
> save test.cxs
opened ChimeraX session
> isolde stepto
> isolde stepto
> isolde stepto
> isolde stepto
> save test.cxs
opened ChimeraX session
> isolde stepto
> ui tool show Shell
/opt/UCSF/ChimeraX/lib/python3.7/site-packages/IPython/core/history.py:226:
UserWarning: IPython History requires SQLite, your history will not be saved
warn("IPython History requires SQLite, your history will not be saved")
OpenGL version: 3.3.0 NVIDIA 450.51.05
OpenGL renderer: TITAN Xp/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
Manufacturer: Dell Inc.
Model: Precision T5600
OS: CentOS Linux 7 Core
Architecture: 64bit ELF
CPU: 32 Intel(R) Xeon(R) CPU E5-2687W 0 @ 3.10GHz
Cache Size: 20480 KB
Memory:
total used free shared buff/cache available
Mem: 62G 6.0G 43G 207M 13G 56G
Swap: 4.9G 0B 4.9G
Graphics:
03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP102 [TITAN Xp] [10de:1b02] (rev a1)
Subsystem: NVIDIA Corporation Device [10de:11df]
Kernel driver in use: nvidia
PyQt version: 5.12.3
Compiled Qt version: 5.12.4
Runtime Qt version: 5.12.8
Change History (5)
comment:1 by , 5 years ago
| Component: | Unassigned → Sessions |
|---|---|
| Owner: | set to |
| Platform: | → all |
| Project: | → ChimeraX |
| Status: | new → accepted |
| Summary: | ChimeraX bug report submission → Saving instance in session |
comment:2 by , 5 years ago
| Resolution: | → not a bug |
|---|---|
| Status: | accepted → closed |
comment:4 by , 5 years ago
There appears to be a severe bug in StateManager.init_state_manager() (that I only noticed *after* I uploaded the ISOLDE release...). On the creation of the third StateManager of the same name, it falls into an infinite loop, because in the following i is never incremented:
else:
i = 1
while True:
tag = "%s %d" % (base_tag, i)
try:
session.get_state_manager(tag)
except KeyError:
break
I haven't actually *announced* the ISOLDE 1.0 release yet... would it be possible to pull it off the Tool Shed so I can put in a workaround for the time being?
comment:5 by , 5 years ago
I have fixed the bug and pushed the fix, but it's in the core so it won't get into a release until 1.1. Haven't heard back from Greg yet about replacing the ISOLDE 1.0 release.
For this case, you need to inherit from chimerax.state.StateManager rather than State. It has take/restore_snaphot methods, which would be unchanged. Your class's init method would also need to call self.init_state_manager(session, description), where "description" is a string that identifies what your class does in a specific enough way that it is unlikely to collide with the descriptions of other StateManager classes. It doesn't need to describe what a specific _instance_ does -- init_state_manager() will append to the description as necessary to distinguish instances. In the unlikely case that your class has a destroy() method, it would need to call super().destroy().
There is an example of using a StateManager in cmd.py in the swap_res bundle. The class is _RotamerStateManager.