to get started run sphinx_quickstart from and xterm
http://matplotlib.sourceforge.net/sampledoc/
””” Uses three different methods to interpolate the function :math:`f(x)=\sqrt{1 + |x|}`
Parameters
pn : integer number of points in f(x)
Returns
(x,y) : (array,array) tupple (x(pn) , y(pn)) with analytic values y=f(x) in the range :math:`-5 < x < 5`
plot is produced as a side effect, with three lines of x=101 points showing the analytic function, linear interpolation and cubic spline interpolation “””
.. highlight:: python
.. code-block:: python
””” integrate and interpolate the hydrostatic equation for a particular atmospheric sounding “””
from scipy.integrate.quadrature import cumtrapz import numpy as np import scipy.interpolate as interp from matplotlib.cbook import iterable
class hydrostat(object): “”” temp (K), press (Pa) “”” def __init__(self,temp,press,qv,height=None): self.temp=temp self.press=press self.height=height self.qv=qv self.Rd=287. self.g=9.8
refs.txt contains
.. _Software carpentry git tutorial: http://www.software-carpentry.org/v5/novice/git/
file starts with:
.. include:: refs.txt
refereced with
`Software carpentry git tutorial`_
http://docutils.sourceforge.net/docs/user/rst/quickref.html#external-hyperlink-targets
.. _Volume expansion table: http://physics.info/expansion/
`Volume expansion table`_
`volume expansion table`_
have had some problems with undersocres in tags
.. _schroeder: Schroeder _________
in one file
referenced by
- zerox copy of :ref:`schroeder`
which makes the link:
http://clouds.eos.ubc.ca/~phil/thesis/index.html#schroeder
this works:
.. _level-one:
Level one =========
.. _level-two:
Level two +++++++++
.. _level-three:
Level three
.. _level-four:
Level four __________
see also https://github.com/lddubeau/rst-on-github/blob/master/README.rst for github issues
in link_names.txt
.. _Bohren Monte Carlo: http://clouds.eos.ubc.ca/~phil/courses/eosc582/private/bohren_excerpts1.pdf
referenced with
`Bohren Monte Carlo`_
.. |CO2| replace:: CO\ :sub:`2`\
.. |wm2| replace:: Watts/meter\ :sup:`2`\
| CO2 | absorption |
.. toctree::
Course objectives <learning_goals>
Text chapters <text>
Matlab resources http://clouds.eos.ubc.ca/~phil/numeric/docs/_build/html/matlab.html
Thermo code <thermo>
Blank Tephigram http://clouds.eos.ubc.ca/~phil/courses/atsc405/wh_skewT.pdf
hidden entries
.. toctree::
<problems>
put code after this::
or
- don’t copy the hdf file, it’s 142 Mbytes. Just do a symbolic link
on swift to get it in your working directory like this:
.. literalinclude:: try_include.txt
- What is a weighting function? Why is it maximum when :math:`τ=1`
.. math::
α= β^2 ∫_0^∞ dt
watch indent level
<file:///~/public_html/readmes/Readme_python.nm#* constructing tables from dicts>
.. image:: 1-ie-2.jpg
.. notebook:: TransferFunctionHelper_Tutorial.ipynb
http://daler.github.io/sphinxdoc-test/includeme.html#general-workflow
https://gist.github.com/brantfaircloth/791759
http://dont-be-afraid-to-commit.readthedocs.org/en/latest/documentation.html
http://daler.github.io/sphinxdoc-test/includeme.html#index-rst-changes
Make a new file, sphinxdoc-test/docs/source/includeme.rst. In there, put an include directive pointing to the true“README.rst“. So includeme.rst should look like this:
.. include:: ../../README.rst
Then in index.rst, add includeme to the toctree. So the relevant part of index.rst should look something like:
.. toctree::
includeme
now is the time
rst2pdf –print-stylesheet
test=”Crompton Jeffrey\nDONG WENJING\nHurley David\nIzett Robert\nJarnikova Tereza\nLiu Jie\nMachuca Idalia\nPeterson Georgia\nThibault Jacquie-Lee\nVanderWees Jesse\nYu Xiaoxin\n \nEverard Kelsey\nJansens Bryan\n \nAtkinson Tim\nChui Timothy\nFung Matthew\nYuen Sang\nHirschi Jonathon\nMonillas Ronald James\nThompson Hadleigh”
with open(‘out.rst’,’w’) as f: for item in test.split(‘\n’): try: last,first=item.split() f.write(‘.. raw:: pdf\n’) f.write(‘\n PageBreak\n\n’) name=’{} {}’.format(first,last) f.write(‘{}\n’.format(name)) plusses=’+’*len(name) f.write(‘{}\n\n’.format(plusses)) except: pass
pip install sphinx-bootstrap-theme pip install -e sphinxcontrib-fulltoc pip install -e phil-bootstraph-theme
#http://stackoverflow.com/questions/139180/listing-all-functions-in-a-python-module
~/repos/pythonlibs/pyutils/list_functions.py
import importlib,sys from inspect import getmembers, isfunction, getmodule name=sys.argv[1] importlib.import_module(name, package=None) module=sys.modules[name] the_funcs = getmembers(module, isfunction) for item in the_funcs: try_module=getmodule(item[1]) if try_module == module: print(item[0])