grapa.datatypes.curveMath.CurveMath

class grapa.datatypes.curveMath.CurveMath(data, attributes, silent=False)

Bases: Curve

Class handling mathematical operations, to make them available to the GUI. The operations are readily accessible from command line, for example curve1 + curve2 - 20

__init__(data, attributes, silent=False)

Methods

__init__(data, attributes[, silent])

add(cst, curves[, graph, operator])

Add a constant or a (list of) curves to this curve.

assemble_curve_xy(idx_x, xory_x, idx_y, ...)

Assemble new Curve from data series of same length available in a Graph object.

classNameGUI()

Provide base data, for the GUI to show what subclass of curve this is.

funcListGUI(**kwargs)

Fills in the Curve actions specific to the Curve type. Retuns a list, which elements are instances of FuncGUI, or (old style): ::.

inv()

Return the inverse of this curve, i.e. 1 / Curve.

neg()

Return the negative of this curve, i.e. 0 - Curve.

print_help()

Prints help for the Curve subclass, generated from docstrings.

swap_xy()

Return a copy of this curve with x and y data swapped.

Attributes

CURVE

add(cst, curves, graph: Graph = None, operator='add')

Add a constant or a (list of) curves to this curve.

assemble_curve_xy(idx_x: int, xory_x: str, idx_y: int, xory_y: str, graph: Graph)

Assemble new Curve from data series of same length available in a Graph object.

Parameters:
  • idx_x – index of Curve in Graph, from which to pick the x data series

  • xory_x – is the x or y data series picked

  • idx_y – index of Curve in Graph, from which to pick the y data series

  • xory_y – is the x or y data series picked

  • graph – Graph object to work on

Returns:

a Curve with x and y data according to wishes

classmethod classNameGUI()

Provide base data, for the GUI to show what subclass of curve this is. Can be overridden, see CurveArrhenius.

funcListGUI(**kwargs)

Fills in the Curve actions specific to the Curve type. Retuns a list, which elements are instances of FuncGUI, or (old style):

[func,
 'Button text',
 ['label 1', 'label 2', ...],
 ['value 1', 'value 2', ...],
 {'hiddenvar1': 'value1', ...}, (optional)
 [dictFieldAttributes, {}, ...]] (optional)

By default, returns quick modifs for offset and muloffset (if already set), and a help for some plot types (errorbar, scatter).

Parameters:

kwargs – this function should be called specifying kwargs[‘graph’] the graph self is embedded in, and kwargs[‘graph_i’] as position of self in graph.

inv()

Return the inverse of this curve, i.e. 1 / Curve.

neg()

Return the negative of this curve, i.e. 0 - Curve.

print_help()

Prints help for the Curve subclass, generated from docstrings.

swap_xy()

Return a copy of this curve with x and y data swapped.