Exemplo n.º 1
0
 def test_load_data(self):
     for data_file in self.data_files:
         data = Data()
         data.path = data_file['filename']
         data.genfromtxt_args['delimiter'] = data_file['delimiter']
         if data_file['headers']: data.genfromtxt_args['skip_header'] = 1
         yield assert_allclose, data.load_data(), self.raw_data
Exemplo n.º 2
0
    def test_load_data_with_scale(self):
        data_file = self.data_files[0]
        data = Data()
        data.path = data_file['filename']
        data.genfromtxt_args['delimiter'] = data_file['delimiter']
        data.scale = (2, 5)

        raw_data_scaled = [
            [ 2 * x for x in self.raw_data[0] ],
            [ 5 * x for x in self.raw_data[1] ],
        ]
        assert_allclose(data.load_data(), raw_data_scaled)