windng
Check-in [ee7d8236af]
Not logged in

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

Overview
Comment:More alignmen issues with pandas 0.18.0
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:ee7d8236afd67afd9de019ac955d02c7db27d3a9
User & Date: goyo 2016-03-14 22:43:50
Context
2016-03-14
22:43
More alignmen issues with pandas 0.18.0 Leaf check-in: ee7d8236af user: goyo tags: trunk
22:36
Adapt to changes in DataFrame.to_string() (pandas 0.18.0) check-in: b2ced12a2a user: goyo tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/test_extremes.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
...
107
108
109
110
111
112
113



114
115




116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test_extremes.py
#
# Copyright 2013-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,
................................................................................
        result = extremes.mis_sg(s, threshold=16, separation=4)
        result = result.to_string().split('\n')
        self.assertEqual(result[0], 'Options:')
        self.assertEqual(result[1], 'Storm threshold: 16')
        self.assertEqual(result[2], 'Separation: 4')
        self.assertEqual(result[3], '')
        self.assertEqual(result[4], 'Result:')



        self.assertEqual(result[5], '       Yi  Vi')
        self.assertEqual(result[6], '-0.326634  19')




        self.assertEqual(result[7], ' 0.366513  20')
        self.assertEqual(result[8], ' 1.245899  21')
        self.assertEqual(result[9], 'Number of storms: 3')
        self.assertTrue(result[10].startswith('Slope: 1.2659142446'))
        self.assertTrue(result[11].startswith('Offset: 19.4574384447'))
        self.assertTrue(result[12].startswith('R2: 0.995346331887'))
        self.assertTrue(result[13].startswith('Vref: 30.5416813948'))


if __name__ == '__main__':
    unittest.main()





|







 







>
>
>
|

>
>
>
>
|
|









1
2
3
4
5
6
7
8
9
10
11
12
13
...
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test_extremes.py
#
# Copyright 2013-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,
................................................................................
        result = extremes.mis_sg(s, threshold=16, separation=4)
        result = result.to_string().split('\n')
        self.assertEqual(result[0], 'Options:')
        self.assertEqual(result[1], 'Storm threshold: 16')
        self.assertEqual(result[2], 'Separation: 4')
        self.assertEqual(result[3], '')
        self.assertEqual(result[4], 'Result:')
        if pd.__version__ == '0.18.0':  # Incorrect alignment.
            self.assertEqual(result[5], 'Yi  Vi')
        else:
            self.assertEqual(result[5], '       Yi  Vi')
        self.assertEqual(result[6], '-0.326634  19')
        if pd.__version__ == '0.18.0':  # Incorrect alignment.
            self.assertEqual(result[7], '0.366513  20')
            self.assertEqual(result[8], '1.245899  21')
        else:
            self.assertEqual(result[7], ' 0.366513  20')
            self.assertEqual(result[8], ' 1.245899  21')
        self.assertEqual(result[9], 'Number of storms: 3')
        self.assertTrue(result[10].startswith('Slope: 1.2659142446'))
        self.assertTrue(result[11].startswith('Offset: 19.4574384447'))
        self.assertTrue(result[12].startswith('R2: 0.995346331887'))
        self.assertTrue(result[13].startswith('Vref: 30.5416813948'))


if __name__ == '__main__':
    unittest.main()