Example code
Main-example
Sphinx allow easy reference to illustrate code in the documentation
e.g. a module can be reproduced
"""Example module containing functions to illustrate integration testing."""
from cmatools.analysis.simple_analysis import analysis_product, analysis_sum
def combined(x, y):
"""Sum of output from calling two functions."""
combined = analysis_product(x, y) + analysis_sum(x, y)
return combined
e.g.
def this_one() -> str:
"""Print this.
Returns
-------
str
String 'this'
"""
print("this")
return "this"
Sub-example
e.g.
def another_one():
"""Print that."""
print("that")