models

sans.perspectives.fitting.models

class sans.perspectives.fitting.models.ModelList

Bases: object

Contains dictionary of model and their type

__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x08A12C90>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()
__module__ = 'sans.perspectives.fitting.models'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

get_list()

return all the list stored in a dictionary object

set_list()
Parameters:
  • name – the type of the list
  • mylist – the list to add
class sans.perspectives.fitting.models.ModelManager

Bases: object

implement model

_ModelManager__modelmanager = <sans.perspectives.fitting.models.ModelManagerBase instance at 0x02446A30>
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x08A03090>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

__module__ = 'sans.perspectives.fitting.models'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_getModelList()
_get_multifunc_models()
_on_model()
findModels()
get_model_list()
is_changed()
populate_menu()
update()
class sans.perspectives.fitting.models.ModelManagerBase
__init__()
__module__ = 'sans.perspectives.fitting.models'
_fill_menu()

Fill the menu with list item

Parameters:
  • menuinfo – submenu item for the first column of this modelmenu with info.Should be a list : [name(string) , menu(wx.menu), help(string)]
  • list1 – contains item (form factor )to fill modelmenu second column
  • list2 – contains item (Structure factor )to fill modelmenu third column
_fill_plugin_menu()

fill the plugin menu with costumized models

_fill_simple_menu()

Fill the menu with list item

Parameters:
  • modelmenu – the menu to fill
  • menuinfo – submenu item for the first column of this modelmenu with info.Should be a list : [name(string) , menu(wx.menu), help(string)]
  • list1 – contains item (form factor )to fill modelmenu second column
_getModelList()

List of models we want to make available by default for this application

Returns:the next free event ID following the new menu events
_get_multifunc_models()

Get the multifunctional models

_on_model()

React to a model menu event

Parameters:event – wx menu event
event_owner = None
findModels()

find plugin model in directory of plugin .recompile all file in the directory if file were modified

form_factor_dict = {'100': [<class 'sans.models.SphereModel.SphereModel'>]}
get_model_list()

return dictionary of models for fitpanel use

is_changed()

check the last time the plugin dir has changed and return true is the directory was modified else return false

last_time_dir_modified = 0
model_combobox = <sans.perspectives.fitting.models.ModelList object at 0x02449270>
multi_func_list = [<class sans.models.CoreMultiShellModel.CoreMultiShellModel at 0x024613F0>, <class sans.models.OnionExpShellModel.OnionExpShellModel at 0x02461930>, <class sans.models.SphericalSLDModel.SphericalSLDModel at 0x02461B40>, <class sans.models.RPA10Model.RPA10Model at 0x02516D80>, <class sans.models.UnifiedPowerRgModel.UnifiedPowerRgModel at 0x0252A210>, <class sans.models.ReflectivityModel.ReflectivityModel at 0x0252A480>, <class sans.models.ReflectivityIIModel.ReflectivityIIModel at 0x0252A750>]
multiplication_factor = [<class 'sans.models.SphereModel.SphereModel'>, <class 'sans.models.FuzzySphereModel.FuzzySphereModel'>, <class 'sans.models.CoreShellModel.CoreShellModel'>, <class sans.models.CoreMultiShellModel.CoreMultiShellModel at 0x024613F0>, <class 'sans.models.VesicleModel.VesicleModel'>, <class 'sans.models.MultiShellModel.MultiShellModel'>, <class sans.models.OnionExpShellModel.OnionExpShellModel at 0x02461930>, <class sans.models.SphericalSLDModel.SphericalSLDModel at 0x02461B40>, <class 'sans.models.CylinderModel.CylinderModel'>, <class 'sans.models.CoreShellCylinderModel.CoreShellCylinderModel'>, <class 'sans.models.HollowCylinderModel.HollowCylinderModel'>, <class 'sans.models.StackedDisksModel.StackedDisksModel'>, <class 'sans.models.ParallelepipedModel.ParallelepipedModel'>, <class 'sans.models.CSParallelepipedModel.CSParallelepipedModel'>, <class 'sans.models.EllipticalCylinderModel.EllipticalCylinderModel'>, <class 'sans.models.EllipsoidModel.EllipsoidModel'>, <class 'sans.models.CoreShellEllipsoidModel.CoreShellEllipsoidModel'>, <class 'sans.models.TriaxialEllipsoidModel.TriaxialEllipsoidModel'>]
plugins = []
populate_menu()

Populate a menu with our models

Parameters:
  • id – first menu event ID to use when binding the menu events
  • modelmenu – wx.Menu object to populate
  • event_owner – wx object to bind the menu events to
Returns:

the next free event ID following the new menu events

shape_indep_list = [<class sans.models.PowerLawAbsModel.PowerLawAbsModel at 0x02487D80>, <class sans.models.BEPolyelectrolyte.BEPolyelectrolyte at 0x02487DE0>, <class sans.models.BroadPeakModel.BroadPeakModel at 0x02487E10>, <class sans.models.CorrLengthModel.CorrLengthModel at 0x02487E40>, <class sans.models.DABModel.DABModel at 0x02487ED0>, <class sans.models.DebyeModel.DebyeModel at 0x02487F60>, <class 'sans.models.FractalModel.FractalModel'>, <class sans.models.FractalCoreShellModel.FractalCoreShellModel at 0x024B0DB0>, <class sans.models.GaussLorentzGelModel.GaussLorentzGelModel at 0x02516690>, <class sans.models.GuinierModel.GuinierModel at 0x02516750>, <class sans.models.GuinierPorodModel.GuinierPorodModel at 0x02516780>, <class sans.models.LorentzModel.LorentzModel at 0x02516840>, <class sans.models.PeakGaussModel.PeakGaussModel at 0x025168D0>, <class sans.models.PeakLorentzModel.PeakLorentzModel at 0x02516960>, <class 'sans.models.Poly_GaussCoil.Poly_GaussCoil'>, <class sans.models.PolymerExclVolume.PolymerExclVolume at 0x02516AB0>, <class sans.models.PorodModel.PorodModel at 0x02516BD0>, <class sans.models.RPA10Model.RPA10Model at 0x02516D80>, <class sans.models.TeubnerStreyModel.TeubnerStreyModel at 0x02516F00>, <class sans.models.TwoLorentzianModel.TwoLorentzianModel at 0x02516F60>, <class sans.models.TwoPowerLawModel.TwoPowerLawModel at 0x02516FC0>, <class sans.models.UnifiedPowerRgModel.UnifiedPowerRgModel at 0x0252A210>, <class sans.models.LineModel.LineModel at 0x0252A2D0>]
shape_list = [<class 'sans.models.SphereModel.SphereModel'>, <class 'sans.models.BinaryHSModel.BinaryHSModel'>, <class 'sans.models.FuzzySphereModel.FuzzySphereModel'>, <class 'sans.models.CoreShellModel.CoreShellModel'>, <class sans.models.CoreMultiShellModel.CoreMultiShellModel at 0x024613F0>, <class 'sans.models.VesicleModel.VesicleModel'>, <class 'sans.models.MultiShellModel.MultiShellModel'>, <class sans.models.OnionExpShellModel.OnionExpShellModel at 0x02461930>, <class sans.models.SphericalSLDModel.SphericalSLDModel at 0x02461B40>, <class 'sans.models.PearlNecklaceModel.PearlNecklaceModel'>, <class 'sans.models.CylinderModel.CylinderModel'>, <class 'sans.models.CoreShellCylinderModel.CoreShellCylinderModel'>, <class 'sans.models.HollowCylinderModel.HollowCylinderModel'>, <class 'sans.models.FlexibleCylinderModel.FlexibleCylinderModel'>, <class 'sans.models.FlexCylEllipXModel.FlexCylEllipXModel'>, <class 'sans.models.StackedDisksModel.StackedDisksModel'>, <class 'sans.models.ParallelepipedModel.ParallelepipedModel'>, <class 'sans.models.CSParallelepipedModel.CSParallelepipedModel'>, <class 'sans.models.EllipticalCylinderModel.EllipticalCylinderModel'>, <class 'sans.models.BarBellModel.BarBellModel'>, <class 'sans.models.CappedCylinderModel.CappedCylinderModel'>, <class 'sans.models.EllipsoidModel.EllipsoidModel'>, <class 'sans.models.CoreShellEllipsoidModel.CoreShellEllipsoidModel'>, <class 'sans.models.TriaxialEllipsoidModel.TriaxialEllipsoidModel'>, <class 'sans.models.LamellarModel.LamellarModel'>, <class 'sans.models.LamellarFFHGModel.LamellarFFHGModel'>, <class 'sans.models.LamellarPSModel.LamellarPSModel'>, <class 'sans.models.LamellarPSHGModel.LamellarPSHGModel'>, <class 'sans.models.LamellarPCrystalModel.LamellarPCrystalModel'>, <class 'sans.models.SCCrystalModel.SCCrystalModel'>, <class 'sans.models.FCCrystalModel.FCCrystalModel'>, <class 'sans.models.BCCrystalModel.BCCrystalModel'>]
struct_factor_dict = {}
struct_list = [<class 'sans.models.SquareWellStructure.SquareWellStructure'>, <class 'sans.models.HardsphereStructure.HardsphereStructure'>, <class 'sans.models.StickyHSStructure.StickyHSStructure'>, <class 'sans.models.HayterMSAStructure.HayterMSAStructure'>]
update()

return a dictionary of model if new models were added else return empty dictionary

sans.perspectives.fitting.models._check_plugin()

Do some checking before model adding plugins in the list

Parameters:model – class model to add into the plugin list

:param name:name of the module plugin

Return model:model if valid model or None if not valid
sans.perspectives.fitting.models._findModels()
sans.perspectives.fitting.models.log()

Table Of Contents

Previous topic

hint_fitpage

Next topic

model_thread

This Page