#2159 closed defect (fixed)
self._positions is None
| Reported by: | Eric Pettersen | Owned by: | Tristan Croll |
|---|---|---|---|
| Priority: | moderate | Milestone: | |
| Component: | Graphics | Version: | |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
While trying to reproduce the maybe-double-model-delete error, instead I was able to reproduce the self._positions-is-None error with the attached script.
Attachments (1)
Change History (7)
by , 6 years ago
| Attachment: | null_pos.cxc added |
|---|
comment:1 by , 6 years ago
comment:3 by , 6 years ago
If the cartoon command is not working on a model before it is drawn that sounds like a bug and you should report it and assign it to Conrad.
comment:4 by , 6 years ago
| Cc: | removed |
|---|---|
| Owner: | changed from to |
comment:5 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Tristan says he fixed this.
comment:6 by , 6 years ago
OK, it appears the cartoon command now *does* work prior to showing the model, so that's good. But the atom display and color commands are ignored/overridden. Can raise a new ticket if you like, but this is such a niche issue it hardly seems worth it. On 2019-07-02 20:26, ChimeraX wrote:
Note:
See TracTickets
for help on using tickets.
Those look like my fault. Both of the errors raised by that script have essentially the same genesis: I have callbacks in place to adjust the model's display settings on the first 'frame drawn' trigger. The one coming from
map_mgr.pyI can probably get rid of immediately - unless I'm forgetting something, I did this while trying to work around a masking problem that turned out to be a side-effect of threading (see #1957).The other one (
AttributeError: 'AtomicSymmetryModel' object has no attribute 'session') arises from the fact that the following method (which I wrote a looong time ago, and looks like it should really be replaced with something more up-to-date) is overridden if called before the model is first drawn (it just comes up as the ChimeraX-default cartoon style):def set_to_default_cartoon(session, model = None): ''' Adjust the ribbon representation to provide information without getting in the way. ''' from chimerax.core.commands import atomspec from chimerax.std_commands import cartoon from chimerax.atomic.nucleotides.cmd import nucleotides from chimerax.atomic import AtomicStructures if model is None: aspec = None models = None else: models = AtomicStructures([model]) atoms = model.atoms atoms.displays=False atoms[atoms.idatm_types!='HC'].displays=True arg = atomspec.AtomSpecArg('thearg') aspec= arg.parse('#' + model.id_string, session)[0] cartoon.cartoon(session, atoms = aspec, suppress_backbone_display=False) cartoon.cartoon_style(session, atoms = aspec, width=0.4, thickness=0.1, arrows_helix=True, arrow_scale = 2) cartoon.cartoon_tether(session, structures=models, opacity=0) nucleotides(session, 'atoms') from chimerax.std_commands import color color.color(session, model, color='bychain', target='ac') color.color(session, model, color='byhetero', target='a')My workaround was to once again call it *after* the model has been drawn for the first time. Didn't think about what would happen if a model is prepared and closed in between drawing frames. I'll fix my code to avoid the errors, but if the
cartooncommands can be changed to work on a model prior to drawing then the need for the callback would go away entirely.