ModelWrapper

class sherpa.ui.utils.ModelWrapper(session, modeltype, args=(), kwargs=None)[source] [edit on github]

Bases: NoNewAttributesAfterInit

Wrap up a model class so we can create instances easily.

Creates a model instance with a given name - you can say mdl.mname or mdl(“mname”) - and either syntax stores the model instance in the session object with the name “mname”, over-writing any previous component with this name. If mdl1 and mdl2 have been created by ModelWrapper then a user can say mdl1.n1 + mdl2.n2 to create model instances named n1 and n2 and then return the expression which represents their sum.