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

Commit

Permalink
Merge pull request #218 from ndawe/docs
Browse files Browse the repository at this point in the history
[MRG] use new RTD docs theme
  • Loading branch information
ndawe committed Sep 16, 2015
2 parents b7ae0fd + 6d5a4bc commit ea8183f
Show file tree
Hide file tree
Showing 58 changed files with 2,685 additions and 1,522 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ trailing-spaces:
doc-clean:
@make -C docs/ clean

doc: clean doc-clean inplace
doc: doc-clean inplace
@make -C docs/ html

check-rst:
Expand Down
25 changes: 25 additions & 0 deletions docs/_static/css/root_numpy.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@import url("theme.css");

#root-numpy h1 {
font-size: 250%;
margin-bottom: 0;
}

h2.main-subtitle {
font-style: italic;
color: #777;
}

.wy-nav-content {
max-width: none;
}

div.highlight pre {
font-family: monospace;
font-size: 100%;
}

#root-numpy-reference code.xref.py.py-obj.docutils.literal {
color: #E74C3C;
font-size: 100%;
}
14 changes: 0 additions & 14 deletions docs/_static/root_numpy.css

This file was deleted.

90 changes: 6 additions & 84 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'numpydoc',
'gen_rst',
Expand Down Expand Up @@ -108,16 +107,14 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'default'
html_theme = 'readthedocs'
html_theme = 'sphinx_rtd_theme'
html_style = 'css/root_numpy.css'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'custom_css': 'root_numpy.css',
'show_sphinx': False,
'analytics_code': 'UA-39364267-1',
'analytics_id': 'UA-39364267-1',
}

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

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
html_show_sourcelink = False

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
html_show_sphinx = False

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


# -- Options for LaTeX output --------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'root_numpy.tex', u'root\\_numpy Documentation',
u'Piti Ongmongkolkul', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True


# -- Options for manual page output --------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'root_numpy', u'root_numpy Documentation',
[u'Piti Ongmongkolkul'], 1)
]

# If true, show URL addresses after external links.
#man_show_urls = False


# -- Options for Texinfo output ------------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'root_numpy', u'root_numpy Documentation',
u'Piti Ongmongkolkul', 'root_numpy', 'ROOT to numpy fast converter',
''),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

add_module_names = False
#add_module_names = False
autosummary_generate = True
8 changes: 8 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Examples
========

.. toctree::
:maxdepth: 2

auto_examples/index

3 changes: 0 additions & 3 deletions docs/gh-pages-init

This file was deleted.

25 changes: 10 additions & 15 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
.. raw:: html

<a href="https://github.com/rootpy/root_numpy">
<img style="position: absolute; top: 40px; right: 0; border: 0;"
<img style="position: absolute; top: 0; right: 0; border: 0;"
src="_static/fork_me.png">
</a>
<h1 class="main">root_numpy</h1>
<h2 class="main">An interface between ROOT and NumPy</h2>

==========
root_numpy
==========

.. raw:: html

<h2 class="main-subtitle">An interface between ROOT and NumPy</h2>

.. include:: ../README.rst
:start-line: 20

Documentation
-------------

.. toctree::
:maxdepth: 2

install
start
reference/index

Examples
--------

.. toctree::
:maxdepth: 2

auto_examples/index

examples
39 changes: 3 additions & 36 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
.. _reference:

####################
root_numpy Reference
####################
====================

:Release: |version|
:Date: |today|
Expand All @@ -13,7 +12,7 @@ what they are and what they do.
root_numpy
----------

.. module:: root_numpy
.. currentmodule:: root_numpy

.. autosummary::
:toctree: generated
Expand Down Expand Up @@ -45,7 +44,7 @@ root_numpy
root_numpy.tmva
---------------

.. module:: root_numpy.tmva
.. currentmodule:: root_numpy.tmva

.. autosummary::
:toctree: generated
Expand All @@ -54,35 +53,3 @@ root_numpy.tmva
add_regression_events
evaluate_reader
evaluate_method

.. _conversion_table:

Type Conversion Table
---------------------

Types are converted according to this table:

================== =========================
ROOT NumPy
================== =========================
Bool_t np.bool
Char_t np.int8
UChar_t np.uint8
Short_t np.int16
UShort_t np.uint16
Int_t np.int32
UInt_t np.uint32
Float_t np.float32
Double_t np.float64
Long64_t np.int64
ULong64_t np.uint64
x[10] (np.primitivetype, (10,))
x[nx] np.object
string np.object
vector<t> np.object
vector<vector<t> > np.object
================== =========================

Variable length arrays (such as ``particletype[nparticle]``) and vectors
(such as ``vector<int>``) are converted to NumPy arrays of the corresponding
types. Fixed length arrays are converted to fixed length NumPy array fields.
4 changes: 3 additions & 1 deletion docs/sphinxext/numpydoc/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from numpydoc import setup
from __future__ import division, absolute_import, print_function

from .numpydoc import setup
19 changes: 15 additions & 4 deletions docs/sphinxext/numpydoc/comment_eater.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
from cStringIO import StringIO
from __future__ import division, absolute_import, print_function

import sys
if sys.version_info[0] >= 3:
from io import StringIO
else:
from io import StringIO

import compiler
import inspect
import textwrap
import tokenize

from compiler_unparse import unparse
from .compiler_unparse import unparse


class Comment(object):
Expand Down Expand Up @@ -68,7 +75,11 @@ def __init__(self):
def process_file(self, file):
""" Process a file object.
"""
for token in tokenize.generate_tokens(file.next):
if sys.version_info[0] >= 3:
nxt = file.__next__
else:
nxt = file.next
for token in tokenize.generate_tokens(nxt):
self.process_token(*token)
self.make_index()

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

def new_comment(self, string, start, end, line):
""" Possibly add a new comment.
Only adds a new comment if this comment is the only thing on the line.
Otherwise, it extends the noncomment block.
"""
Expand Down
Loading

0 comments on commit ea8183f

Please sign in to comment.