File tree 4 files changed +11
-10
lines changed
4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ pandas 0.11.0
47
47
preserve an all-nan object (e.g. strings)
48
48
- Series print output now includes the dtype by default
49
49
- Optimize internal reindexing routines for upcasting cases (#2819)
50
+ - ``describe_option() `` now reports the default and current value of options.
50
51
51
52
**API Changes **
52
53
Original file line number Diff line number Diff line change @@ -554,7 +554,11 @@ def _build_option_description(k):
554
554
555
555
o = _get_registered_option (k )
556
556
d = _get_deprecated_option (k )
557
+
557
558
s = u'%s: ' % k
559
+ if o :
560
+ s += u'[default: %s] [currently: %s]' % (o .defval , _get_option (k , True ))
561
+
558
562
if o .doc :
559
563
s += '\n ' + '\n ' .join (o .doc .strip ().split ('\n ' ))
560
564
else :
Original file line number Diff line number Diff line change 26
26
27
27
pc_colspace_doc = """
28
28
: int
29
- Default space for DataFrame columns, defaults to 12
29
+ Default space for DataFrame columns.
30
30
"""
31
31
32
32
pc_max_rows_doc = """
53
53
54
54
pc_nb_repr_h_doc = """
55
55
: boolean
56
- When True (default) , IPython notebook will use html representation for
56
+ When True, IPython notebook will use html representation for
57
57
pandas objects (if it is available).
58
58
"""
59
59
69
69
70
70
pc_pprint_nest_depth = """
71
71
: int
72
- Defaults to 3.
73
72
Controls the number of nested levels to process when pretty-printing
74
73
"""
75
74
76
75
pc_multi_sparse_doc = """
77
76
: boolean
78
- Default True, "sparsify" MultiIndex display (don't display repeated
77
+ "sparsify" MultiIndex display (don't display repeated
79
78
elements in outer levels within groups)
80
79
"""
81
80
109
108
110
109
pc_expand_repr_doc = """
111
110
: boolean
112
- Default False
113
111
Whether to print out the full DataFrame repr for wide DataFrames
114
112
across multiple lines.
115
113
If False, the summary representation is shown.
116
114
"""
117
115
118
116
pc_line_width_doc = """
119
117
: int
120
- Default 80
121
118
When printing wide DataFrames, this is the width of each line.
122
119
"""
123
120
pc_chop_threshold_doc = """
124
121
: float or None
125
- Default None
126
122
if set to a float value, all float values smaller then the given threshold
127
123
will be displayed as exactly 0 by repr and friends.
128
124
"""
156
152
157
153
tc_sim_interactive_doc = """
158
154
: boolean
159
- Default False
160
155
Whether to simulate interactive mode for purposes of testing
161
156
"""
162
157
with cf .config_prefix ('mode' ):
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ def test_describe_option(self):
73
73
self .cf .register_option ('c.d.e2' , 1 , 'doc4' )
74
74
self .cf .register_option ('f' , 1 )
75
75
self .cf .register_option ('g.h' , 1 )
76
- self .cf .deprecate_option ('g.h' , rkey = "blah" )
76
+ self .cf .register_option ('k' , 2 )
77
+ self .cf .deprecate_option ('g.h' , rkey = "k" )
77
78
78
79
# non-existent keys raise KeyError
79
80
self .assertRaises (KeyError , self .cf .describe_option , 'no.such.key' )
@@ -100,7 +101,7 @@ def test_describe_option(self):
100
101
self .assertTrue (
101
102
'precated' in self .cf .describe_option ('g.h' , _print_desc = False ))
102
103
self .assertTrue (
103
- 'blah ' in self .cf .describe_option ('g.h' , _print_desc = False ))
104
+ 'k ' in self .cf .describe_option ('g.h' , _print_desc = False ))
104
105
105
106
def test_case_insensitive (self ):
106
107
self .cf .register_option ('KanBAN' , 1 , 'doc' )
You can’t perform that action at this time.
0 commit comments