Changeset 56e2e3e in sasview for src/sas/sascalc


Ignore:
Timestamp:
Apr 4, 2017 6:05:18 PM (8 years ago)
Author:
Adam Washington <adam.washington@…>
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:
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.