Changeset 3eb7bf2 in sasview for src/sas/sascalc


Ignore:
Timestamp:
Aug 2, 2017 5:48:29 AM (7 years ago)
Author:
lewis
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:
f26b7c1
Parents:
2a52b0e
Message:

Better comments and remove unused IgorReader?

Location:
src/sas/sascalc/dataloader
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/loader.py

    r8dec7e7 r3eb7bf2  
    7474            pass  # try the ASCII reader 
    7575        except FileContentsException as fc_exc: 
    76             raise RuntimeError(fc_exc.message) 
     76            # File has an associated reader but it failed 
     77            raise RuntimeError(fc_exc) 
    7778        except Exception: 
    7879            pass 
     80 
     81        # File has no associated reader - try the ASCII reader 
    7982        try: 
    8083            ascii_loader = ascii_reader.Reader() 
     
    8386            pass  # Loader specific error to try the cansas XML reader 
    8487        except FileContentsException as e: 
    85             # TODO: handle error 
    8688            raise RuntimeError(e) 
     89 
     90        # ASCII reader failed - try CanSAS xML reader 
    8791        try: 
    8892            cansas_loader = cansas_reader.Reader() 
    8993            return cansas_loader.read(path) 
    9094        except DefaultReaderException: 
    91             pass  # Loader specific error to try the cansas NeXuS reader 
     95            pass  # Loader specific error to try the NXcanSAS reader 
    9296        except FileContentsException as e: 
    93             # TODO: Handle errors properly 
    9497            raise RuntimeError(e) 
    9598        except Exception as csr: 
    96             # TODO: Modify cansas reader to throw DefaultReaderException 
    9799            pass 
     100 
     101        # CanSAS XML reader failed - try NXcanSAS reader 
    98102        try: 
    99103            cansas_nexus_loader = cansas_reader_HDF5.Reader() 
     
    104108            msg = "\n\tUnknown data format: %s.\n\tThe file is not a " % path 
    105109            msg += "known format that can be loaded by SasView.\n" 
    106             raise NoKnownLoaderException, msg 
     110            raise NoKnownLoaderException(msg) 
    107111        except FileContentsException as e: 
    108             # TODO: Handle error(s) properly 
    109112            raise RuntimeError(e) 
    110113 
Note: See TracChangeset for help on using the changeset viewer.