Changeset 76cd1ae in sasview for src/sans/dataloader/data_info.py


Ignore:
Timestamp:
Jan 14, 2014 3:53:36 PM (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:
16bd5ca
Parents:
083e993
Message:

Fix for the datainfo window not loading and bug fixes for the cansas data reader.

Fixes/changes:
(1) datainfo window is now loading for every data file I can test
(2) transmission spectrum information (but not data) is listed in datainfo window
(3) more than one transmission spectra can be loaded for each Data1D object
(4) fixed a bug in the cansas reader that allowed any file to be loaded as data if and only if another data file was already loaded
(5) fixed the cansas writer to include transmission spectrum data and output data in strict canSAS format
(6) increased the pylint score of cansas_constants.py to above 7
(7) increased the pylint score for all files I have modified

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/dataloader/data_info.py

    rbe577e7 r76cd1ae  
    425425    def __str__(self): 
    426426        _str  = "Transmission Spectrum:\n" 
    427         _str += "   Name:       {0}".format(self.name) 
    428         _str += "   Timestamp:  {1}".format(self.timestamp) 
    429         _str += "   Wavelength [{0}] | Transmission [{1}] | Trans Dev [{2}]\n".format(self.wavelength_unit, self.transmission_unit, self.transmission_deviation_unit) 
    430         for i in range(len(self.wavelength)): 
    431             _str += "   {0}, {1}".format(self.wavelength[i], self.transmission[i]) 
    432             if len(self.transmission_deviation > i): 
    433                 _str += ", {0}".format(self.transmission_deviation[i]) 
    434             _str += "\n" 
     427        _str += "   Name:             \t{0}\n".format(self.name) 
     428        _str += "   Timestamp:        \t{0}\n".format(self.timestamp) 
     429        _str += "   Wavelength unit:  \t{0}\n".format(self.wavelength_unit) 
     430        _str += "   Transmission unit:\t{0}\n".format(self.transmission_unit) 
     431        _str += "   Trans. Dev. unit:  \t{0}\n".format(\ 
     432                                            self.transmission_deviation_unit) 
     433        length_list = [len(self.wavelength), len(self.transmission), \ 
     434                len(self.transmission_deviation)] 
     435        _str += "   Number of Pts:    \t{0}\n".format(max(length_list)) 
    435436        return _str 
    436437     
     
    498499        self.collimation = [] 
    499500        ## Transmission Spectrum 
    500         self.trans_spectrum = TransmissionSpectrum() 
     501        self.trans_spectrum = [] 
    501502        ## Additional meta-data 
    502503        self.meta_data  = {} 
     
    533534        for item in self.notes: 
    534535            _str += "%s\n" % str(item) 
    535  
     536        for item in self.trans_spectrum: 
     537            _str += "%s\n" % str(item) 
    536538        return _str 
    537539             
     
    757759            clone = Data1D(x, y, dx=dx, dy=dy) 
    758760         
    759         clone.title       = self.title 
    760         clone.run         = self.run 
    761         clone.filename    = self.filename 
    762         clone.instrument  = self.instrument 
    763         clone.notes       = deepcopy(self.notes) 
    764         clone.process     = deepcopy(self.process) 
    765         clone.detector    = deepcopy(self.detector) 
    766         clone.sample      = deepcopy(self.sample) 
    767         clone.source      = deepcopy(self.source) 
    768         clone.collimation = deepcopy(self.collimation) 
    769         clone.meta_data   = deepcopy(self.meta_data) 
    770         clone.errors      = deepcopy(self.errors) 
     761        clone.title          = self.title 
     762        clone.run            = self.run 
     763        clone.filename       = self.filename 
     764        clone.instrument     = self.instrument 
     765        clone.notes          = deepcopy(self.notes) 
     766        clone.process        = deepcopy(self.process) 
     767        clone.detector       = deepcopy(self.detector) 
     768        clone.sample         = deepcopy(self.sample) 
     769        clone.source         = deepcopy(self.source) 
     770        clone.collimation    = deepcopy(self.collimation) 
     771        clone.trans_spectrum = deepcopy(self.trans_spectrum) 
     772        clone.meta_data      = deepcopy(self.meta_data) 
     773        clone.errors         = deepcopy(self.errors) 
    771774         
    772775        return clone 
Note: See TracChangeset for help on using the changeset viewer.