Changeset 058f6c3 in sasview
- Timestamp:
- Jun 22, 2018 4:33:42 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
- Children:
- 8f882fe
- Parents:
- 3bab401
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/file_reader_base_class.py
r3bab401 r058f6c3 308 308 new_output = [] 309 309 for data in self.output: 310 if data.isSesans: 311 new_output.append(data) 312 continue 310 313 file_x_unit = data._xunit 311 314 data_conv_x = Converter(file_x_unit) … … 333 336 message.format(default_q_unit) 334 337 data.errors.append(message) 335 new_output.append(data)336 338 elif isinstance(data, Data2D): 337 339 try: … … 356 358 message.format(default_q_unit) 357 359 data.errors.append(message) 358 new_output.append(data)359 360 else: 360 361 # TODO: Throw error of some sort... 361 362 pass 363 new_output.append(data) 362 364 self.output = new_output 363 365 -
src/sas/sascalc/dataloader/readers/cansas_reader.py
r2469df7 r058f6c3 812 812 node.append(point) 813 813 self.write_node(point, "Q", datainfo.x[i], 814 {'unit': datainfo. x_unit})814 {'unit': datainfo._xunit}) 815 815 if len(datainfo.y) >= i: 816 816 self.write_node(point, "I", datainfo.y[i], 817 {'unit': datainfo. y_unit})817 {'unit': datainfo._yunit}) 818 818 if datainfo.dy is not None and len(datainfo.dy) > i: 819 819 self.write_node(point, "Idev", datainfo.dy[i], 820 {'unit': datainfo. y_unit})820 {'unit': datainfo._yunit}) 821 821 if datainfo.dx is not None and len(datainfo.dx) > i: 822 822 self.write_node(point, "Qdev", datainfo.dx[i], 823 {'unit': datainfo. x_unit})823 {'unit': datainfo._xunit}) 824 824 if datainfo.dxw is not None and len(datainfo.dxw) > i: 825 825 self.write_node(point, "dQw", datainfo.dxw[i], 826 {'unit': datainfo. x_unit})826 {'unit': datainfo._xunit}) 827 827 if datainfo.dxl is not None and len(datainfo.dxl) > i: 828 828 self.write_node(point, "dQl", datainfo.dxl[i], 829 {'unit': datainfo. x_unit})829 {'unit': datainfo._xunit}) 830 830 if datainfo.isSesans: 831 831 sesans_attrib = {'x_axis': datainfo._xaxis, -
src/sas/sascalc/dataloader/readers/red2d_reader.py
r3bab401 r058f6c3 317 317 318 318 # Units of axes 319 self. set_default_2d_units()319 self.current_dataset = self.set_default_2d_units(self.current_dataset) 320 320 321 321 # Store loading process information -
test/sasdataloader/test/utest_cansas.py
rf53d684 r058f6c3 91 91 reader = XMLreader(self.xml_valid, self.schema_1_0) 92 92 valid = reader.validate_xml() 93 if valid: 94 self.assertTrue(valid) 95 else: 96 self.assertFalse(valid) 93 self.assertTrue(valid) 97 94 98 95 def _check_data(self, data): … … 193 190 def test_save_cansas_v1_0(self): 194 191 xmlreader = XMLreader(self.isis_1_0, self.schema_1_0) 195 valid = xmlreader.validate_xml() 196 self.assertTrue(valid) 192 self.assertTrue(xmlreader.validate_xml()) 197 193 reader_generic = Loader() 198 194 dataloader = reader_generic.load(self.isis_1_0) … … 207 203 return_data = reader2.read(self.write_1_0_filename) 208 204 written_data = return_data[0] 209 XMLreader(self.write_1_0_filename, self.schema_1_0) 210 valid = xmlreader.validate_xml() 211 self.assertTrue(valid) 205 xmlreader = XMLreader(self.write_1_0_filename, self.schema_1_0) 206 self.assertTrue(xmlreader.validate_xml()) 212 207 self._check_data(written_data) 213 208 if os.path.isfile(self.write_1_0_filename):
Note: See TracChangeset
for help on using the changeset viewer.