Ignore:
Timestamp:
Jun 26, 2017 4:22:56 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
50fcb09
Parents:
98e3f24
Message:

move models.py to sascalc/fit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/model_thread.py

    rba8d326 r65f3930  
    44 
    55import time 
     6import math 
     7 
    68import numpy as np 
    7 import math 
     9 
    810from sas.sascalc.data_util.calcthread import CalcThread 
    911from sas.sascalc.fit.MultiplicationModel import MultiplicationModel 
     
    240242    class CalcCommandline: 
    241243        def __init__(self, n=20000): 
    242             #print thread.get_ident() 
    243             from sas.models.CylinderModel import CylinderModel 
    244  
    245             model = CylinderModel() 
    246  
    247  
    248             print model.runXY([0.01, 0.02]) 
     244            #print(thread.get_ident()) 
     245 
     246            from sasmodels.sasview_model import _make_standard_model 
     247            cylinder = _make_standard_model('cylinder') 
     248            model = cylinder() 
     249 
     250            print(model.runXY([0.01, 0.02])) 
    249251 
    250252            qmax = 0.01 
     
    255257            y = numpy.arange(-qmax, qmax+qstep*0.01, qstep) 
    256258 
    257  
    258259            calc_thread_2D = Calc2D(x, y, None, model.clone(),None, 
    259260                                    -qmax, qmax,qstep, 
    260                                             completefn=self.complete, 
    261                                             updatefn=self.update , 
    262                                             yieldtime=0.0) 
     261                                    completefn=self.complete, 
     262                                    updatefn=self.update , 
     263                                    yieldtime=0.0) 
    263264 
    264265            calc_thread_2D.queue() 
     
    269270 
    270271        def update(self,output): 
    271             print "update" 
     272            print("update") 
    272273 
    273274        def complete(self, image, data, model, elapsed, qmin, qmax,index, qstep ): 
    274             print "complete" 
     275            print("complete") 
    275276            self.done = True 
    276277 
Note: See TracChangeset for help on using the changeset viewer.