Changeset 1abcb04 in sasview
- Timestamp:
- Jun 5, 2009 9:08:48 PM (16 years ago)
- 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:
- 410aad8
- Parents:
- 7d8094b
- Location:
- guiframe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/dataFitting.py
r858fabed r1abcb04 1 1 """ 2 A dapters for fitting module2 A Data1D class compatible with guiframe from the output of DataLoader. 3 3 """ 4 4 from danse.common.plottools.plottables import Data1D as plotData1D 5 5 from danse.common.plottools.plottables import Theory1D as plotTheory1D 6 6 7 from DataLoader.data_info import Data Info7 from DataLoader.data_info import Data1D as loader_data_1D 8 8 9 class Data1D(plotData1D,DataInfo): 10 9 class Data1D(plotData1D, loader_data_1D): 10 """ 11 A Data1D class compatible with guiframe from 12 the output of DataLoader. The new class inherits 13 from DataLoader.data_info.Data1D 14 """ 11 15 def __init__(self,x=[],y=[],dx=None,dy=None,dxl=None, dxw=None): 12 16 plotData1D.__init__(self, x, y, dx, dy) 17 loader_data_1D.__init__(self, x=x, y=y, dx=dx, dy=dy) 13 18 self.smearer=None 14 19 … … 16 21 self.dxw = dxw 17 22 18 class Theory1D(plotTheory1D,DataInfo): 23 class Theory1D(plotTheory1D, loader_data_1D): 24 """ 25 A Theory1D class compatible with guiframe from 26 the output of DataLoader. The new class inherits 27 from DataLoader.data_info.Data1D 28 """ 19 29 def __init__(self,x=[],y=[],dy=None,dxl=None, dxw=None): 20 30 plotTheory1D.__init__(self, x, y) 31 loader_data_1D.__init__(self, x=x, y=y, dx=dx, dy=dy) 21 32 self.smearer=None 22 33 -
guiframe/data_loader.py
r25ccf33 r1abcb04 74 74 """ 75 75 Use the DataLoader loader to created data to plot. 76 77 TODO: this method needs a major cleanup. 78 It's a complete mess. It needs: 79 - to be cleaned of code duplication 80 - to be cleaned of data duplication: we should not 81 need to reference all the Data1D data members. 82 It should be sufficient to use the Data1D class 83 defined in dataFitting (which btw needs a better name). 84 76 85 @param path: the path of the data to load 77 86 """ … … 125 134 new_plot = Data1D(x=output.x, y=output.y, dx=output.dx, 126 135 dy= dy, dxl=dxl, dxw=dxw) 136 # Copy all the data to the new object so that the 137 # new_plot object properly behaves as a data_info.Data1D. 138 # This also means that we should not have to copy all 139 # the data below... 140 output.clone_without_data(clone=new_plot) 127 141 128 142 ## source will request in dataLoader .manipulation module … … 160 174 161 175 ## the output of the loader is a list , some xml files contain more than one data 176 #TODO: refactor this so that there is no duplication of code. 177 # There is no reason why the code above shouldn't be put in 178 # a private method to be used within the loop below. 162 179 else: 163 180 i=1 … … 176 193 177 194 new_plot = Data1D(x=item.x,y=item.y,dx=dx,dy=item.dy,dxl=dxl,dxw=dxw) 195 # Copy all the data to the new object 196 item.clone_without_data(clone=new_plot) 178 197 new_plot.source=item.source 179 198 -
guiframe/local_perspectives/plotting/Plotter1D.py
r8068b52 r1abcb04 419 419 """ 420 420 Save 1D Data to XML file 421 422 TODO: Refactor and remove this method. See TODO in _onSave. 423 421 424 @param evt: Menu event 422 425 """ … … 439 442 """ 440 443 Save file as txt 444 445 TODO: Refactor and remove this method. See TODO in _onSave. 441 446 """ 442 447 data = self.plots[self.graph.selected_plottable] … … 495 500 path = dlg.GetPath() 496 501 mypath = os.path.basename(path) 502 503 #TODO: This is bad design. The DataLoader is designed to recognize extensions. 504 # It should be a simple matter of calling the .save(file, data, '.xml') method 505 # of the DataLoader.loader.Loader class. 506 497 507 if os.path.splitext(mypath)[1].lower() ==".txt": 498 508 self._onsaveTXT(path)
Note: See TracChangeset
for help on using the changeset viewer.