Changeset 31ae428 in sasmodels


Ignore:
Timestamp:
Sep 5, 2017 9:20:36 AM (7 years ago)
Author:
lewis
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
a85a569
Parents:
60335cc
Message:

Fix labelling of mixture model parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/mixture.py

    r61a4bd4 r31ae428  
    7979                i += npars 
    8080 
    81     model_num = len(all_parts) - len(parts) 
    82     if model_num != 0: 
    83         model_num += 1 
    84  
    85     for k, part in enumerate(parts): 
     81    for part in parts: 
    8682        # Parameter prefix per model, A_, B_, ... 
    8783        # Note that prefix must also be applied to id and length_control 
    8884        # to support vector parameters 
    89         prefix = chr(ord('A')+k+model_num) + '_' 
    90         if part.composition and part.composition[0] == 'mixture': 
    91             # Parameter already has a prefix as it's part of a composition model 
    92             prefix = '' 
    93             model_num -= 1 
     85        prefix = '' 
     86        if not part.composition: 
     87            # Model isn't a composition model, so it's parameters don't have a 
     88            # a prefix. Add the next available prefix 
     89            prefix = chr(ord('A')+len(used_prefixes)) 
     90            used_prefixes.append(prefix) 
     91            prefix += '_' 
    9492             
    9593        if operation == '+': 
Note: See TracChangeset for help on using the changeset viewer.