﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
1515	Make StructureArg more flexible	Tristan Croll	Tom Goddard	"A minor thing, but I'd like to propose the below modification to `StructureArg`, allowing it to succeed if (and only if) exactly one model in the specified model's subtree (including the specified model itself) is a `Structure`. This would be useful for the `Clipper` plugin, where upon initialisation the atomic model is moved under a top-level ""Data Manager"" `Model` containing all the handlers for atomic symmetry, crystallographic maps etc. Making this change would allow adding extra crystallographic maps via e.g. 
`open 3io0-sf.mtz structureModel #1`

rather than having to search through the Model Panel to work out that the atomic model is now #1.3. 

{{{
class StructureArg(ModelArg):
    """"""Parse command structure specifier""""""
    name = ""a structure specifier""

    @classmethod
    def parse(cls, text, session):
        m, text, rest = super().parse(text, session)
        from . import Structure
        models = [cm for cm in m.all_models() if isinstance(cm, Structure)]
        if len(models) != 1:
            if not isinstance(m, Structure):
                raise AnnotationError('Model spec must contain a single Structure')
        return models[0], text, rest
}}}"	enhancement	closed	minor		Command Line		fixed		Elaine Meng				all	ChimeraX
