Changeset 01febaf in sasview for src/sas/sascalc
- Timestamp:
- Apr 5, 2017 3:12:48 AM (8 years ago)
- 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 64ca561
- Parents:
- f2940c4 (diff), a2e980b (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. - Location:
- src/sas/sascalc
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/resolution_calculator.py
r9a5097c r9c0f3c17 15 15 import sys 16 16 import logging 17 18 logger = logging.getLogger(__name__) 17 19 18 20 #Plank's constant in cgs unit … … 1006 1008 detector_offset = self.sample2detector_distance[1] 1007 1009 except: 1008 logg ing.error(sys.exc_value)1010 logger.error(sys.exc_value) 1009 1011 1010 1012 # detector size in [no of pix_x,no of pix_y] … … 1093 1095 output.qy_data = qy_value 1094 1096 except: 1095 logg ing.error(sys.exc_value)1097 logger.error(sys.exc_value) 1096 1098 1097 1099 return output -
src/sas/sascalc/calculator/sas_gen.py
r9a5097c r9c0f3c17 12 12 import sys 13 13 import logging 14 15 logger = logging.getLogger(__name__) 14 16 15 17 MFACTOR_AM = 2.853E-12 … … 285 287 mask = (x_dir2 + y_dir2 + z_dir2) <= 1.0 286 288 except: 287 logg ing.error(sys.exc_value)289 logger.error(sys.exc_value) 288 290 self.output = MagSLD(self.pos_x[mask], self.pos_y[mask], 289 291 self.pos_z[mask], self.sld_n[mask], … … 394 396 except: 395 397 # Skip non-data lines 396 logg ing.error(sys.exc_value)398 logger.error(sys.exc_value) 397 399 #Reading Header; Segment count ignored 398 400 s_line = line.split(":", 1) … … 589 591 z_lines.append(z_line) 590 592 except: 591 logg ing.error(sys.exc_value)593 logger.error(sys.exc_value) 592 594 593 595 output = MagSLD(pos_x, pos_y, pos_z, sld_n, sld_mx, sld_my, sld_mz) … … 683 685 except: 684 686 # Skip non-data lines 685 logg ing.error(sys.exc_value)687 logger.error(sys.exc_value) 686 688 output = MagSLD(pos_x, pos_y, pos_z, sld_n, 687 689 sld_mx, sld_my, sld_mz) -
src/sas/sascalc/data_util/calcthread.py
r934ce649 r463e7ffc 8 8 import traceback 9 9 import sys 10 import logging 10 11 11 12 if sys.platform.count("darwin") > 0: … … 21 22 from time import clock 22 23 from time import sleep 24 25 logger = logging.getLogger(__name__) 23 26 24 27 … … 244 247 pass 245 248 import logging 246 logg ing.error(traceback.format_exc())249 logger.error(traceback.format_exc()) 247 250 #print 'CalcThread exception', 248 251 -
src/sas/sascalc/dataloader/loader.py
rb699768 r463e7ffc 32 32 from readers import cansas_reader 33 33 34 logger = logging.getLogger(__name__) 35 34 36 class Registry(ExtensionRegistry): 35 37 """ … … 99 101 msg = "DataLoader couldn't locate DataLoader plugin folder." 100 102 msg += """ "%s" does not exist""" % dir 101 logg ing.warning(msg)103 logger.warning(msg) 102 104 return readers_found 103 105 … … 117 119 msg = "Loader: Error importing " 118 120 msg += "%s\n %s" % (item, sys.exc_value) 119 logg ing.error(msg)121 logger.error(msg) 120 122 121 123 # Process zip files … … 139 141 msg = "Loader: Error importing" 140 142 msg += " %s\n %s" % (mfile, sys.exc_value) 141 logg ing.error(msg)143 logger.error(msg) 142 144 143 145 except: 144 146 msg = "Loader: Error importing " 145 147 msg += " %s\n %s" % (item, sys.exc_value) 146 logg ing.error(msg)148 logger.error(msg) 147 149 148 150 return readers_found … … 190 192 msg = "Loader: Error accessing" 191 193 msg += " Reader in %s\n %s" % (module.__name__, sys.exc_value) 192 logg ing.error(msg)194 logger.error(msg) 193 195 return reader_found 194 196 … … 223 225 msg = "Loader: Error accessing Reader " 224 226 msg += "in %s\n %s" % (loader.__name__, sys.exc_value) 225 logg ing.error(msg)227 logger.error(msg) 226 228 return reader_found 227 229 … … 268 270 msg = "Loader: Error accessing Reader" 269 271 msg += " in %s\n %s" % (module.__name__, sys.exc_value) 270 logg ing.error(msg)272 logger.error(msg) 271 273 return reader_found 272 274 -
src/sas/sascalc/dataloader/readers/associations.py
re5c09cf r463e7ffc 18 18 import logging 19 19 import json 20 21 logger = logging.getLogger(__name__) 20 22 21 23 FILE_NAME = 'defaults.json' … … 67 69 msg = "read_associations: skipping association" 68 70 msg += " for %s\n %s" % (ext.lower(), sys.exc_value) 69 logg ing.error(msg)71 logger.error(msg) 70 72 else: 71 73 print "Could not find reader association settings\n %s [%s]" % (__file__, os.getcwd()) … … 81 83 :param registry_function: function to be called to register each reader 82 84 """ 83 logg ing.info("register_readers is now obsolete: use read_associations()")85 logger.info("register_readers is now obsolete: use read_associations()") 84 86 import abs_reader 85 87 import ascii_reader -
src/sas/sascalc/dataloader/readers/cansas_reader.py
r8434365 r463e7ffc 33 33 import xml.dom.minidom 34 34 from xml.dom.minidom import parseString 35 36 logger = logging.getLogger(__name__) 35 37 36 38 PREPROCESS = "xmlpreprocess" … … 1471 1473 self.errors.add(err_mess) 1472 1474 if optional: 1473 logg ing.info(err_mess)1475 logger.info(err_mess) 1474 1476 else: 1475 1477 raise ValueError, err_mess … … 1480 1482 self.errors.add(err_mess) 1481 1483 if optional: 1482 logg ing.info(err_mess)1484 logger.info(err_mess) 1483 1485 else: 1484 1486 raise ValueError, err_mess -
src/sas/sascalc/dataloader/readers/danse_reader.py
r9a5097c r9c0f3c17 19 19 from sas.sascalc.dataloader.data_info import Data2D, Detector 20 20 from sas.sascalc.dataloader.manipulations import reader2D_converter 21 22 logger = logging.getLogger(__name__) 21 23 22 24 # Look for unit converter … … 142 144 error.append(err) 143 145 except: 144 logg ing.info("Skipping line:%s,%s" %(data_str,146 logger.info("Skipping line:%s,%s" %(data_str, 145 147 sys.exc_value)) 146 148 … … 196 198 msg = "Skipping entry (v1.0):%s,%s" % (str(data[i_pt]), 197 199 sys.exc_value) 198 logg ing.info(msg)200 logger.info(msg) 199 201 200 202 # Get bin number … … 271 273 raise ValueError, msg 272 274 else: 273 logg ing.info("Danse_reader Reading %s \n" % filename)275 logger.info("Danse_reader Reading %s \n" % filename) 274 276 275 277 # Store loading process information -
src/sas/sascalc/dataloader/readers/tiff_reader.py
r9a5097c r9c0f3c17 16 16 from sas.sascalc.dataloader.data_info import Data2D 17 17 from sas.sascalc.dataloader.manipulations import reader2D_converter 18 18 19 logger = logging.getLogger(__name__) 20 19 21 class Reader: 20 22 """ … … 76 78 value = float(val) 77 79 except: 78 logg ing.error("tiff_reader: had to skip a non-float point")80 logger.error("tiff_reader: had to skip a non-float point") 79 81 continue 80 82 -
src/sas/sascalc/dataloader/readers/xml_reader.py
ra235f715 r463e7ffc 18 18 from lxml import etree 19 19 from lxml.builder import E 20 21 logger = logging.getLogger(__name__) 20 22 21 23 PARSER = etree.ETCompatXMLParser(remove_comments=True, remove_pis=False) … … 71 73 self.xmlroot = self.xmldoc.getroot() 72 74 except etree.XMLSyntaxError as xml_error: 73 logg ing.info(xml_error)75 logger.info(xml_error) 74 76 except Exception: 75 77 self.xml = None … … 88 90 self.xmlroot = etree.fromstring(tag_soup) 89 91 except etree.XMLSyntaxError as xml_error: 90 logg ing.info(xml_error)92 logger.info(xml_error) 91 93 except Exception: 92 94 self.xml = None … … 102 104 self.schemadoc = etree.parse(self.schema, parser=PARSER) 103 105 except etree.XMLSyntaxError as xml_error: 104 logg ing.info(xml_error)106 logger.info(xml_error) 105 107 except Exception: 106 108 self.schema = None -
src/sas/sascalc/pr/invertor.py
r9a5097c r9c0f3c17 18 18 from scipy import optimize 19 19 from sas.sascalc.pr.core.pr_inversion import Cinvertor 20 21 logger = logging.getLogger(__name__) 20 22 21 23 def help(): … … 495 497 # We were not able to estimate the errors 496 498 # Return an empty error matrix 497 logg ing.error(sys.exc_value)499 logger.error(sys.exc_value) 498 500 499 501 # Keep a copy of the last output … … 541 543 # number of terms 542 544 best_alpha, _, _ = self.estimate_alpha(self.nfunc) 543 logg ing.warning("Invertor.estimate_numterms: %s" % sys.exc_value)545 logger.warning("Invertor.estimate_numterms: %s" % sys.exc_value) 544 546 return self.nfunc, best_alpha, "Could not estimate number of terms" 545 547 -
src/sas/sascalc/pr/num_term.py
r9a5097c r9c0f3c17 5 5 import logging 6 6 from sas.sascalc.pr.invertor import Invertor 7 8 logger = logging.getLogger(__name__) 7 9 8 10 class NTermEstimator(object): … … 180 182 data_err = np.append(data_err, err) 181 183 except: 182 logg ing.error(sys.exc_value)184 logger.error(sys.exc_value) 183 185 184 186 return data_x, data_y, data_err
Note: See TracChangeset
for help on using the changeset viewer.