Changeset ce176ca in sasmodels


Ignore:
Timestamp:
Jul 18, 2016 2:55:59 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
51ec7e8
Parents:
4a21b121
Message:

fix parameter show/hide for multiplicity models

Location:
sasmodels
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/modelinfo.py

    rc5ac2b2 rce176ca  
    876876            hidden = self.hidden(control) 
    877877        else: 
    878             controls = [p for p in self.parameters.kernel_parameters] 
     878            controls = [p for p in self.parameters.kernel_parameters 
     879                        if p.is_control] 
    879880            if len(controls) != 1: 
    880881                raise ValueError("more than one control parameter") 
  • sasmodels/models/rpa.py

    r46ed760 rce176ca  
    9494    ["b[4]", "Ang", 5.0, [0, inf], "", "segment length"], 
    9595 
    96     ["Kab", "", -0.0004, [-inf, inf], "", "Interaction parameter"], 
    97     ["Kac", "", -0.0004, [-inf, inf], "", "Interaction parameter"], 
    98     ["Kad", "", -0.0004, [-inf, inf], "", "Interaction parameter"], 
    99     ["Kbc", "", -0.0004, [-inf, inf], "", "Interaction parameter"], 
    100     ["Kbd", "", -0.0004, [-inf, inf], "", "Interaction parameter"], 
    101     ["Kcd", "", -0.0004, [-inf, inf], "", "Interaction parameter"], 
     96    ["K12", "", -0.0004, [-inf, inf], "", "A:B interaction parameter"], 
     97    ["K13", "", -0.0004, [-inf, inf], "", "A:C interaction parameter"], 
     98    ["K14", "", -0.0004, [-inf, inf], "", "A:D interaction parameter"], 
     99    ["K23", "", -0.0004, [-inf, inf], "", "B:C interaction parameter"], 
     100    ["K24", "", -0.0004, [-inf, inf], "", "B:D interaction parameter"], 
     101    ["K34", "", -0.0004, [-inf, inf], "", "C:D interaction parameter"], 
    102102] 
    103103 
     
    108108control = "case_num" 
    109109HIDE_NONE = set() 
    110 HIDE_A = set("Na Phia va La Kab Kac Kad".split()) 
    111 HIDE_AB = set("Nb Phib vb Lb Kbc Kbd".split()).union(HIDE_A) 
    112 def hidden(pars): 
    113     case_num = pars.get("case_num", parameters[0][2]) 
     110HIDE_A = set("N1 Phi1 v1 L1 b1 K12 K13 K14".split()) 
     111HIDE_AB = set("N2 Phi2 v2 L2 b2 K23 K24".split()).union(HIDE_A) 
     112def hidden(case_num): 
    114113    if case_num < 2: 
    115114        return HIDE_AB 
  • sasmodels/sasview_model.py

    ra738209 rce176ca  
    138138            non_fittable.append(p.name) 
    139139            variants = MultiplicityInfo( 
    140                 len(p.choices), p.name, p.choices, xlabel 
    141             ) 
    142             break 
    143         elif p.is_control: 
    144             non_fittable.append(p.name) 
    145             variants = MultiplicityInfo( 
    146                 int(p.limits[1]), p.name, p.choices, xlabel 
     140                len(p.choices) if p.choices else int(p.limits[1]), 
     141                p.name, p.choices, xlabel 
    147142            ) 
    148143            break 
Note: See TracChangeset for help on using the changeset viewer.