#1967 closed defect (fixed)
'select' command reports misleading(?) number of models
Reported by: | Elaine Meng | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | General Controls | Version: | |
Keywords: | Cc: | pett | |
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
sel ##modeller_zDOPE>1
reports 1 model selected, although it’s actually all 3 submodels (#2.1-3). Maybe should report number of “leaf” models especially if they are atomic models (e.g. not pbonds or whatever) but maybe that would be too hard to special-case.
Attachments (1)
Change History (8)
by , 6 years ago
Attachment: | model-pdl.cxs added |
---|
comment:1 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:2 by , 6 years ago
I guess I don't understand why grouping models are getting included. Model.selected by default does not consider child models. Shouldn't a grouping model report itself as not selected?
comment:3 by , 6 years ago
Currently the reported number of selected models uses session.selection.models() which returns any partially selected models. If a model has a child that is partially selected then it is partially selected. So a grouping model is counted as selected if a child model is partially selected.
follow-up: 3 comment:4 by , 6 years ago
So maybe it should use len([m.selected for m in session.models]) instead?
comment:6 by , 6 years ago
Currently (in daily build) if I have atomic models #2.1-3 and use command select #2.1-3 … it reports 3 models selected. However, if I use command select #2 … it reports 4 models selected even though #2 is just a grouping model. Is that expected? These models were from a Modeller run, with #2 named target models and containing no other submodels than #2.1,#2.2, #2.3, each an atomic model named target.
follow-up: 6 comment:7 by , 6 years ago
Yes that is currently the expected behavior. A group model can be selected and by saying "select #2" where #2 is the grouping model causes it to be selected, even though it does not show anything itself. While we could try to exclude models that don't show anything themselves from the selected count, it is a bit tricky since atomic structures are in fact models that don't show anything themselves -- they have hidden children for atoms, bonds, ribbons that do all the drawing. I think a saner approach would be to define a GroupingModel and use that wherever we are just grouping and those can easily be excluded from the count.
Note:
See TracTickets
for help on using tickets.
Fixed in devel, not in 0.9.
For some reason the select command excluded structures and molecular surfaces from its model count. I've made it report the count of all selected models. One problem is that this includes grouping models. For example "select #1.1-5" reports 6 models selected because the grouping model #1 is included. This is probably ok, but maybe it would be preferable to not count grouping models. To do that we would need in the code to make something called a GroupingModel because right now we have no good way to tell which models are just for grouping.