Changeset b65ae90 in sasview


Ignore:
Timestamp:
Apr 1, 2014 6:22:22 AM (11 years ago)
Author:
Jeff Krzywon <jeffery.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:
b099388
Parents:
d0ac63f
Message:

Fixed the issue with error handling in the cansas reader.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sans/dataloader/readers/cansas_reader.py

    r92c8fec rb65ae90  
    305305                            return 
    306306                        except: 
    307                             err_msg = "error occured" 
     307                            err_msg = "CanSAS reader: could not convert the units" 
     308                            self.errors.append(err_msg) 
    308309                            return 
    309310                    else: 
     
    414415                                            or node_value.lower() == "nan": 
    415416                        node_value = "0.0" 
    416                     try: 
    417                         node_value, unit = self._unit_conversion(\ 
     417                    node_value, unit = self._unit_conversion(\ 
    418418                                cs_values.current_level, attr, data1d, \ 
    419419                                tagname, node_value, cs_values.ns_optional) 
    420                     except TypeError: 
    421                         print "TypeError with units of {0} and node of {1}".format(attr['unit'], tagname) 
    422420                     
    423421                # If appending to a dictionary (meta_data | run_name) 
     
    463461                        except AttributeError as e: 
    464462                            pass 
    465                              
    466                       
     463             
     464            except TypeError: 
     465                pass 
    467466            except Exception as e: 
    468467                exc_type, exc_obj, exc_tb = sys.exc_info() 
  • test/sansdataloader/test/utest_abs_reader.py

    rd0ac63f rb65ae90  
    350350         
    351351        self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D") 
    352         self.assertEqual(len(self.data.errors), 0) 
     352        self.assertEqual(len(self.data.errors), 1) 
    353353         
    354354         
Note: See TracChangeset for help on using the changeset viewer.