2
2
#
3
3
# pandas documentation build configuration file, created by
4
4
#
5
- # This file is execfile()d with the current directory set to its containing dir.
5
+ # This file is execfile()d with the current directory set to its containing
6
+ # dir.
6
7
#
7
8
# Note that not all possible configuration values are present in this
8
9
# autogenerated file.
49
50
50
51
# -- General configuration -----------------------------------------------
51
52
52
- # Add any Sphinx extension module names here, as strings. They can be extensions
53
- # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. sphinxext.
53
+ # Add any Sphinx extension module names here, as strings. They can be
54
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
55
+ # sphinxext.
54
56
55
57
extensions = ['sphinx.ext.autodoc' ,
56
58
'sphinx.ext.autosummary' ,
60
62
'numpydoc' ,
61
63
'ipython_sphinxext.ipython_directive' ,
62
64
'ipython_sphinxext.ipython_console_highlighting' ,
63
- 'IPython.sphinxext.ipython_console_highlighting' , # lowercase didn't work
65
+ # lowercase didn't work
66
+ 'IPython.sphinxext.ipython_console_highlighting' ,
64
67
'sphinx.ext.intersphinx' ,
65
68
'sphinx.ext.coverage' ,
66
69
'sphinx.ext.mathjax' ,
95
98
files_to_delete .append (f )
96
99
97
100
if files_to_delete :
98
- print ("I'm about to DELETE the following:\n %s\n " % list (sorted (files_to_delete )))
99
- sys .stdout .write ("WARNING: I'd like to delete those to speed up processing (yes/no)? " )
101
+ print ("I'm about to DELETE the following:\n {}\n " .format (
102
+ list (sorted (files_to_delete ))))
103
+ sys .stdout .write ("WARNING: I'd like to delete those "
104
+ "to speed up processing (yes/no)? " )
100
105
if PY3 :
101
106
answer = input ()
102
107
else :
103
108
answer = raw_input ()
104
109
105
- if answer .lower ().strip () in ('y' ,'yes' ):
110
+ if answer .lower ().strip () in ('y' , 'yes' ):
106
111
for f in files_to_delete :
107
- f = os .path .join (os .path .join (os .path .dirname (__file__ ),f ))
108
- f = os .path .abspath (f )
112
+ f = os .path .join (os .path .join (os .path .dirname (__file__ ), f ))
113
+ f = os .path .abspath (f )
109
114
try :
110
- print ("Deleting %s" % f )
115
+ print ("Deleting {}" . format ( f ) )
111
116
os .unlink (f )
112
117
except :
113
- print ("Error deleting %s" % f )
118
+ print ("Error deleting {}" . format ( f ) )
114
119
pass
115
120
116
121
# Add any paths that contain templates here, relative to this directory.
137
142
import pandas
138
143
139
144
# version = '%s r%s' % (pandas.__version__, svn_version())
140
- version = '%s' % (pandas .__version__ )
145
+ version = str (pandas .__version__ )
141
146
142
147
# The full version, including alpha/beta/rc tags.
143
148
release = version
159
164
# for source files.
160
165
exclude_trees = []
161
166
162
- # The reST default role (used for this markup: `text`) to use for all documents.
163
- # default_role = None
167
+ # The reST default role (used for this markup: `text`) to use for all
168
+ # documents. default_role = None
164
169
165
170
# If true, '()' will be appended to :func: etc. cross-reference text.
166
171
# add_function_parentheses = True
334
339
# The font size ('10pt', '11pt' or '12pt').
335
340
# latex_font_size = '10pt'
336
341
337
- # Grouping the document tree into LaTeX files. List of tuples
338
- # (source start file, target name, title, author, documentclass [howto/manual]).
342
+ # Grouping the document tree into LaTeX files. List of tuples (source start
343
+ # file, target name, title, author, documentclass [howto/manual]).
339
344
latex_documents = [
340
345
('index' , 'pandas.tex' ,
341
346
u ('pandas: powerful Python data analysis toolkit' ),
392
397
# wherever the docs are built. The docs' target is the browser, not
393
398
# the console, so this is fine.
394
399
'pd.options.display.encoding="utf8"'
395
- ]
400
+ ]
396
401
397
402
398
403
# Add custom Documenter to handle attributes/methods of an AccessorProperty
399
404
# eg pandas.Series.str and pandas.Series.dt (see GH9322)
400
405
401
406
import sphinx
402
407
from sphinx .util import rpartition
403
- from sphinx .ext .autodoc import Documenter , MethodDocumenter , AttributeDocumenter
408
+ from sphinx .ext .autodoc import (
409
+ Documenter , MethodDocumenter , AttributeDocumenter )
404
410
from sphinx .ext .autosummary import Autosummary
405
411
406
412
407
413
class AccessorDocumenter (MethodDocumenter ):
408
414
"""
409
415
Specialized Documenter subclass for accessors.
410
416
"""
411
-
412
417
objtype = 'accessor'
413
418
directivetype = 'method'
414
419
@@ -426,7 +431,6 @@ class AccessorLevelDocumenter(Documenter):
426
431
Specialized Documenter subclass for objects on accessor level (methods,
427
432
attributes).
428
433
"""
429
-
430
434
# This is the simple straightforward version
431
435
# modname is None, base the last elements (eg 'hour')
432
436
# and path the part before (eg 'Series.dt')
@@ -436,7 +440,6 @@ class AccessorLevelDocumenter(Documenter):
436
440
# mod_cls = mod_cls.split('.')
437
441
#
438
442
# return modname, mod_cls + [base]
439
-
440
443
def resolve_name (self , modname , parents , path , base ):
441
444
if modname is None :
442
445
if path :
@@ -471,16 +474,17 @@ def resolve_name(self, modname, parents, path, base):
471
474
return modname , parents + [base ]
472
475
473
476
474
- class AccessorAttributeDocumenter (AccessorLevelDocumenter , AttributeDocumenter ):
475
-
477
+ class AccessorAttributeDocumenter (AccessorLevelDocumenter ,
478
+ AttributeDocumenter ):
476
479
objtype = 'accessorattribute'
477
480
directivetype = 'attribute'
478
481
479
- # lower than AttributeDocumenter so this is not chosen for normal attributes
482
+ # lower than AttributeDocumenter so this is not chosen for normal
483
+ # attributes
480
484
priority = 0.6
481
485
482
- class AccessorMethodDocumenter (AccessorLevelDocumenter , MethodDocumenter ):
483
486
487
+ class AccessorMethodDocumenter (AccessorLevelDocumenter , MethodDocumenter ):
484
488
objtype = 'accessormethod'
485
489
directivetype = 'method'
486
490
@@ -508,7 +512,6 @@ class PandasAutosummary(Autosummary):
508
512
This alternative autosummary class lets us override the table summary for
509
513
Series.plot and DataFrame.plot in the API docs.
510
514
"""
511
-
512
515
def _replace_pandas_items (self , display_name , sig , summary , real_name ):
513
516
# this a hack: ideally we should extract the signature from the
514
517
# .__call__ method instead of hard coding this
@@ -561,18 +564,18 @@ def linkcode_resolve(domain, info):
561
564
lineno = None
562
565
563
566
if lineno :
564
- linespec = "#L%d-L%d" % (lineno , lineno + len (source ) - 1 )
567
+ linespec = "#L{:d}-L{:d}" . format (lineno , lineno + len (source ) - 1 )
565
568
else :
566
569
linespec = ""
567
570
568
571
fn = os .path .relpath (fn , start = os .path .dirname (pandas .__file__ ))
569
572
570
573
if '+' in pandas .__version__ :
571
- return "http://github.com/pandas-dev/pandas/blob/master/pandas/%s%s" % (
572
- fn , linespec )
574
+ return ( "http://github.com/pandas-dev/pandas/blob/master/pandas/"
575
+ "{}{}" . format ( fn , linespec ) )
573
576
else :
574
- return "http://github.com/pandas-dev/pandas/blob/v%s/pandas/%s%s" % (
575
- pandas . __version__ , fn , linespec )
577
+ return ( "http://github.com/pandas-dev/pandas/blob/"
578
+ "v{}/ pandas/{}{}" . format ( pandas . __version__ , fn , linespec ) )
576
579
577
580
578
581
# remove the docstring of the flags attribute (inherited from numpy ndarray)
0 commit comments