windng
Check-in [94f1126e27]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changed behavior in dateutil.parser.parse(), read_wind() follows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:94f1126e2759067044e03d0f5c3fbdf8ca5bca76
User & Date: goyo 2016-03-14 21:10:38
Context
2016-03-14
22:36
Adapt to changes in DataFrame.to_string() (pandas 0.18.0) check-in: b2ced12a2a user: goyo tags: trunk
21:10
Changed behavior in dateutil.parser.parse(), read_wind() follows. check-in: 94f1126e27 user: goyo tags: trunk
20:39
Test_write_wind() broken in dateutil 2.5.0 check-in: 116dd161d2 user: goyo tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/test_io.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
...
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
...
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
...
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
...
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
...
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
...
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test_io.py
#
# Copyright 2012-2015 Goyo <goyodiaz@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
................................................................................
        self.assertTrue(
            (df.iloc[:, 0] == [1, 2, 3, 4]).all()
        )


class Test_read_wind(unittest.TestCase):
    def test_read_wind(self):
        sample = b"""110201 0000  2.98 301.0
110201 0010  2.69  302.0
110201 0020  2.21  316.0
110201 0030  2.50  305.0
110201 0040  2.31  300.0
"""
        result = wio.read_wind(io.BytesIO(sample), header=None,
            prefix='X', freq='10T')
        self.assertEqual(result.index.freq, '10T')
        expected = pd.DataFrame.from_items([
                ('X2', [2.98, 2.69, 2.21, 2.50, 2.31]),
                ('X3', [301., 302., 316., 305., 300.])
            ])
        expected.index = pd.date_range('2011-02-01', periods=5, freq='10T')
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_skip_blanks(self):
        sample = b"""110201 0000\t2.98
110201 0010\t2.69
110201 0020\t2.21
110201 0030\t2.50


110201 0040\t2.31
"""
        expected = pd.DataFrame(
            [2.98, 2.69, 2.21, 2.50, 2.31], columns = [1],
            index = pd.date_range('2011-02-01', periods=5, freq='10T'),
        )
        result = wio.read_wind(io.BytesIO(sample), time_col=None, sep='\t',
            freq='10T', header=None, skip_blanks=True)
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_no_timecol(self):
        sample = b"""110201 0000\t2.98
110201 0010\t2.69
110201 0020\t2.21
110201 0030\t2.50
110201 0040\t2.31
"""
        expected = pd.DataFrame(
            [2.98, 2.69, 2.21, 2.50, 2.31], columns = [1],
            index = pd.date_range('2011-02-01', periods=5, freq='10T'),
        )
        result = wio.read_wind(io.BytesIO(sample), time_col=False, sep='\t',
            freq='10T', header=None)
        pdt.assert_frame_equal(result, expected)
        result = wio.read_wind(io.BytesIO(sample), time_col=None, sep='\t',
            freq='10T', header=None)
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_sort(self):
        sample = b"""110201 0010  2.98 301.0
110201 0000  2.69  302.0
110201 0020  2.21  316.0
110201 0030  2.50  305.0
110201 0040  2.31  300.0
"""
        result = wio.read_wind(io.BytesIO(sample), header=None, sort=True)
        self.assertTrue(result.index.freq is None)
        expected = pd.DataFrame.from_items([
                (2, [2.69, 2.98, 2.21, 2.50, 2.31]),
                (3, [302., 301., 316., 305., 300.])
            ])
        expected.index = pd.date_range('2011-02-01', periods=5, freq='10T')
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_nosort(self):
        sample = b"""110201 0010  2.98 301
110201 0000  2.69  302
110201 0020  2.21  316
110201 0030  2.50  305
110201 0040  2.31  300
"""
        result = wio.read_wind(io.BytesIO(sample), header=None, sort=False)
        self.assertTrue(result.index.freq is None)

        expected = pd.DataFrame.from_items([
                (2, [2.98, 2.69, 2.21, 2.50, 2.31]),
                (3, [301, 302, 316, 305, 300])
................................................................................
            prefix='X')
        expected = [2, 1]
        self.assertListEqual(result['X2'].tolist(), expected)

    def test_read_wind_dups(self):
        """Test function read_wind with duplicates."""
        sample = (
"""110201 0000  2.98 301.0
110201 0010  2.21  302.0
110201 0010  2.22  302.0
110201 0030  2.50  305.0
110201 0040  2.31  300.0
""")
        result = wio.read_wind(io.StringIO(sample), header=None,
            discard_dups=True, prefix='X', index_name=True)

        data = np.array([[2.98, 2.21, 2.50, 2.31], [301, 302, 305, 300]]).T
        index = pd.DatetimeIndex([
            '2011-02-01 00:00', '2011-02-01 00:10',
................................................................................
        data = np.array([[2.98, 2.22, 2.50, 2.31], [301, 302, 305, 300]]).T
        expected = pd.DataFrame(data, index=index, columns=columns)
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_indexname(self):
        """Test function read_wind with explicit index_name."""
        sample = io.StringIO(
"""110201 0000  2.98 301.0
110201 0010  2.69  302.0
110201 0020  2.21  316.0
110201 0030  2.50  305.0
110201 0040  2.31  300.0
""")
        result = wio.read_wind(sample, header=None,
            prefix='X', index_name='mxyzptlk', freq='10T')
        self.assertEqual(result.index.freq, '10T')

        expected = ['X2', 'X3']
        self.assertListEqual(result.columns.tolist(), expected)
................................................................................

        expected = [301, 302, 316, 305, 300]
        self.assertListEqual(result['X3'].tolist(), expected)

    def test_read_wind_drop_empty(self):
        """Test function read_wind with drop_entry=True."""
        sample = io.StringIO(
"""110201,0000,2.98,,301.0
110201,0010,2.69,,302.0
110201,0020,2.21,,316.0
110201,0030,2.50,,305.0
110201,0040,2.31,,300.0
""")
        result = wio.read_wind(sample, sep=',', header=None,
            prefix='X', index_name='mxyzptlk', freq='10T',
            drop_empty=True)
        self.assertEqual(result.index.freq, '10T')

        expected = ['X2', 'X4']
................................................................................
        self.assertListEqual(result['X2'].tolist(), expected)

        expected = [301, 302, 316, 305, 300]
        self.assertListEqual(result['X4'].tolist(), expected)

    #ticket 4968b8addb
    def test_read_wind_timecol_0(self):
        sample = b"""0000 110201  2.98 301.0
0010 110201  2.69  302.0
0020 110201  2.21  316.0
0030 110201  2.50  305.0
0040 110201  2.31  300.0
"""
        result = wio.read_wind(io.BytesIO(sample), date_col=1, time_col=0,
            header=None, prefix='X', freq='10T')
        self.assertEqual(result.index.freq, '10T')
        expected = pd.DataFrame.from_items([
            ('X2', [2.98, 2.69, 2.21, 2.50, 2.31]),
            ('X3', [301., 302., 316., 305., 300.])
        ])
        expected.index = pd.date_range('2011-02-01', periods=5, freq='10T')
        pdt.assert_frame_equal(result, expected)

    # ticket 233a0a5c9f
    def test_read_wind_time_before_date(self):
        sample = """1.84, 148, 0000, 030619
1.63, 143, 0010, 030619
1.51, 142, 0020, 030619
1.89, 141, 0030, 030619
"""
        result = wio.read_wind(io.StringIO(sample), sep=',', date_col=3,
            time_col=2, header=None)
        index = pd.date_range('2003-06-19', periods=4, freq='10T')
        data = [[1.84, 148], [1.63, 143], [1.51, 142], [1.89, 141]]
        expected = pd.DataFrame(data, index=index)
        pdt.assert_frame_equal(result, expected)
................................................................................


class Test_read_eolo(unittest.TestCase):
    """Test function read_eolo."""
    def test_read_eolo(self):
        """Test function read_eolo."""
        sample = io.StringIO(
"""110201 0000  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
110201 0010  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
110201 0020  2.21  2.60 316.0  -1.54   1.59   5.00 9999.99 9999.99  0.19
110201 0030  2.50  2.88 305.0  -2.05   1.43   5.00 9999.99 9999.99  0.10
110201 0040  2.31  2.60 300.0  -2.00   1.15   5.00 9999.99 9999.99  0.10
""")
        result = wio.read_eolo(sample, prefix='X', index_name=True)

        expected = ['kind', 'name', 'height', 'signal']
        self.assertEqual(result.columns.names, expected)

        expected = ['WS', 'WS', 'WD', 'x_speed', 'y_speed', 'WD', 'WS']
................................................................................
        expected = [0.19, 0.29, 0.19, 0.10, 0.10]
        self.assertEqual(result['WS', '', -1, 'std'].tolist(), expected)


    def test_read_eolo_dup(self):
        """Test function read_eolo with duplicated dates."""
        sample = io.StringIO(
"""110201 0000  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
110201 0000  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
""")

        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter('always')
            result = wio.read_eolo(sample, prefix='X', index_name=True)
        msg = ''.join([
            'The data set can\'t be assigned a frequency due to the ',
................................................................................

        expected = [0.19, 0.29]
        self.assertEqual(result['WS', '', -1, 'std'].tolist(), expected)

    def test_read_eolo_sort(self):
        """Test function read_eolo with sort=True."""
        sample = io.StringIO(
"""110201 0010  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
110201 0000  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
""")
        result = wio.read_eolo(sample, sort=True, prefix='X', index_name=True)
        expected = pd.date_range('2011-02-01', periods=2, freq='10T',
            name='date_time')
        self.assertListEqual(result.index.tolist(), expected.tolist())
        self.assertEqual(result.index.name, expected.name)
        self.assertEqual(result.index.freq, '10T')

    def test_read_eolo_nosort(self):
        """Test function read_eolo with sort=False."""
        sample = io.StringIO(
"""110201 0010  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
110201 0000  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
""")
        result = wio.read_eolo(sample, sort=False, index_name=True)
        expected = pd.DatetimeIndex(
            ['2011-02-01 00:00', '2011-02-01 00:10'], name='date_time'
        )
        self.assertListEqual(result.index.tolist(), expected.tolist())
        self.assertEqual(result.index.name, expected.name)





|







 







|
|
|
|
|












|
|
|
|


|










|
|
|
|
|













|
|
|
|
|











|
|
|
|
|







 







|
|
|
|
|







 







|
|
|
|
|







 







|
|
|
|
|







 







|
|
|
|
|













|
|
|
|







 







|
|
|
|
|







 







|
|







 







|
|











|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
...
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
...
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
...
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
...
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
...
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
...
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test_io.py
#
# Copyright 2012-2016 Goyo <goyodiaz@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
................................................................................
        self.assertTrue(
            (df.iloc[:, 0] == [1, 2, 3, 4]).all()
        )


class Test_read_wind(unittest.TestCase):
    def test_read_wind(self):
        sample = b"""20110201 0000  2.98 301.0
20110201 0010  2.69  302.0
20110201 0020  2.21  316.0
20110201 0030  2.50  305.0
20110201 0040  2.31  300.0
"""
        result = wio.read_wind(io.BytesIO(sample), header=None,
            prefix='X', freq='10T')
        self.assertEqual(result.index.freq, '10T')
        expected = pd.DataFrame.from_items([
                ('X2', [2.98, 2.69, 2.21, 2.50, 2.31]),
                ('X3', [301., 302., 316., 305., 300.])
            ])
        expected.index = pd.date_range('2011-02-01', periods=5, freq='10T')
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_skip_blanks(self):
        sample = b"""20110201 0000\t2.98
20110201 0010\t2.69
20110201 0020\t2.21
20110201 0030\t2.50


20110201 0040\t2.31
"""
        expected = pd.DataFrame(
            [2.98, 2.69, 2.21, 2.50, 2.31], columns = [1],
            index = pd.date_range('2011-02-01', periods=5, freq='10T'),
        )
        result = wio.read_wind(io.BytesIO(sample), time_col=None, sep='\t',
            freq='10T', header=None, skip_blanks=True)
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_no_timecol(self):
        sample = b"""20110201 0000\t2.98
20110201 0010\t2.69
20110201 0020\t2.21
20110201 0030\t2.50
20110201 0040\t2.31
"""
        expected = pd.DataFrame(
            [2.98, 2.69, 2.21, 2.50, 2.31], columns = [1],
            index = pd.date_range('2011-02-01', periods=5, freq='10T'),
        )
        result = wio.read_wind(io.BytesIO(sample), time_col=False, sep='\t',
            freq='10T', header=None)
        pdt.assert_frame_equal(result, expected)
        result = wio.read_wind(io.BytesIO(sample), time_col=None, sep='\t',
            freq='10T', header=None)
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_sort(self):
        sample = b"""20110201 0010  2.98 301.0
20110201 0000  2.69  302.0
20110201 0020  2.21  316.0
20110201 0030  2.50  305.0
20110201 0040  2.31  300.0
"""
        result = wio.read_wind(io.BytesIO(sample), header=None, sort=True)
        self.assertTrue(result.index.freq is None)
        expected = pd.DataFrame.from_items([
                (2, [2.69, 2.98, 2.21, 2.50, 2.31]),
                (3, [302., 301., 316., 305., 300.])
            ])
        expected.index = pd.date_range('2011-02-01', periods=5, freq='10T')
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_nosort(self):
        sample = b"""20110201 0010  2.98 301
20110201 0000  2.69  302
20110201 0020  2.21  316
20110201 0030  2.50  305
20110201 0040  2.31  300
"""
        result = wio.read_wind(io.BytesIO(sample), header=None, sort=False)
        self.assertTrue(result.index.freq is None)

        expected = pd.DataFrame.from_items([
                (2, [2.98, 2.69, 2.21, 2.50, 2.31]),
                (3, [301, 302, 316, 305, 300])
................................................................................
            prefix='X')
        expected = [2, 1]
        self.assertListEqual(result['X2'].tolist(), expected)

    def test_read_wind_dups(self):
        """Test function read_wind with duplicates."""
        sample = (
"""20110201 0000  2.98 301.0
20110201 0010  2.21  302.0
20110201 0010  2.22  302.0
20110201 0030  2.50  305.0
20110201 0040  2.31  300.0
""")
        result = wio.read_wind(io.StringIO(sample), header=None,
            discard_dups=True, prefix='X', index_name=True)

        data = np.array([[2.98, 2.21, 2.50, 2.31], [301, 302, 305, 300]]).T
        index = pd.DatetimeIndex([
            '2011-02-01 00:00', '2011-02-01 00:10',
................................................................................
        data = np.array([[2.98, 2.22, 2.50, 2.31], [301, 302, 305, 300]]).T
        expected = pd.DataFrame(data, index=index, columns=columns)
        pdt.assert_frame_equal(result, expected)

    def test_read_wind_indexname(self):
        """Test function read_wind with explicit index_name."""
        sample = io.StringIO(
"""20110201 0000  2.98 301.0
20110201 0010  2.69  302.0
20110201 0020  2.21  316.0
20110201 0030  2.50  305.0
20110201 0040  2.31  300.0
""")
        result = wio.read_wind(sample, header=None,
            prefix='X', index_name='mxyzptlk', freq='10T')
        self.assertEqual(result.index.freq, '10T')

        expected = ['X2', 'X3']
        self.assertListEqual(result.columns.tolist(), expected)
................................................................................

        expected = [301, 302, 316, 305, 300]
        self.assertListEqual(result['X3'].tolist(), expected)

    def test_read_wind_drop_empty(self):
        """Test function read_wind with drop_entry=True."""
        sample = io.StringIO(
"""20110201,0000,2.98,,301.0
20110201,0010,2.69,,302.0
20110201,0020,2.21,,316.0
20110201,0030,2.50,,305.0
20110201,0040,2.31,,300.0
""")
        result = wio.read_wind(sample, sep=',', header=None,
            prefix='X', index_name='mxyzptlk', freq='10T',
            drop_empty=True)
        self.assertEqual(result.index.freq, '10T')

        expected = ['X2', 'X4']
................................................................................
        self.assertListEqual(result['X2'].tolist(), expected)

        expected = [301, 302, 316, 305, 300]
        self.assertListEqual(result['X4'].tolist(), expected)

    #ticket 4968b8addb
    def test_read_wind_timecol_0(self):
        sample = b"""0000 20110201  2.98 301.0
0010 20110201  2.69  302.0
0020 20110201  2.21  316.0
0030 20110201  2.50  305.0
0040 20110201  2.31  300.0
"""
        result = wio.read_wind(io.BytesIO(sample), date_col=1, time_col=0,
            header=None, prefix='X', freq='10T')
        self.assertEqual(result.index.freq, '10T')
        expected = pd.DataFrame.from_items([
            ('X2', [2.98, 2.69, 2.21, 2.50, 2.31]),
            ('X3', [301., 302., 316., 305., 300.])
        ])
        expected.index = pd.date_range('2011-02-01', periods=5, freq='10T')
        pdt.assert_frame_equal(result, expected)

    # ticket 233a0a5c9f
    def test_read_wind_time_before_date(self):
        sample = """1.84, 148, 0000, 20030619
1.63, 143, 0010, 20030619
1.51, 142, 0020, 20030619
1.89, 141, 0030, 20030619
"""
        result = wio.read_wind(io.StringIO(sample), sep=',', date_col=3,
            time_col=2, header=None)
        index = pd.date_range('2003-06-19', periods=4, freq='10T')
        data = [[1.84, 148], [1.63, 143], [1.51, 142], [1.89, 141]]
        expected = pd.DataFrame(data, index=index)
        pdt.assert_frame_equal(result, expected)
................................................................................


class Test_read_eolo(unittest.TestCase):
    """Test function read_eolo."""
    def test_read_eolo(self):
        """Test function read_eolo."""
        sample = io.StringIO(
"""20110201 0000  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
20110201 0010  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
20110201 0020  2.21  2.60 316.0  -1.54   1.59   5.00 9999.99 9999.99  0.19
20110201 0030  2.50  2.88 305.0  -2.05   1.43   5.00 9999.99 9999.99  0.10
20110201 0040  2.31  2.60 300.0  -2.00   1.15   5.00 9999.99 9999.99  0.10
""")
        result = wio.read_eolo(sample, prefix='X', index_name=True)

        expected = ['kind', 'name', 'height', 'signal']
        self.assertEqual(result.columns.names, expected)

        expected = ['WS', 'WS', 'WD', 'x_speed', 'y_speed', 'WD', 'WS']
................................................................................
        expected = [0.19, 0.29, 0.19, 0.10, 0.10]
        self.assertEqual(result['WS', '', -1, 'std'].tolist(), expected)


    def test_read_eolo_dup(self):
        """Test function read_eolo with duplicated dates."""
        sample = io.StringIO(
"""20110201 0000  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
20110201 0000  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
""")

        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter('always')
            result = wio.read_eolo(sample, prefix='X', index_name=True)
        msg = ''.join([
            'The data set can\'t be assigned a frequency due to the ',
................................................................................

        expected = [0.19, 0.29]
        self.assertEqual(result['WS', '', -1, 'std'].tolist(), expected)

    def test_read_eolo_sort(self):
        """Test function read_eolo with sort=True."""
        sample = io.StringIO(
"""20110201 0010  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
20110201 0000  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
""")
        result = wio.read_eolo(sample, sort=True, prefix='X', index_name=True)
        expected = pd.date_range('2011-02-01', periods=2, freq='10T',
            name='date_time')
        self.assertListEqual(result.index.tolist(), expected.tolist())
        self.assertEqual(result.index.name, expected.name)
        self.assertEqual(result.index.freq, '10T')

    def test_read_eolo_nosort(self):
        """Test function read_eolo with sort=False."""
        sample = io.StringIO(
"""20110201 0010  2.98  3.27 301.0  -2.55   1.53   3.00 9999.99 9999.99  0.19
20110201 0000  2.69  3.17 302.0  -2.28   1.43   5.00 9999.99 9999.99  0.29
""")
        result = wio.read_eolo(sample, sort=False, index_name=True)
        expected = pd.DatetimeIndex(
            ['2011-02-01 00:00', '2011-02-01 00:10'], name='date_time'
        )
        self.assertListEqual(result.index.tolist(), expected.tolist())
        self.assertEqual(result.index.name, expected.name)