Skip to content
Snippets Groups Projects
Commit 939b57a1 authored by Joseph Weston's avatar Joseph Weston
Browse files

reformat Example section in docstrings to stop sphinx complaining

parent b619c465
Branches
No related tags found
No related merge requests found
......@@ -65,18 +65,17 @@ def lambdify(expr, locals=None):
locals : dict or ``None`` (default)
Additional definitions for `~kwant.continuum.sympify`.
Example:
Examples
--------
>>> f = lambdify('a + b', locals={'b': 'b + c'})
>>> f(1, 3, 5)
9
>>> ns = {'sigma_plus': [[0, 2], [0, 0]]}
>>> f = lambdify('k_x**2 * sigma_plus', ns)
>>> f(0.25)
array([[ 0. , 0.125],
[ 0. , 0. ]])
>>> f = lambdify('a + b', locals={'b': 'b + c'})
>>> f(1, 3, 5)
9
>>> ns = {'sigma_plus': [[0, 2], [0, 0]]}
>>> f = lambdify('k_x**2 * sigma_plus', ns)
>>> f(0.25)
array([[ 0. , 0.125],
[ 0. , 0. ]])
"""
with reraise_warnings(level=4):
expr = sympify(expr, locals)
......
......@@ -32,10 +32,11 @@ if uses_umfpack:
Return a fuction for solving a sparse linear system, with A
pre-factorized.
Example:
solve = factorized(A) # Makes LU decomposition.
x1 = solve(rhs1) # Uses the LU factors.
x2 = solve(rhs2) # Uses again the LU factors.
Examples
--------
>>> solve = factorized(A) # Makes LU decomposition.
>>> x1 = solve(rhs1) # Uses the LU factors.
>>> x2 = solve(rhs2) # Uses again the LU factors.
Parameters
----------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment