Welcome to examplecurves’s documentation!¶
examplecurves is a module outsourced from arithmeticmeancurves. Its main purpose is to provide exemplary, reproducible families of curves for testing and debugging purposes.
Installation¶
$ pip install examplecurves
Basic Usage¶
Using examplecurves.create()
is the default way to get example curves.
The necessary argument is the family_name of the family of curves, which are listed
in the api-reference of this documentation.
import examplecurves
requested_curves = examplecurves.Static.create("nonlinear0")
examplecurves.plot_curves(requested_curves)
(Source code, png, hires.png, pdf)
It is possible to make a selection of the returned curves by the curves indexes. By curve_selection a list of indexes defines the curves to be returned only.
import examplecurves
requested_curves = examplecurves.Static.create("nonlinear0", curve_selection=[0,2,4])
examplecurves.plot_curves(requested_curves)
(Source code, png, hires.png, pdf)
Cutting of curves is also possible by either defining the index (integer position within a sequence) or list of maximum 3 entries defining a slice. [None, -3] would lead to slicing the curves like curve[:-3]. The default behavior of providing an integer only is equivalent to `curve[:i].
import examplecurves
requested_curves = examplecurves.Static.create(
family_name="nonlinear0",
cut_curves_at=3,
curve_selection=[0,2,4]
)
examplecurves.plot_curves(requested_curves)
(Source code, png, hires.png, pdf)
The requested curves can be offset by an iterable of custom offsets.
import examplecurves
requested_curves = examplecurves.Static.create(
family_name="nonlinear0",
cut_curves_at=3,
offsets=[(1, 2), (3, 4), (5, 6)],
curve_selection=[0,2,4]
)
examplecurves.plot_curves(requested_curves)
(Source code, png, hires.png, pdf)
The examplecurves might come with predefined offsets, which can be invoked by predefined_offset defining the index of the offset. predefined_offset overrules offsets.
import examplecurves
requested_curves = examplecurves.Static.create(
family_name="nonlinear0",
cut_curves_at=3,
offsets=[(1, 2), (3, 4), (5, 6)],
predefined_offset=1,
curve_selection=[0,2,4]
)
examplecurves.plot_curves(requested_curves)
(Source code, png, hires.png, pdf)