Changeset 56e2e3e in sasview


Ignore:
Timestamp:
Apr 4, 2017 6:05:18 PM (7 months ago)
Author:
Adam Washington <adam.washington@…>
Branches:
master, ESS_GUI, ESS_GUI_SasView245, costrafo411, py3, ticket-853-fit-gui-to-calc, ticket-869, ticket-887-reorg, ticket-915, ticket-947-sasmodels-docs, ticket-976, unittest-saveload
Children:
cb9feea8
Parents:
bc6532e
Message:

Put error checking for empty sesans files into a smarter place

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/sesans_reader.py

    rbc6532e r56e2e3e  
    6565                        headers[h[:-1].strip()] = temp[-1][1:-1] 
    6666                    data = np.loadtxt(input_f) 
     67                    if data.size < 1: 
     68                        raise RuntimeError("{} is empty".format(path)) 
    6769                    x = data[:, 0] 
    6870                    dx = data[:, 3] 
     
    105107                        float(self._header_fetch(params, "Q_ymax")), 
    106108                        self._fetch_unit(params, "Q_ymax")) 
    107  
    108                 if len(output.x) < 1: 
    109                     raise RuntimeError("%s is empty" % path) 
    110                 return output 
     109                    return output 
    111110 
    112111        else: 
Note: See TracChangeset for help on using the changeset viewer.