Changeset 3f89c0e in sasview


Ignore:
Timestamp:
Mar 26, 2019 3:32:31 PM (6 months ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
ticket-1094-headless
Children:
1d56359
Parents:
7ad12e9f
Message:

raise error if file loaded by headless fit is ambiguous

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/fit/fitstate.py

    r7ad12e9f r3f89c0e  
    144144        used = [] 
    145145        for model in self.simfit.model_list: 
     146            matched = 0 
    146147            for fit in self.fits: 
    147148                #print(model['name'], fit.data_id, model_name(fit), model['model_name']) 
     
    152153                    fit.constraints = constraints.setdefault(fit.fit_page, []) 
    153154                    used.append(fit) 
    154                     break 
    155             else: 
     155                    matched += 1 
     156            if matched > 1: 
     157                raise ValueError("more than one model matches %s" 
     158                                 % model['fit_page_source']) 
     159            elif matched == 0: 
    156160                raise ValueError("could not find model %s in file" 
    157161                                 % model['fit_page_source']) 
Note: See TracChangeset for help on using the changeset viewer.