Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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)

null_pos.cxc (212 bytes ) - added by Eric Pettersen 6 years ago.

Download all attachments as: .zip

Change History (7)

by Eric Pettersen, 6 years ago

Attachment: null_pos.cxc added

comment:1 by Tristan Croll, 6 years ago

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.py I 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 cartoon commands can be changed to work on a model prior to drawing then the need for the callback would go away entirely.

comment:2 by Tristan Croll, 6 years ago

OK, Clipper now handles this scenario without raising exceptions.

comment:3 by Tom Goddard, 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 Tom Goddard, 6 years ago

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

comment:5 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Tristan says he fixed this.

in reply to:  7 comment:6 by tic20@…, 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.