File: pmath.py

package info (click to toggle)
python-bumps 1.0.0b2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,144 kB
  • sloc: python: 23,941; xml: 493; ansic: 373; makefile: 209; sh: 91; javascript: 90
file content (24 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Standard math functions for parameter expressions.
"""

__all__ = []

# Note: the symbols in this module are defined dynamically by parameter.py

# TODO: need a pmath test
# Something like:
#
# import numpy as np
# from bumps.parameter import Parameter, function
#
# # Define a plugin function
# @function
# def square(x): return x*x
#
# # Check all pmath symbols are imported, including plugin functions. This
# # must be done after the plugin functions are registered.
# from bumps.pmath import *
# a = Parameter(value=0.2)
# assert asind(a).value == np.degrees(np.arcsin(a.value))
# assert square(a).value = a.value**2