Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit ea8183f

Browse files
committed
Merge pull request #218 from ndawe/docs
[MRG] use new RTD docs theme
2 parents b7ae0fd + 6d5a4bc commit ea8183f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2685
-1522
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ trailing-spaces:
108108
doc-clean:
109109
@make -C docs/ clean
110110

111-
doc: clean doc-clean inplace
111+
doc: doc-clean inplace
112112
@make -C docs/ html
113113

114114
check-rst:

docs/_static/css/root_numpy.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@import url("theme.css");
2+
3+
#root-numpy h1 {
4+
font-size: 250%;
5+
margin-bottom: 0;
6+
}
7+
8+
h2.main-subtitle {
9+
font-style: italic;
10+
color: #777;
11+
}
12+
13+
.wy-nav-content {
14+
max-width: none;
15+
}
16+
17+
div.highlight pre {
18+
font-family: monospace;
19+
font-size: 100%;
20+
}
21+
22+
#root-numpy-reference code.xref.py.py-obj.docutils.literal {
23+
color: #E74C3C;
24+
font-size: 100%;
25+
}

docs/_static/root_numpy.css

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/conf.py

Lines changed: 6 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3838
extensions = [
3939
'sphinx.ext.autodoc',
40-
'sphinx.ext.viewcode',
4140
'sphinx.ext.autosummary',
4241
'numpydoc',
4342
'gen_rst',
@@ -108,16 +107,14 @@
108107

109108
# The theme to use for HTML and HTML Help pages. See the documentation for
110109
# a list of builtin themes.
111-
#html_theme = 'default'
112-
html_theme = 'readthedocs'
110+
html_theme = 'sphinx_rtd_theme'
111+
html_style = 'css/root_numpy.css'
113112

114113
# Theme options are theme-specific and customize the look and feel of a theme
115114
# further. For a list of options available for each theme, see the
116115
# documentation.
117116
html_theme_options = {
118-
'custom_css': 'root_numpy.css',
119-
'show_sphinx': False,
120-
'analytics_code': 'UA-39364267-1',
117+
'analytics_id': 'UA-39364267-1',
121118
}
122119

123120
# Add any paths that contain custom themes here, relative to this directory.
@@ -169,10 +166,10 @@
169166
#html_split_index = False
170167

171168
# If true, links to the reST sources are added to the pages.
172-
#html_show_sourcelink = True
169+
html_show_sourcelink = False
173170

174171
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
175-
#html_show_sphinx = True
172+
html_show_sphinx = False
176173

177174
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
178175
#html_show_copyright = True
@@ -188,80 +185,5 @@
188185
# Output file base name for HTML help builder.
189186
htmlhelp_basename = 'root_numpydoc'
190187

191-
192-
# -- Options for LaTeX output --------------------------------------------------
193-
194-
latex_elements = {
195-
# The paper size ('letterpaper' or 'a4paper').
196-
#'papersize': 'letterpaper',
197-
198-
# The font size ('10pt', '11pt' or '12pt').
199-
#'pointsize': '10pt',
200-
201-
# Additional stuff for the LaTeX preamble.
202-
#'preamble': '',
203-
}
204-
205-
# Grouping the document tree into LaTeX files. List of tuples
206-
# (source start file, target name, title, author, documentclass [howto/manual]).
207-
latex_documents = [
208-
('index', 'root_numpy.tex', u'root\\_numpy Documentation',
209-
u'Piti Ongmongkolkul', 'manual'),
210-
]
211-
212-
# The name of an image file (relative to this directory) to place at the top of
213-
# the title page.
214-
#latex_logo = None
215-
216-
# For "manual" documents, if this is true, then toplevel headings are parts,
217-
# not chapters.
218-
#latex_use_parts = False
219-
220-
# If true, show page references after internal links.
221-
#latex_show_pagerefs = False
222-
223-
# If true, show URL addresses after external links.
224-
#latex_show_urls = False
225-
226-
# Documents to append as an appendix to all manuals.
227-
#latex_appendices = []
228-
229-
# If false, no module index is generated.
230-
#latex_domain_indices = True
231-
232-
233-
# -- Options for manual page output --------------------------------------------
234-
235-
# One entry per manual page. List of tuples
236-
# (source start file, name, description, authors, manual section).
237-
man_pages = [
238-
('index', 'root_numpy', u'root_numpy Documentation',
239-
[u'Piti Ongmongkolkul'], 1)
240-
]
241-
242-
# If true, show URL addresses after external links.
243-
#man_show_urls = False
244-
245-
246-
# -- Options for Texinfo output ------------------------------------------------
247-
248-
# Grouping the document tree into Texinfo files. List of tuples
249-
# (source start file, target name, title, author,
250-
# dir menu entry, description, category)
251-
texinfo_documents = [
252-
('index', 'root_numpy', u'root_numpy Documentation',
253-
u'Piti Ongmongkolkul', 'root_numpy', 'ROOT to numpy fast converter',
254-
''),
255-
]
256-
257-
# Documents to append as an appendix to all manuals.
258-
#texinfo_appendices = []
259-
260-
# If false, no module index is generated.
261-
#texinfo_domain_indices = True
262-
263-
# How to display URL addresses: 'footnote', 'no', or 'inline'.
264-
#texinfo_show_urls = 'footnote'
265-
266-
add_module_names = False
188+
#add_module_names = False
267189
autosummary_generate = True

docs/examples.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Examples
2+
========
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
auto_examples/index
8+

docs/gh-pages-init

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/index.rst

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
.. raw:: html
22

33
<a href="https://github.com/rootpy/root_numpy">
4-
<img style="position: absolute; top: 40px; right: 0; border: 0;"
4+
<img style="position: absolute; top: 0; right: 0; border: 0;"
55
src="_static/fork_me.png">
66
</a>
7-
<h1 class="main">root_numpy</h1>
8-
<h2 class="main">An interface between ROOT and NumPy</h2>
7+
8+
==========
9+
root_numpy
10+
==========
11+
12+
.. raw:: html
13+
14+
<h2 class="main-subtitle">An interface between ROOT and NumPy</h2>
915

1016
.. include:: ../README.rst
1117
:start-line: 20
1218

13-
Documentation
14-
-------------
15-
1619
.. toctree::
1720
:maxdepth: 2
1821

1922
install
2023
start
2124
reference/index
22-
23-
Examples
24-
--------
25-
26-
.. toctree::
27-
:maxdepth: 2
28-
29-
auto_examples/index
30-
25+
examples

docs/reference/index.rst

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.. _reference:
22

3-
####################
43
root_numpy Reference
5-
####################
4+
====================
65

76
:Release: |version|
87
:Date: |today|
@@ -13,7 +12,7 @@ what they are and what they do.
1312
root_numpy
1413
----------
1514

16-
.. module:: root_numpy
15+
.. currentmodule:: root_numpy
1716

1817
.. autosummary::
1918
:toctree: generated
@@ -45,7 +44,7 @@ root_numpy
4544
root_numpy.tmva
4645
---------------
4746

48-
.. module:: root_numpy.tmva
47+
.. currentmodule:: root_numpy.tmva
4948

5049
.. autosummary::
5150
:toctree: generated
@@ -54,35 +53,3 @@ root_numpy.tmva
5453
add_regression_events
5554
evaluate_reader
5655
evaluate_method
57-
58-
.. _conversion_table:
59-
60-
Type Conversion Table
61-
---------------------
62-
63-
Types are converted according to this table:
64-
65-
================== =========================
66-
ROOT NumPy
67-
================== =========================
68-
Bool_t np.bool
69-
Char_t np.int8
70-
UChar_t np.uint8
71-
Short_t np.int16
72-
UShort_t np.uint16
73-
Int_t np.int32
74-
UInt_t np.uint32
75-
Float_t np.float32
76-
Double_t np.float64
77-
Long64_t np.int64
78-
ULong64_t np.uint64
79-
x[10] (np.primitivetype, (10,))
80-
x[nx] np.object
81-
string np.object
82-
vector<t> np.object
83-
vector<vector<t> > np.object
84-
================== =========================
85-
86-
Variable length arrays (such as ``particletype[nparticle]``) and vectors
87-
(such as ``vector<int>``) are converted to NumPy arrays of the corresponding
88-
types. Fixed length arrays are converted to fixed length NumPy array fields.

docs/sphinxext/numpydoc/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
from numpydoc import setup
1+
from __future__ import division, absolute_import, print_function
2+
3+
from .numpydoc import setup

docs/sphinxext/numpydoc/comment_eater.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
from cStringIO import StringIO
1+
from __future__ import division, absolute_import, print_function
2+
3+
import sys
4+
if sys.version_info[0] >= 3:
5+
from io import StringIO
6+
else:
7+
from io import StringIO
8+
29
import compiler
310
import inspect
411
import textwrap
512
import tokenize
613

7-
from compiler_unparse import unparse
14+
from .compiler_unparse import unparse
815

916

1017
class Comment(object):
@@ -68,7 +75,11 @@ def __init__(self):
6875
def process_file(self, file):
6976
""" Process a file object.
7077
"""
71-
for token in tokenize.generate_tokens(file.next):
78+
if sys.version_info[0] >= 3:
79+
nxt = file.__next__
80+
else:
81+
nxt = file.next
82+
for token in tokenize.generate_tokens(nxt):
7283
self.process_token(*token)
7384
self.make_index()
7485

@@ -95,7 +106,7 @@ def new_noncomment(self, start_lineno, end_lineno):
95106

96107
def new_comment(self, string, start, end, line):
97108
""" Possibly add a new comment.
98-
109+
99110
Only adds a new comment if this comment is the only thing on the line.
100111
Otherwise, it extends the noncomment block.
101112
"""

0 commit comments

Comments
 (0)