Changes in / [9258c43c:8b89396] in sasview
- Files:
-
- 6 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
build_tools/requirements.txt
rc16172d r36ca21e 3 3 pylint 4 4 unittest-xml-reporting==1.10.0 5 pyparsing >=2.05 pyparsing==1.5.5 6 6 html5lib==0.95 7 7 reportlab==2.5 -
setup.py
rc16172d r1a3602d 402 402 403 403 required = [ 404 'bumps>=0.7.5.9', 'periodictable>=1.5.0', 'pyparsing >=2.0.0',404 'bumps>=0.7.5.9', 'periodictable>=1.5.0', 'pyparsing<2.0.0', 405 405 406 406 # 'lxml>=2.2.2', -
src/sas/sascalc/dataloader/file_reader_base_class.py
r4a8d55c ra58b5a0 31 31 FIELDS_2D = ('data', 'qx_data', 'qy_data', 'q_data', 'err_data', 32 32 'dqx_data', 'dqy_data', 'mask') 33 DEPRECATION_MESSAGE = ("\rThe extension of this file suggests the data set migh" 34 "t not be fully reduced. Support for the reader associat" 35 "ed with this file type has been removed. An attempt to " 36 "load the file was made, but, should it be successful, " 37 "SasView cannot guarantee the accuracy of the data.") 33 38 34 39 35 class FileReader(object): … … 44 40 # List of allowed extensions 45 41 ext = ['.txt'] 46 # Deprecated extensions47 deprecated_extensions = ['.asc', '.nxs']48 42 # Bypass extension check and try to load anyway 49 43 allow_all = False … … 93 87 if not self.f_open.closed: 94 88 self.f_open.close() 95 if any(filepath.lower().endswith(ext) for ext in96 self.deprecated_extensions):97 self.handle_error_message(DEPRECATION_MESSAGE)98 89 if len(self.output) > 0: 99 90 # Sort the data that's been loaded … … 155 146 else: 156 147 logger.warning(msg) 157 raise NoKnownLoaderException(msg)158 148 159 149 def send_to_output(self): -
src/sas/sascalc/dataloader/loader.py
r4a8d55c rdc8d1c2 90 90 ascii_loader = ascii_reader.Reader() 91 91 return ascii_loader.read(path) 92 except NoKnownLoaderException:93 pass # Try the Cansas XML reader94 92 except DefaultReaderException: 95 93 pass # Loader specific error to try the cansas XML reader … … 102 100 cansas_loader = cansas_reader.Reader() 103 101 return cansas_loader.read(path) 104 except NoKnownLoaderException:105 pass # Try the NXcanSAS reader106 102 except DefaultReaderException: 107 103 pass # Loader specific error to try the NXcanSAS reader -
src/sas/sascalc/fit/pagestate.py
r3b070a0 r574adc7 646 646 name = value.split(':', 1)[1].strip() 647 647 file_value = "File name:" + name 648 #Truncating string so print doesn't complain of being outside margins649 if sys.platform != "win32":650 MAX_STRING_LENGHT = 50651 if len(file_value) > MAX_STRING_LENGHT:652 file_value = "File name:.."+file_value[-MAX_STRING_LENGHT+10:]653 648 file_name = CENTRE % file_value 654 649 if len(title) == 0: … … 726 721 html_str, text_str, title = self._get_report_string() 727 722 # Allow 2 figures to append 728 #Constraining image width for OSX and linux, so print doesn't complain of being outside margins 729 if sys.platform == "win32": 730 image_links = [FEET_2%fig for fig in fig_urls] 731 else: 732 image_links = [FEET_2_unix%fig for fig in fig_urls] 723 image_links = [FEET_2%fig for fig in fig_urls] 724 733 725 # final report html strings 734 726 report_str = html_str + ELINE.join(image_links) 735 report_str += FEET_3 727 736 728 return report_str, text_str 737 729 … … 1376 1368 """ 1377 1369 FEET_2 = \ 1378 """<img src="%s"></img> 1379 """ 1380 FEET_2_unix = \ 1381 """<img src="%s" width="540"></img> 1370 """<img src="%s" ></img> 1382 1371 """ 1383 1372 FEET_3 = \ -
src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py
r2924532 r20fa5fe 185 185 try: 186 186 message = "Loading {}...\n".format(p_file) 187 self.load_update( message=message, info="info")187 self.load_update(output=output, message=message, info="info") 188 188 temp = self.loader.load(p_file, format) 189 189 if not isinstance(temp, list): … … 201 201 else: 202 202 file_errors[basename] = [error_message] 203 204 self.load_update(message="Loaded {}\n".format(p_file), 205 info="info") 203 self.load_update(output=output, 204 message=error_message, info="warning") 205 206 self.load_update(output=output, 207 message="Loaded {}\n".format(p_file), 208 info="info") 206 209 207 210 except NoKnownLoaderException as e: 208 211 exception_occurred = True 212 logger.error(e.message) 213 209 214 error_message = "Loading data failed!\n" + e.message 210 self.load_complete(output=None, 211 message=error_message, 212 info="warning") 215 self.load_update(output=None, message=e.message, info="warning") 213 216 214 217 except Exception as e: 215 218 exception_occurred = True 219 logger.error(e.message) 220 216 221 file_err = "The Data file you selected could not be " 217 222 file_err += "loaded.\nMake sure the content of your file" … … 220 225 file_err += " following:\n" 221 226 file_err += e.message 222 self.load_complete(output=None, 223 message=file_err, 224 info="error") 227 file_errors[basename] = [file_err] 225 228 226 229 if len(file_errors) > 0: 227 230 error_message = "" 228 231 for filename, error_array in file_errors.iteritems(): 229 error_message += "The following issues were found whilst "232 error_message += "The following errors occured whilst " 230 233 error_message += "loading {}:\n".format(filename) 231 234 for message in error_array: 232 235 error_message += message + "\n" 233 error_message = error_message[:-1] 234 self.load_complete(output=output, 235 message=error_message, 236 info="error") 237 238 elif not exception_occurred: # Everything loaded as expected 236 error_message += "\n" 237 if not exception_occurred: # Some data loaded but with errors 238 self.load_update(output=output, message=error_message, info="error") 239 240 if not exception_occurred: # Everything loaded as expected 239 241 self.load_complete(output=output, message="Loading data complete!", 240 242 info="info") … … 242 244 self.load_complete(output=None, message=error_message, info="error") 243 245 244 def load_update(self, message="", info="warning"): 246 247 def load_update(self, output=None, message="", info="warning"): 245 248 """ 246 249 print update on the status bar 247 250 """ 248 251 if message != "": 249 wx.PostEvent(self.parent, StatusEvent(status=message, 250 info=info, 252 wx.PostEvent(self.parent, StatusEvent(status=message, info=info, 251 253 type="progress")) 252 254 … … 255 257 post message to status bar and return list of data 256 258 """ 257 wx.PostEvent(self.parent, StatusEvent(status=message, 258 info=info, 259 wx.PostEvent(self.parent, StatusEvent(status=message, info=info, 259 260 type="stop")) 260 261 if output is not None: -
src/sas/sasgui/guiframe/report_dialog.py
r91552b5 r69a6897 27 27 class BaseReportDialog(wx.Dialog): 28 28 29 def __init__(self, report_list, imgRAM, fig_urls,*args, **kwds):29 def __init__(self, report_list, *args, **kwds): 30 30 """ 31 31 Initialization. The parameters added to Dialog are: … … 37 37 kwds["image"] = 'Dynamic Image' 38 38 39 #MemoryFSHandle for storing images40 self.imgRAM = imgRAM41 #Images location in urls42 self.fig_urls = fig_urls43 39 # title 44 40 self.SetTitle("Report") … … 79 75 hbox.Add(button_print) 80 76 81 if sys.platform != "darwin": 82 button_save = wx.Button(self, wx.NewId(), "Save") 83 button_save.SetToolTipString("Save this report.") 84 button_save.Bind(wx.EVT_BUTTON, self.onSave, id=button_save.GetId()) 85 hbox.Add(button_save) 77 button_save = wx.Button(self, wx.NewId(), "Save") 78 button_save.SetToolTipString("Save this report.") 79 button_save.Bind(wx.EVT_BUTTON, self.onSave, id=button_save.GetId()) 80 hbox.Add(button_save) 86 81 87 82 # panel for report page … … 116 111 printh.PrintText(self.report_html) 117 112 118 119 113 def OnClose(self, event=None): 120 114 """ … … 122 116 : event: Close button event 123 117 """ 124 for fig in self.fig_urls:125 self.imgRAM.RemoveFile(fig)126 127 118 self.Close() 128 119 -
src/sas/sasgui/perspectives/calculator/model_editor.py
rd247504b rd247504b 391 391 self._msg_box.SetLabel(msg) 392 392 self._msg_box.SetForegroundColour(color) 393 self._set_model_list()394 393 if self.parent.parent is not None: 395 394 from sas.sasgui.guiframe.events import StatusEvent … … 433 432 if len(main_list) > 1: 434 433 main_list.sort() 435 self.model1.Clear()436 self.model2.Clear()437 434 for idx in range(len(main_list)): 438 435 self.model1.Append(str(main_list[idx]), idx) -
src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
r1cf490b6 r7432acb 18 18 matplotlib.use('WXAgg') 19 19 from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas 20 from matplotlib.backends.backend_wxagg import NavigationToolbar2Wx Aggas Toolbar20 from matplotlib.backends.backend_wxagg import NavigationToolbar2Wx as Toolbar 21 21 from matplotlib.backend_bases import FigureManagerBase 22 22 # Wx-Pylab magic for displaying plots within an application's window. -
src/sas/sasgui/perspectives/fitting/basepage.py
rc192960 r1f4d708 641 641 # get the strings for report 642 642 report_str, text_str = self.state.report(fig_urls=refs) 643 643 644 # Show the dialog 644 645 report_list = [report_str, text_str, images] 645 dialog = ReportDialog(report_list, imgRAM, refs,None, wx.ID_ANY, "")646 dialog = ReportDialog(report_list, None, wx.ID_ANY, "") 646 647 dialog.Show() 647 648 … … 676 677 refs.append('memory:' + name) 677 678 imgRAM.AddFile(name, canvas.bitmap, wx.BITMAP_TYPE_PNG) 679 678 680 # append figs 679 681 images.append(fig) … … 1470 1472 # we need to check here ourselves. 1471 1473 if not is_modified: 1472 is_modified = self._check_value_enter(self.fittable_param) 1473 is_modified = self._check_value_enter( 1474 self.fixed_param) or is_modified 1475 is_modified = self._check_value_enter( 1476 self.parameters) or is_modified 1474 is_modified = (self._check_value_enter(self.fittable_param) 1475 or self._check_value_enter(self.fixed_param) 1476 or self._check_value_enter(self.parameters)) 1477 1477 1478 1478 # Here we should check whether the boundaries have been modified. … … 1536 1536 data=[self.data]) 1537 1537 # Check the values 1538 is_modified = self._check_value_enter(self.fittable_param)1539 is_modified = self._check_value_enter(self.fixed_param) or is_modified1540 is_modified = self._check_value_enter(self.parameters) or is_modified1538 is_modified = (self._check_value_enter(self.fittable_param) 1539 or self._check_value_enter(self.fixed_param) 1540 or self._check_value_enter(self.parameters)) 1541 1541 1542 1542 # If qmin and qmax have been modified, update qmin and qmax and … … 2324 2324 2325 2325 # Update value in model if it has changed 2326 if (value != self.model.getParam(name) or 2327 (np.isnan(value) and np.isnan(self.model.getParam(name)))): 2326 if value != self.model.getParam(name): 2328 2327 self.model.setParam(name, value) 2329 2328 is_modified = True -
src/sas/sasgui/perspectives/fitting/fitpage.py
ra7c6f38 rbfeb823 365 365 # StaticText for chi2, N(for fitting), Npts + Log/linear spacing 366 366 self.tcChi = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 367 self.tcChi.SetToolTipString("Chi2/ DOF (DOF=Npts-Npar fitted)")367 self.tcChi.SetToolTipString("Chi2/Npts(Fit)") 368 368 self.Npts_fit = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 369 369 self.Npts_fit.SetToolTipString( … … 391 391 self.points_sizer.Add(self.pointsbox) 392 392 393 box_description_1 = wx.StaticText(self, wx.ID_ANY, ' Reduced Chi2')393 box_description_1 = wx.StaticText(self, wx.ID_ANY, ' Chi2/Npts') 394 394 box_description_2 = wx.StaticText(self, wx.ID_ANY, 'Npts(Fit)') 395 395 -
src/sas/sasgui/perspectives/fitting/media/fitting_help.rst
r8b89396 r8b89396 426 426 See :ref:`Assessing_Fit_Quality`. 427 427 428 The objective of model-fitting is to find a *physically-plausible* model, and 429 set of model parameters, that generate a theory that reproduces the experimental 430 data and minimizes the values of the residuals.428 The objective of model-fitting is to find a *physically-plausible* model, and set 429 of model parameters, that generate a theory that reproduces the experimental data 430 and gives residual values as close to zero as possible. 431 431 432 432 Change the default values of the model parameters by hand until the theory line 433 starts to represent the experimental data. Then check the tick boxes alongside 434 the 'background' and 'scale' parameters. Click the *Fit* button. SasView 435 will optimise the values of the 'background' and 'scale' and also display the 436 corresponding uncertainties on the optimised values. 437 438 .. note:: 439 If the uncertainty on a fitted parameter is unrealistically large, or if it 440 displays as NaN, the model is most likely a poor representation of the data, 441 the parameter in question is highly correlated with one or more of the other 442 fitted parameters, or the model is relatively insensitive to the value of 443 that particular parameter. 444 445 In the bottom left corner of the *Fit Page* is a box displaying a normalised 446 value of the statistical $\chi^2$ parameter (the reduced $\chi^2$, 447 See :ref:`Assessing_Fit_Quality`) returned by the optimiser. 433 starts to represent the experimental data. Then uncheck the tick boxes alongside 434 all parameters *except* the 'background' and the 'scale'. Click the *Fit* button. 435 SasView will optimise the values of the 'background' and 'scale' and also display 436 the corresponding uncertainties on the optimised values. 437 438 *NB: If no uncertainty is shown it generally means that the model is not very* 439 *dependent on the corresponding parameter (or that one or more parameters are* 440 *'correlated').* 441 442 In the bottom left corner of the *Fit Page* is a box displaying the normalised value 443 of the statistical $\chi^2$ parameter returned by the optimiser. 448 444 449 445 Now check the box for another model parameter and click *Fit* again. Repeat this 450 process until all relevant parameters are checked and have been optimised. As451 the fit of the theory to the experimental data improves, the value of 'Reduced 452 Chi2' will decrease. A good model fit should produce values of Reduced Chi2 453 close to one, and certainly < <100. See :ref:`Assessing_Fit_Quality`.446 process until most or all parameters are checked and have been optimised. As the 447 fit of the theory to the experimental data improves the value of 'chi2/Npts' will 448 decrease. A good model fit should easily produce values of 'chi2/Npts' that are 449 close to one, and certainly <100. See :ref:`Assessing_Fit_Quality`. 454 450 455 451 SasView has a number of different optimisers (see the section :ref:`Fitting_Options`). … … 466 462 *the Data Explorer is checked (see the section* :ref:`Loading_data` *).* 467 463 468 This mode is an extension of the :ref:`Single_Fit_Mode` that allows for some 469 relatively extensive constraints between fitted parameters in a single *FitPage* 470 or between several *FitPage*'s (eg, to constrain all fitted parameters to be the 471 same in a contrast series of *FitPages* except for the solvent sld parameter, 472 constrain the length to be twice that of the radius in a single *FitPage*, 473 fix the radius of the sphere in one *FitPage* to be the same as the radius of 474 the cylinder in a second *FitPage*, etc). 464 This mode is an extension of the :ref:`Single_Fit_Mode` that fits two or more data 465 sets *to the same model* simultaneously. If necessary it is possible to constrain 466 fit parameters between data sets (eg, to fix a background level, or radius, etc). 475 467 476 468 If the data to be fit are in multiple files, load each file, then select each file … … 509 501 next to *Add Constraint?* in the *Fit Constraints* box. 510 502 511 To constrain all identically named parameters to fit *simultaneously* to the512 same value across all the *Fitpages* use the *Easy Setup* drop-down buttons in513 the *Const & Simul Fit* page.514 515 503 *NB: You can only constrain parameters that are set to refine.* 504 505 When ready, click the *Fit* button on the *Const & Simul Fit* page, NOT the *Fit* 506 button on the individual *FitPage*'s. 507 508 Simultaneous Fits without Constraints 509 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 510 511 The results of the model-fitting will be returned to each of the individual 512 *FitPage*'s. 513 514 Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To 515 see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the 516 bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`. 517 518 Simultaneous Fits with Constraints 519 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 520 521 Use the *Easy Setup* drop-down buttons in the *Const & Simul Fit* page to set 522 up constraints between *FitPage*'s. 516 523 517 524 Constraints will generally be of the form … … 528 535 Many constraints can be entered for a single fit. 529 536 530 When ready, click the *Fit* button on the *Const & Simul Fit* page, NOT the *Fit*531 button on the individual *FitPage*'s.532 533 537 The results of the model-fitting will be returned to each of the individual 534 538 *FitPage*'s. 535 539 536 Note that the Reduced Chi2 value returned is the SUM of the Reduced Chi2 of 537 each fit. To see the Reduced Chi2 value for a specific *FitPage*, click the 538 *Compute* button at the bottom of that *FitPage* to recalculate. Note that in 539 doing so the degrees of freedom will be set to Npts. 540 See :ref:`Assessing_Fit_Quality`. Moreover in the case of constraints the 541 degrees of freedom are less than one might think due to those constraints. 540 Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To 541 see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the 542 bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`. 542 543 543 544 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 765 766 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 766 767 767 .*Document History* 768 769 | 2017-09-10 Paul Butler 770 | 2017-09-15 Steve King 771 | 2018-03-05 Paul Butler 768 .. note:: This help document was last changed by Paul Butler, 10 September 769 2017 -
src/sas/sasgui/perspectives/fitting/media/residuals_help.rst
r84ac3f1 r99ded31 27 27 28 28 $\chi^2$ is a statistical parameter that quantifies the differences between 29 an observed data set and an expected dataset (or 'theory') calculated as 29 an observed data set and an expected dataset (or 'theory'). 30 31 When showing the a model with the data, *SasView* displays this parameter 32 normalized to the number of data points, $N_\mathrm{pts}$ such that 30 33 31 34 .. math:: 32 35 33 \chi^2 34 = \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] 36 \chi^2_N 37 = \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] / N_\mathrm{pts} 35 38 36 Fitting typically minimizes the value of $\chi^2$. For assessing the quality of 37 the model and its "fit" however, *SasView* displays the traditional reduced 38 $\chi^2_R$ which normalizes this parameter by dividing it by the number of 39 degrees of freedom (or DOF). The DOF is the number of data points being 40 considered, $N_\mathrm{pts}$, reduced by the number of free (i.e. fitted) 41 parameters, $N_\mathrm{par}$. Note that model parameters that are kept fixed do 42 *not* contribute to the DOF (they are not "free"). This reduced value is then 43 given as 39 When performing a fit, *SasView* instead displays the reduced $\chi^2_R$, 40 which takes into account the number of fitting parameters $N_\mathrm{par}$ 41 (to calculate the number of 'degrees of freedom'). This is computed as 44 42 45 43 .. math:: … … 49 47 / [N_\mathrm{pts} - N_\mathrm{par}] 50 48 51 Note that this means the displayed value will vary depending on the number of 52 parameters used in the fit. In particular, when doing a calculation without a 53 fit (e.g. manually changing a parameter) the DOF will now equal $N_\mathrm{pts}$ 54 and the $\chi^2_R$ will be the smallest possible for that combination of model, 55 data set, and set of parameter values. 56 57 When $N_\mathrm{pts} \gg N_\mathrm{par}$ as it should for proper fitting, the 58 value of the reduced $\chi^2_R$ will not change very much. 49 The normalized $\chi^2_N$ and the reduced $\chi^2_R$ are very close to each 50 other when $N_\mathrm{pts} \gg N_\mathrm{par}$. 59 51 60 52 For a good fit, $\chi^2_R$ tends to 1. … … 98 90 | 2015-06-08 Steve King 99 91 | 2017-09-28 Paul Kienzle 100 | 2018-03-04 Paul Butler -
test/corfunc/test/utest_corfunc.py
r6ef75fa6 rf53d684 74 74 while True: 75 75 time.sleep(0.001) 76 if (not self.calculator.transform_isrunning() and 77 self.transformation is not None): 76 if not self.calculator.transform_isrunning(): 78 77 break 79 78 80 transform1, transform3, idf = self.transformation 79 def transform_callback(self, transforms): 80 transform1, transform3, idf = transforms 81 81 self.assertIsNotNone(transform1) 82 82 self.assertAlmostEqual(transform1.y[0], 1) 83 83 self.assertAlmostEqual(transform1.y[-1], 0, 5) 84 85 def transform_callback(self, transforms):86 84 self.transformation = transforms 87 85 -
test/sascalculator/test/utest_sas_gen.py
r39a018b rf53d684 60 60 Test that the calculator calculates. 61 61 """ 62 f = self.omfloader.read( find("A_Raw_Example-1.omf"))62 f = self.omfloader.read("A_Raw_Example-1.omf") 63 63 omf2sld = sas_gen.OMF2SLD() 64 64 omf2sld.set_data(f) -
test/sasdataloader/test/utest_generic_file_reader_class.py
r4a8d55c rf53d684 8 8 import numpy as np 9 9 10 from sas.sascalc.dataloader.data_info import DataInfo, plottable_1D, Data1D 11 from sas.sascalc.dataloader.loader import Loader 12 from sas.sascalc.dataloader.loader_exceptions import NoKnownLoaderException 10 from sas.sascalc.dataloader.data_info import DataInfo, plottable_1D 13 11 from sas.sascalc.dataloader.file_reader_base_class import FileReader 14 12 … … 26 24 self.bad_file = find("ACB123.txt") 27 25 self.good_file = find("123ABC.txt") 28 self.generic_reader = Loader()29 self.deprecated_file_type = find("FEB18012.ASC")30 26 31 27 def test_bad_file_path(self): 32 self.assertRaises(NoKnownLoaderException, self.reader.read,33 self.bad_file)28 output = self.reader.read(self.bad_file) 29 self.assertEqual(output, []) 34 30 35 31 def test_good_file_path(self): … … 40 36 self.assertEqual(len(output), 1) 41 37 self.assertEqual(output[0].meta_data["blah"], '123ABC exists!') 42 43 def test_old_file_types(self):44 f = self.generic_reader.load(self.deprecated_file_type)45 last_f = f[0]46 if hasattr(last_f, "errors"):47 self.assertEquals(len(last_f.errors), 1)48 else:49 self.fail("Errors did not propogate to the file properly.")50 51 def test_same_file_unknown_extensions(self):52 # Five files, all with the same content, but different file extensions53 no_ext = find("test_data//TestExtensions")54 not_xml = find("test_data//TestExtensions.notxml")55 # Deprecated extensions56 asc_dep = find("test_data//TestExtensions.asc")57 nxs_dep = find("test_data//TestExtensions.nxs")58 # Native extension as a baseline59 xml_native = find("test_data//TestExtensions.xml")60 # Load the files and check contents61 no_ext_load = self.generic_reader.load(no_ext)62 asc_load = self.generic_reader.load(asc_dep)63 nxs_load = self.generic_reader.load(nxs_dep)64 not_xml_load = self.generic_reader.load(not_xml)65 xml_load = self.generic_reader.load(xml_native)66 self.check_unknown_extension(no_ext_load[0])67 self.check_unknown_extension(asc_load[0])68 self.check_unknown_extension(nxs_load[0])69 self.check_unknown_extension(not_xml_load[0])70 self.check_unknown_extension(xml_load[0])71 # Be sure the deprecation warning is passed with the file72 self.assertEquals(len(asc_load[0].errors), 1)73 self.assertEquals(len(nxs_load[0].errors), 1)74 75 def check_unknown_extension(self, data):76 self.assertTrue(isinstance(data, Data1D))77 self.assertEquals(len(data.x), 138)78 self.assertEquals(data.sample.ID, "TK49 c10_SANS")79 self.assertEquals(data.meta_data["loader"], "CanSAS XML 1D")80 38 81 39 def tearDown(self):
Note: See TracChangeset
for help on using the changeset viewer.