Changeset 7d64b0e in sasview


Ignore:
Timestamp:
Mar 12, 2015 10:32:08 AM (9 years ago)
Author:
krzywon
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
bb074b3
Parents:
d26dea0 (diff), ac1670a2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/SasView/sasview.git

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/sas/models/c_extension/c_models/lamellarPS.cpp

    r79492222 r37649847  
    6868  ii=0; 
    6969  Sq = 0.0; 
    70   for(ii=1;ii<(NNint-1);ii+=1) { 
     70  for(ii=1;ii<=(NNint-1);ii+=1) { 
    7171 
    7272    fii = (double)ii;   //do I really need to do this? 
     
    144144  for(int i=0; i< (int)weights_spacing.size(); i++) { 
    145145    dp[1] = weights_spacing[i].value; 
    146     for(int j=0; j< (int)weights_spacing.size(); j++) { 
    147       dp[2] = weights_delta[i].value; 
     146    //for(int j=0; j< (int)weights_spacing.size(); j++) {    BUGS fixed March 2015 
     147    for(int j=0; j< (int)weights_delta.size(); j++) { 
     148      //dp[2] = weights_delta[i].value;        BUG 
     149      dp[2] = weights_delta[j].value; 
    148150 
    149151      sum += weights_spacing[i].weight * weights_delta[j].weight * LamellarPS_kernel(dp, q); 
  • src/sas/models/c_extension/libigor/libCylinder.c

    r79492222 r8d302cd  
    13791379        ii=0; 
    13801380        Sq = 0.0; 
    1381         for(ii=1;ii<(NNint-1);ii+=1) { 
     1381        for(ii=1;ii<=(NNint-1);ii+=1) { 
    13821382         
    13831383                fii = (double)ii;               //do I really need to do this? 
     
    14511451        ii=0; 
    14521452        Sq = 0.0; 
    1453         for(ii=1;ii<(NNint-1);ii+=1) { 
     1453        for(ii=1;ii<=(NNint-1);ii+=1) { 
    14541454         
    14551455                fii = (double)ii;               //do I really need to do this? 
  • test/sasmodels/test/utest_other_models.py

    r8c9ffde rac1670a2  
    899899    def test1D(self): 
    900900        """ Test 1D model for a LamellarPS Model""" 
    901         self.assertAlmostEquals(self.comp.run(0.001), 27899.30836, 1) 
     901        self.assertAlmostEquals(self.comp.run(0.001), 28895.13397, 1) 
    902902         
    903903    def test1D_2(self): 
    904904        """ Test 2D model for a LamellarPS Model""" 
    905         self.assertAlmostEquals(self.comp.run([0.001, 1.3]),27899.30836, 1)  
     905        self.assertAlmostEquals(self.comp.run([0.001, 1.3]),28895.13397, 1)  
    906906     
    907907    def testEval_1D(self): 
     
    948948    def test1D(self): 
    949949        """ Test 1D model for a LamellarPSHG Model""" 
    950         self.assertAlmostEquals(self.comp.run(0.001),6831387.29466, 3) 
     950        self.assertAlmostEquals(self.comp.run(0.001),6838238.571488, 3) 
    951951         
    952952    def test1D_2(self): 
    953953        """ Test 2D model for a LamellarPSHG Model""" 
    954         self.assertAlmostEquals(self.comp.run([0.001, 1.3]),6831387.29466,3) 
     954        self.assertAlmostEquals(self.comp.run([0.001, 1.3]),6838238.571488,3) 
    955955         
    956956    def testEval_1D(self): 
  • sasview/default_categories.json

    refa5e44 rd26dea0  
    1 {"Shapes": [["PearlNecklaceModel", true], ["HollowCylinderModel", true], ["CoreMultiShellModel", true], ["LamellarFFHGModel", true], ["FCCrystalModel", true], ["CoreShellEllipsoidXTModel", true], ["FuzzySphereModel", true], ["CSParallelepipedModel", true], ["BCCrystalModel", true], ["EllipticalCylinderModel", true], ["RectangularHollowPrismInfThinWallsModel", true], ["LamellarPCrystalModel", true], ["OnionExpShellModel", true], ["VesicleModel", true], ["MultiShellModel", true], ["RaspBerryModel", true], ["CoreShellEllipsoidModel", true], ["CappedCylinderModel", true], ["CylinderModel", true], ["SphericalSLDModel", true], ["StackedDisksModel", true], ["LamellarPSHGModel", true], ["CoreShellBicelleModel", true], ["RectangularHollowPrismModel", true], ["LamellarPSModel", true], ["EllipsoidModel", true], ["SphereModel", true], ["ParallelepipedModel", true], ["TriaxialEllipsoidModel", true], ["LamellarModel", true], ["RectangularPrismModel", true], ["PringlesModel", true], ["CoreShellCylinderModel", true], ["BinaryHSModel", true], ["FlexibleCylinderModel", true], ["SCCrystalModel", true], ["FlexCylEllipXModel", true], ["LinearPearlsModel", true], ["CoreShellModel", true]], "Structure Factor": [["SquareWellStructure", true], ["HayterMSAStructure", true], ["HardsphereStructure", true], ["StickyHSStructure", true]], "Shape-Independent": [["TwoPowerLawModel", true], ["GelFitModel", true], ["DABModel", true], ["PowerLawAbsModel", true], ["PorodModel", true], ["MassFractalModel", true], ["TeubnerStreyModel", true], ["DebyeModel", true], ["MassSurfaceFractal", true], ["Core2ndMomentModel", true], ["TwoLorentzianModel", true], ["UnifiedPowerRgModel", true], ["PolymerExclVolume", true], ["BEPolyelectrolyte", true], ["GuinierModel", true], ["GuinierPorodModel", true], ["CorrLengthModel", true], ["StarPolymer", true], ["FractalModel", true], ["RPA10Model", true], ["PeakLorentzModel", true], ["BroadPeakModel", true], ["PeakGaussModel", true], ["FractalCoreShellModel", true], ["Poly_GaussCoil", true], ["SurfaceFractalModel", true], ["GaussLorentzGelModel", true], ["LorentzModel", true]], "Uncategorized": [["ReflectivityModel", true], ["ReflectivityIIModel", true], ["LineModel", true], ["MicelleSphCoreModel", true]]} 
     1{"Shapes": [["PearlNecklaceModel", true], ["HollowCylinderModel", true], ["CoreMultiShellModel", true], ["FCCrystalModel", true], ["CoreShellEllipsoidXTModel", true], ["FuzzySphereModel", true], ["CSParallelepipedModel", true], ["EllipticalCylinderModel", true], ["BCCrystalModel", true], ["LamellarFFHGModel", true], ["RectangularHollowPrismInfThinWallsModel", true], ["LamellarPCrystalModel", true], ["OnionExpShellModel", true], ["VesicleModel", true], ["MultiShellModel", true], ["RaspBerryModel", true], ["CoreShellEllipsoidModel", true], ["CappedCylinderModel", true], ["CylinderModel", true], ["SphericalSLDModel", true], ["StackedDisksModel", true], ["LamellarPSHGModel", true], ["CoreShellBicelleModel", true], ["RectangularHollowPrismModel", true], ["LamellarPSModel", true], ["EllipsoidModel", true], ["SphereModel", true], ["ParallelepipedModel", true], ["TriaxialEllipsoidModel", true], ["LamellarModel", true], ["PringlesModel", true], ["RectangularPrismModel", true], ["CoreShellCylinderModel", true], ["BinaryHSModel", true], ["FlexibleCylinderModel", true], ["SCCrystalModel", true], ["FlexCylEllipXModel", true], ["LinearPearlsModel", true], ["CoreShellModel", true]], "Structure Factor": [["SquareWellStructure", true], ["HayterMSAStructure", true], ["HardsphereStructure", true], ["StickyHSStructure", true]], "Shape-Independent": [["TwoPowerLawModel", true], ["GelFitModel", true], ["DABModel", true], ["PowerLawAbsModel", true], ["PorodModel", true], ["MassFractalModel", true], ["RPA10Model", true], ["TeubnerStreyModel", true], ["DebyeModel", true], ["MassSurfaceFractal", true], ["Core2ndMomentModel", true], ["TwoLorentzianModel", true], ["UnifiedPowerRgModel", true], ["PolymerExclVolume", true], ["BEPolyelectrolyte", true], ["GuinierModel", true], ["GuinierPorodModel", true], ["CorrLengthModel", true], ["StarPolymer", true], ["FractalModel", true], ["PeakLorentzModel", true], ["BroadPeakModel", true], ["PeakGaussModel", true], ["FractalCoreShellModel", true], ["Poly_GaussCoil", true], ["SurfaceFractalModel", true], ["GaussLorentzGelModel", true], ["LorentzModel", true]], "Uncategorized": [["ReflectivityModel", true], ["ReflectivityIIModel", true], ["LineModel", true], ["MicelleSphCoreModel", true]]} 
  • sasview/local_config.py

    rcaf3baa6 r418e59f  
    3434'''If you found this software useful to your work please remember to acknowledge  
    3535its use in your publications as suggested below and reference the SasView website:  
    36 http://www.sasview.org/index.html. Please also consider letting us know by sending us the  
     36http://www.sasview.org/. Please also consider letting us know by sending us the  
    3737reference to your work. This will help us to ensure the long term support and  
    3838development of the software. 
    3939''' 
    4040_acknowledgement_publications = \ 
    41 '''This work originally developed as part of the DANSE project funded by the NSF 
    42 under grant DMR-0520547, and currently maintained by NIST, UMD, ORNL, ISIS, ESS  
     41'''This work benefited from software developed by the DANSE project under NSF  
     42award DMR-0520547 and currently maintained by NIST, UMD, ORNL, ISIS, ESS  
    4343and ILL. 
    4444''' 
  • src/sas/dataloader/readers/cansas_reader.py

    r9dedf40 rd26dea0  
    105105    base_ns = "{cansas1d/1.0}" 
    106106 
    107     logging = [] 
    108     errors = [] 
     107    logging = None 
     108    errors = None 
    109109 
    110110    type_name = "canSAS" 
     
    120120    def __init__(self): 
    121121        ## List of errors 
    122         self.errors = [] 
     122        self.errors = set() 
     123        self.logging = [] 
    123124        self.encoding = None 
    124125 
     
    252253        for error in self.errors: 
    253254            data1d.errors.append(error) 
    254         del self.errors[:] 
     255        self.errors.clear() 
    255256        numpy.trim_zeros(data1d.x) 
    256257        numpy.trim_zeros(data1d.y) 
     
    301302        attr = node.attrib 
    302303        value_unit = '' 
     304        err_msg = None 
    303305        if 'unit' in attr and new_current_level.get('unit') is not None: 
    304306            try: 
     
    322324                        value_unit = local_unit 
    323325                        err_msg = "Unit converter is not available.\n" 
    324                         self.errors.append(err_msg) 
    325326                else: 
    326327                    value_unit = local_unit 
     
    333334                            ".format(data1d.{0})" 
    334335                exec intermediate.format(unitname, "{0}", "{1}") 
    335                 self.errors.append(err_msg) 
    336336                value_unit = local_unit 
    337337            except: 
     
    340340                err_msg += "\"{0}\" unit [{1}]" 
    341341                err_msg = err_msg.format(tagname, local_unit) 
    342                 self.errors.append(err_msg) 
    343342                value_unit = local_unit 
    344343        elif 'unit' in attr: 
    345344            value_unit = attr['unit'] 
     345        if err_msg: 
     346            self.errors.add(err_msg) 
    346347        node_value = "float({0})".format(node_value) 
    347348        return node_value, value_unit 
     
    355356        """ 
    356357        if data1d == None: 
    357             self.errors = [] 
     358            self.errors = set() 
    358359            x_vals = numpy.empty(0) 
    359360            y_vals = numpy.empty(0) 
     
    697698            node.append(point) 
    698699            self.write_node(point, "Q", datainfo.x[i], 
    699                             {'unit': datainfo.x_unit}) 
     700                            {'unit': datainfo._xunit}) 
    700701            if len(datainfo.y) >= i: 
    701702                self.write_node(point, "I", datainfo.y[i], 
    702                                 {'unit': datainfo.y_unit}) 
     703                                {'unit': datainfo._yunit}) 
    703704            if datainfo.dy != None and len(datainfo.dy) > i: 
    704705                self.write_node(point, "Idev", datainfo.dy[i], 
    705                                 {'unit': datainfo.y_unit}) 
     706                                {'unit': datainfo._yunit}) 
    706707            if datainfo.dx != None and len(datainfo.dx) > i: 
    707708                self.write_node(point, "Qdev", datainfo.dx[i], 
    708                                 {'unit': datainfo.x_unit}) 
     709                                {'unit': datainfo._xunit}) 
    709710            if datainfo.dxw != None and len(datainfo.dxw) > i: 
    710711                self.write_node(point, "dQw", datainfo.dxw[i], 
    711                                 {'unit': datainfo.x_unit}) 
     712                                {'unit': datainfo._xunit}) 
    712713            if datainfo.dxl != None and len(datainfo.dxl) > i: 
    713714                self.write_node(point, "dQl", datainfo.dxl[i], 
    714                                 {'unit': datainfo.x_unit}) 
     715                                {'unit': datainfo._xunit}) 
    715716 
    716717    def _write_trans_spectrum(self, datainfo, entry_node): 
     
    11691170                            err_mess += " %s unit [%s]; expecting [%s]\n  %s" \ 
    11701171                                % (variable, units, local_unit, exc_value) 
    1171                             self.errors.append(err_mess) 
     1172                            self.errors.add(err_mess) 
    11721173                            if optional: 
    11731174                                logging.info(err_mess) 
     
    11781179                        % (variable, units) 
    11791180                        err_mess += " expecting [%s]" % local_unit 
    1180                         self.errors.append(err_mess) 
     1181                        self.errors.add(err_mess) 
    11811182                        if optional: 
    11821183                            logging.info(err_mess) 
  • src/sas/guiframe/config.py

    rf53cd30 r4bf54044  
    3131'''If you found this software useful to your work please remember to acknowledge  
    3232its use in your publications as suggested below and reference the SasView website:  
    33 http://www.sasview.org/index.html. Please also consider letting us know by sending us the  
     33http://www.sasview.org/. Please also consider letting us know by sending us the  
    3434reference to your work. This will help us to ensure the long term support and  
    3535development of the software. 
    3636''' 
    3737_acknowledgement_publications = \ 
    38 '''This work originally developed as part of the DANSE project funded by the NSF 
    39 under grant DMR-0520547, and currently maintained by NIST, UMD, ORNL, ISIS, ESS  
     38'''This work benefited from software developed by the DANSE project under NSF  
     39award DMR-0520547 and currently maintained by NIST, UMD, ORNL, ISIS, ESS  
    4040and ILL. 
    4141''' 
  • src/sas/guiframe/local_perspectives/data_loader/data_loader.py

    rb9dbd6b rd26dea0  
    204204            except: 
    205205                any_error = True 
    206         if any_error or error_message != "": 
    207             if error_message == "": 
    208                 error = "Error: " + str(sys.exc_value) + "\n" 
    209                 error += "while loading Data: \n%s\n" % str(p_file) 
    210                 error_message = "The data file you selected could not be loaded.\n" 
    211                 error_message += "Make sure the content of your file" 
    212                 error_message += " is properly formatted.\n\n" 
    213                 error_message += "When contacting the SasView team, mention the" 
    214                 error_message += " following:\n%s" % str(error) 
    215             elif data_error: 
    216                 base_message = "Errors occurred while loading {0}\n".format(p_file) 
    217                 base_message += "The data file loaded but with errors.\n" 
    218                 error_message = base_message + error_message 
    219             else: 
    220                 error_message += "%s\n" % str(p_file) 
    221             info = "error" 
     206            if any_error or error_message != "": 
     207                if error_message == "": 
     208                    error = "Error: " + str(sys.exc_info()[1]) + "\n" 
     209                    error += "while loading Data: \n%s\n" % str(basename) 
     210                    error_message += "The data file you selected could not be loaded.\n" 
     211                    error_message += "Make sure the content of your file" 
     212                    error_message += " is properly formatted.\n\n" 
     213                    error_message += "When contacting the SasView team, mention the" 
     214                    error_message += " following:\n%s" % str(error) 
     215                elif data_error: 
     216                    base_message = "Errors occurred while loading " 
     217                    base_message += "{0}\n".format(basename) 
     218                    base_message += "The data file loaded but with errors.\n" 
     219                    error_message = base_message + error_message 
     220                else: 
     221                    error_message += "%s\n" % str(p_file) 
     222                info = "error" 
     223         
     224        if any_error or error_message: 
    222225            self.load_update(output=output, message=error_message, info=info) 
    223  
    224226        else: 
    225227            message = "Loading Data Complete! " 
    226228        message += log_msg 
    227229        self.load_complete(output=output, error_message=error_message, 
    228                            message=message, path=path, info=info) 
     230                           message=message, path=path, info='warning') 
    229231 
    230232    def load_update(self, output=None, message="", info="warning"): 
     
    233235        """ 
    234236        if message != "": 
    235             wx.PostEvent(self.parent, StatusEvent(status=message, info='info', 
     237            wx.PostEvent(self.parent, StatusEvent(status=message, info=info, 
    236238                                                  type="progress")) 
    237239    def load_complete(self, output, message="", error_message="", path=None, 
Note: See TracChangeset for help on using the changeset viewer.