Changes in / [d3e1870:fdd3ba1] in sasview
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
build_tools/sasview_deploy_test.au3
r1cecc91 r55bbe0b2 6 6 ; 7 7 ; 0 - OK 8 ; 1 - Download failure 9 ; 2 - Installer failure 10 ; 3 - Problems running SasView (simple fitting) 11 ; 4 - Uninstaller failure 8 ; 1 - Installer failure 9 ; 2 - Problems running SasView (simple fitting) 10 ; 3 - Uninstaller failure 12 11 13 12 #include <Constants.au3> 14 13 #include <FileConstants.au3> 15 14 #include <MsgBoxConstants.au3> 16 #include <InetConstants.au3>17 15 #include <WinAPIFiles.au3> 18 16 19 ; Custom error handler20 ;Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")21 22 17 ; Modifiable globals 23 if $CmdLine[0] == 0 Then 24 ; Expected command line with the build number as argument 25 Exit (-1) 18 Global $fInstallerLocation = @TempDir & "\setupSasView.exe" 19 if $CmdLine[0] > 0 Then 20 ; If argument present - use it as local download path 21 $fInstallerLocation = $CmdLine[1] 26 22 EndIf 27 23 28 Local $lBuildNumber = $CmdLine[1]29 ;Global $fInstallerLocation = "C:\util\setupSasView.exe" ; debug and testing location30 Global $fInstallerLocation = @TempDir & "\setupSasView.exe"31 Global $fRemoteInstallerLocation = "https://jenkins.esss.dk/sasview/job/SasView_Win7_Test/" & $lBuildNumber & "/artifact/sasview/dist/setupSasView.exe"32 24 Global $fUninstallerLocation = "C:\Program Files (x86)\SasView\unins000.exe" 33 25 Global $lTimeout = 10 ; 10 sec timeout for waiting on windows … … 37 29 Global $installerPID = 0 38 30 39 40 31 ;; MAIN SCRIPT 41 Download()42 32 Install() 43 33 RunSasView() 44 34 Uninstall() 45 46 35 Exit(0) 47 36 48 37 ;============================================================== 49 Func Download()50 ; Download the file in the background with the selected option of 'force a reload from the remote site.'51 ConsoleWrite("Downloading...." & @CRLF)52 Local $iFailFlag = 153 Local $hDownload = InetGet($fRemoteInstallerLocation, $fInstallerLocation, $INET_FORCERELOAD)54 55 ; Close the handle returned by InetGet.56 InetClose($hDownload)57 Assert($hDownload, $iFailFlag)58 ConsoleWrite("Installer downloaded successfully to " & $fInstallerLocation & @CRLF)59 60 EndFunc61 38 62 39 Func Install() 63 40 ;;;;; APPLICATION INSTALLED ;;;;;;; 64 41 Local $sSetupWindow = "Setup - SasView" 65 Local $iFailFlag = 242 Local $iFailFlag = 1 66 43 ; Run setup 67 44 if FileExists($fInstallerLocation) Then … … 75 52 76 53 ; License click through 77 WinActivate($sSetupWindow) ; <-- REQUIRED when connecting from another host54 WinActivate($sSetupWindow) 78 55 Local $test = WinWaitActive($sSetupWindow, "License Agreement", $lTimeout) 79 56 ;ConsoleWrite("license agreement: " & $test) -
sasview/installer_generator.py
r6a698c0 r09afe90 199 199 msg += """Source: "dist\plugin_models\*";\tDestDir: "{userdesktop}\..\.sasview\plugin_models";\t""" 200 200 msg += """Flags: recursesubdirs createallsubdirs\n""" 201 msg += """Source: "dist\compiled_models\*";\tDestDir: "{userdesktop}\..\.sasmodels\compiled_models";\t"""202 msg += """Flags: recursesubdirs createallsubdirs\n"""203 201 msg += """Source: "dist\config\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t""" 204 202 msg += """Flags: recursesubdirs createallsubdirs\n""" -
sasview/sasview.py
re68c9bf rcde6e52 100 100 101 101 from matplotlib import backend_bases 102 backend_bases. _default_filetypes.pop('pgf', None)102 backend_bases.FigureCanvasBase.filetypes.pop('pgf', None) 103 103 104 104 class SasView(): -
sasview/setup_exe.py
r98d89df r09afe90 209 209 data_files += guiframe.data_files() 210 210 211 # precompile sas models into the sasview build path; doesn't matter too much212 # where it is so long as it is a place that will get cleaned up afterwards.213 import sasmodels.core214 dll_path = os.path.join(build_path, 'compiled_models')215 compiled_dlls = sasmodels.core.precompile_dlls(dll_path, dtype='double')216 217 # include the compiled models as data; coordinate the target path for the218 # data with installer_generator.py219 data_files.append(('compiled_models', compiled_dlls))220 221 211 import sasmodels 222 212 data_files += sasmodels.data_files() -
src/sas/sascalc/dataloader/readers/cansas_reader.py
r1686a333 r5f26aa4 206 206 # Go through each child in the parent element 207 207 for node in dom: 208 attr = node.attrib 209 name = attr.get("name", "") 210 type = attr.get("type", "") 208 211 # Get the element name and set the current names level 209 212 tagname = node.tag.replace(self.base_ns, "") … … 223 226 ## Recursion step to access data within the group 224 227 self._parse_entry(node) 228 if tagname == "SASsample": 229 self.current_datainfo.sample.name = name 230 elif tagname == "beam_size": 231 self.current_datainfo.source.beam_size_name = name 232 elif tagname == "SAScollimation": 233 self.collimation.name = name 234 elif tagname == "aperture": 235 self.aperture.name = name 236 self.aperture.type = type 225 237 self.add_intermediate() 226 238 else: … … 229 241 ## If this is a dataset, store the data appropriately 230 242 if tagname == 'Run': 243 self.current_datainfo.run_name[data_point] = name 231 244 self.current_datainfo.run.append(data_point) 232 245 elif tagname == 'Title': … … 369 382 self.process.notes.append(data_point) 370 383 elif tagname == 'term' and self.parent_class == 'SASprocess': 371 self.process.term.append(data_point) 384 unit = attr.get("unit", "") 385 dic = {} 386 dic["name"] = name 387 dic["value"] = data_point 388 dic["unit"] = unit 389 self.process.term.append(dic) 372 390 373 391 ## Transmission Spectrum … … 531 549 self.current_datainfo.collimation.append(self.collimation) 532 550 self.collimation = Collimation() 533 elif self.parent_class == ' SASaperture':551 elif self.parent_class == 'aperture': 534 552 self.collimation.aperture.append(self.aperture) 535 553 self.aperture = Aperture() … … 646 664 err_msg = None 647 665 default_unit = None 648 if 'unit' in attr and attr.get('unit') is not None and not self.ns_list.ns_optional: 666 if not isinstance(node_value, float): 667 node_value = float(node_value) 668 if 'unit' in attr and attr.get('unit') is not None: 649 669 try: 650 670 local_unit = attr['unit'] 651 if not isinstance(node_value, float):652 node_value = float(node_value)653 671 unitname = self.ns_list.current_level.get("unit", "") 654 672 if "SASdetector" in self.names: … … 907 925 self.write_node(point, "I", datainfo.y[i], 908 926 {'unit': datainfo.y_unit}) 909 if datainfo.dy !=None and len(datainfo.dy) > i:927 if datainfo.dy is not None and len(datainfo.dy) > i: 910 928 self.write_node(point, "Idev", datainfo.dy[i], 911 929 {'unit': datainfo.y_unit}) 912 if datainfo.dx !=None and len(datainfo.dx) > i:930 if datainfo.dx is not None and len(datainfo.dx) > i: 913 931 self.write_node(point, "Qdev", datainfo.dx[i], 914 932 {'unit': datainfo.x_unit}) 915 if datainfo.dxw !=None and len(datainfo.dxw) > i:933 if datainfo.dxw is not None and len(datainfo.dxw) > i: 916 934 self.write_node(point, "dQw", datainfo.dxw[i], 917 935 {'unit': datainfo.x_unit}) 918 if datainfo.dxl !=None and len(datainfo.dxl) > i:936 if datainfo.dxl is not None and len(datainfo.dxl) > i: 919 937 self.write_node(point, "dQl", datainfo.dxl[i], 920 938 {'unit': datainfo.x_unit}) … … 1184 1202 if isinstance(term, list): 1185 1203 value = term['value'] 1204 del term['value'] 1205 elif isinstance(term, dict): 1206 value = term.get("value") 1186 1207 del term['value'] 1187 1208 else: -
test/sasdataloader/test/utest_abs_reader.py
rb699768 r5f26aa4 176 176 177 177 self.assertEqual(self.data.run[0], "1234") 178 self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D") 179 self.assertEqual(len(self.data.errors), 0) 178 self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") 180 179 181 180 # Data … … 198 197 self.assertEqual(self.data.sample.name, "my sample") 199 198 self.assertEqual(self.data.sample.thickness_unit, 'mm') 200 self.assert Equal(self.data.sample.thickness, 1.03)201 202 self.assert Equal(self.data.sample.transmission, 0.327)199 self.assertAlmostEqual(self.data.sample.thickness, 1.03) 200 201 self.assertAlmostEqual(self.data.sample.transmission, 0.327) 203 202 204 203 self.assertEqual(self.data.sample.temperature_unit, 'C') … … 233 232 234 233 self.assertEqual(self.data.source.wavelength_max_unit, "nm") 235 self.assert Equal(self.data.source.wavelength_max, 1.0)234 self.assertAlmostEqual(self.data.source.wavelength_max, 1.0) 236 235 self.assertEqual(self.data.source.wavelength_min_unit, "nm") 237 self.assert Equal(self.data.source.wavelength_min, 0.22)236 self.assertAlmostEqual(self.data.source.wavelength_min, 0.22) 238 237 self.assertEqual(self.data.source.wavelength_spread_unit, "percent") 239 238 self.assertEqual(self.data.source.wavelength_spread, 14.3) … … 248 247 self.assertEqual(item.size_unit,'mm') 249 248 self.assertEqual(item.distance_unit,'mm') 250 249 251 250 if item.size.x==50 \ 252 251 and item.distance==11000.0 \ … … 294 293 self.assertTrue(item.date in ['04-Sep-2007 18:35:02', 295 294 '03-SEP-2006 11:42:47']) 295 print item.term 296 296 for t in item.term: 297 297 if t['name']=="ABS:DSTAND" \ … … 345 345 self.assertEqual(self.data.filename, filename) 346 346 # The followed should not have been loaded 347 self.assert Equal(self.data.sample.thickness, 0.00103)347 self.assertAlmostEqual(self.data.sample.thickness, 0.00103) 348 348 # This one should 349 self.assert Equal(self.data.sample.transmission, 0.327)350 351 self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D")349 self.assertAlmostEqual(self.data.sample.transmission, 0.327) 350 351 self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") 352 352 print self.data.errors 353 353 self.assertEqual(len(self.data.errors), 1) … … 385 385 386 386 if __name__ == '__main__': 387 unittest.main( testRunner=unittest.TextTestRunner(verbosity=2))387 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.