Function Plugin API
Function plugins live in the top-level functions folder. PhysPlot loads
these files from disk, so their filenames may start with numbers for menu
ordering, but their public API should stay simple and predictable.
Required Module Variables
DISPLAY_NAME: strThe name shown in the mathematical transformation dropdown.
Required Function
- transform(values) numpy.ndarray
Transform one numeric column and return the transformed values.
- Parameters:
values (array-like) – One-dimensional numeric input values, usually a
numpy.ndarraycopied from the selected table column.- Returns:
One-dimensional numeric output values with the same row order as the input.
- Return type:
numpy.ndarray
Plugin Files Included with PhysPlot
File |
Display name |
Core behavior |
|---|---|---|
|
|
Returns the input values unchanged. |
|
|
Squares each value. |
|
|
Cubes each value. |
|
|
Returns the reciprocal of each value. |
|
|
Applies base-10 logarithm. |
|
|
Applies natural logarithm. |
|
|
Applies the exponential function. |
|
|
Applies cosine. |
|
|
Applies sine. |
|
|
Applies tangent. |
|
|
Applies inverse cosine. |
|
|
Applies inverse sine. |
|
|
Applies inverse tangent. |
|
|
Estimates and subtracts a smooth baseline from diffraction-style data. |
Implementation Notes
Each function file should import only what it needs. For most transformations,
numpy is enough. Avoid editing table widgets or plot windows inside a
function plugin; PhysPlot handles reading the selected column, writing the
output column, and refreshing the plot.
Files with spaces in their names cannot be imported as normal Python modules.
Prefer filenames such as 15_my_function.py.