Changeset a4b9b7a in sasview


Ignore:
Timestamp:
Oct 5, 2018 5:16:46 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
00a40bd
Parents:
3ab2105
Message:

Modified batch grid viewer after changes to magnetic param names.
Adjusted unit tests.

Location:
src/sas/qtgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    r712db9e ra4b9b7a  
    120120        fittingWindow.SASModelToQModel("cylinder") 
    121121        mag_index = fittingWindow.lstMagnetic.model().index(0,0) 
    122         self.assertEqual(mag_index.data(), "up:frac_i") 
     122        self.assertEqual(mag_index.data(), "up_frac_i") 
    123123        mag_index = fittingWindow.lstMagnetic.model().index(1,0) 
    124         self.assertEqual(mag_index.data(), "up:frac_f") 
     124        self.assertEqual(mag_index.data(), "up_frac_f") 
    125125        mag_index = fittingWindow.lstMagnetic.model().index(2,0) 
    126         self.assertEqual(mag_index.data(), "up:angle") 
     126        self.assertEqual(mag_index.data(), "up_angle") 
    127127        mag_index = fittingWindow.lstMagnetic.model().index(3,0) 
    128         self.assertEqual(mag_index.data(), "M0:sld") 
     128        self.assertEqual(mag_index.data(), "sld_M0") 
    129129        mag_index = fittingWindow.lstMagnetic.model().index(4,0) 
    130         self.assertEqual(mag_index.data(), "mtheta:sld") 
     130        self.assertEqual(mag_index.data(), "sld_mtheta") 
    131131        mag_index = fittingWindow.lstMagnetic.model().index(5,0) 
    132         self.assertEqual(mag_index.data(), "mphi:sld") 
     132        self.assertEqual(mag_index.data(), "sld_mphi") 
    133133        mag_index = fittingWindow.lstMagnetic.model().index(6,0) 
    134         self.assertEqual(mag_index.data(), "M0:sld_solvent") 
     134        self.assertEqual(mag_index.data(), "sld_solvent_M0") 
    135135        mag_index = fittingWindow.lstMagnetic.model().index(7,0) 
    136         self.assertEqual(mag_index.data(), "mtheta:sld_solvent") 
     136        self.assertEqual(mag_index.data(), "sld_solvent_mtheta") 
    137137        mag_index = fittingWindow.lstMagnetic.model().index(8,0) 
    138         self.assertEqual(mag_index.data(), "mphi:sld_solvent") 
     138        self.assertEqual(mag_index.data(), "sld_solvent_mphi") 
    139139 
    140140        # test the delegate a bit 
     
    581581        for row in range(self.widget._magnet_model.rowCount()): 
    582582            func_index = self.widget._magnet_model.index(row, 0) 
    583             self.assertIn(':', self.widget._magnet_model.item(row, 0).text()) 
     583            self.assertIn('_', self.widget._magnet_model.item(row, 0).text()) 
    584584 
    585585 
  • src/sas/qtgui/Utilities/GridPanel.py

    rfa762f4 ra4b9b7a  
    307307        model = data[0][0] 
    308308 
    309         # TODO: add a conditional for magnetic models 
    310         param_list = [m for m in model.model.params.keys() if ":" not in m] 
     309        disperse_params = list(model.model.dispersion.keys()) 
     310        magnetic_params = model.model.magnetic_params 
     311        optimized_params = model.param_list 
     312        # Create the main parameter list 
     313        param_list = [m for m in model.model.params.keys() if (m not in model.model.magnetic_params and ".width" not in m)] 
     314 
     315        # add fitted polydisp parameters 
     316        param_list += [m+".width" for m in disperse_params if m+".width" in optimized_params] 
     317 
     318        # add fitted magnetic params 
     319        param_list += [m for m in magnetic_params if m in optimized_params] 
    311320 
    312321        # Check if 2D model. If not, remove theta/phi 
Note: See TracChangeset for help on using the changeset viewer.