- Timestamp:
- Oct 25, 2017 5:46:56 AM (7 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- fe15198
- Parents:
- 5582b078
- Location:
- src/sas/sascalc/dataloader
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/file_reader_base_class.py
r9e6aeaf r61f329f0 54 54 :param filepath: The full or relative path to a file to be loaded 55 55 """ 56 self.reset_state() 56 57 if os.path.isfile(filepath): 57 58 basename, extension = os.path.splitext(os.path.basename(filepath)) … … 86 87 # Return a list of parsed entries that data_loader can manage 87 88 return self.output 89 90 def reset_state(self): 91 """ 92 Resets the class state to a base case when loading a new data file so previous 93 data files do not appear a second time 94 """ 95 self.current_datainfo = None 96 self.current_dataset = None 97 self.output = [] 88 98 89 99 def nextline(self): -
src/sas/sascalc/dataloader/readers/cansas_reader.py
r2b538cd r61f329f0 68 68 data files do not appear a second time 69 69 """ 70 self.current_datainfo = None 71 self.current_dataset = None 72 self.current_data1d = None 70 super(Reader, self).reset_state() 73 71 self.data = [] 74 72 self.process = Process() … … 79 77 self.names = [] 80 78 self.cansas_defaults = {} 81 self.output = []82 79 self.ns_list = None 83 80 self.logging = [] -
src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
r2b538cd r61f329f0 65 65 """ 66 66 # Reinitialize when loading a new data file to reset all class variables 67 self.reset_ class_variables()67 self.reset_state() 68 68 69 69 filename = self.f_open.name … … 101 101 raise FileContentsException("Fewer than 5 data points found.") 102 102 103 def reset_ class_variables(self):103 def reset_state(self): 104 104 """ 105 105 Create the reader object and define initial states for class variables 106 106 """ 107 self.current_datainfo = None 108 self.current_dataset = None 107 super(Reader, self).reset_state() 109 108 self.data1d = [] 110 109 self.data2d = [] … … 112 111 self.errors = set() 113 112 self.logging = [] 114 self.output = []115 113 self.parent_class = u'' 116 114 self.detector = Detector()
Note: See TracChangeset
for help on using the changeset viewer.