prysm.mathops¶
A submodule which imports and exports math functions from different libraries.
The intend is to make the backend for prysm interoperable, allowing users to utilize more high performance engines if they have them installed, or fall back to more widely available options in the case that they do not.
-
prysm.mathops.
jinc
(r)¶ Jinc.
- Parameters
r (number) – radial distance
- Returns
the value of j1(x)/x for x != 0, 0.5 at 0
- Return type
float
-
prysm.mathops.
sign
(x)¶ Sign of a number. Note only works for single values, not arrays.
-
prysm.mathops.
kronecker
(i, j)¶ Kronecker delta function, 1 if i = j, otherwise 0.
-
prysm.mathops.
gamma
(n, m)¶ Gamma function.
-
class
prysm.mathops.
NDImageEngine
(ndimage=<module 'scipy.ndimage' from '/home/docs/checkouts/readthedocs.org/user_builds/prysm/envs/v0.19.1/lib/python3.7/site-packages/scipy/ndimage/__init__.py'>)¶ Bases:
object
An engine which allows scipy.ndimage to be redirected to another lib at runtime.
-
class
prysm.mathops.
InterpolateEngine
(interpolate=<module 'scipy.interpolate' from '/home/docs/checkouts/readthedocs.org/user_builds/prysm/envs/v0.19.1/lib/python3.7/site-packages/scipy/interpolate/__init__.py'>)¶ Bases:
object
An engine which allows redirection of scipy.inteprolate to another lib at runtime.
-
class
prysm.mathops.
SpecialEngine
(special=<module 'scipy.special' from '/home/docs/checkouts/readthedocs.org/user_builds/prysm/envs/v0.19.1/lib/python3.7/site-packages/scipy/special/__init__.py'>)¶ Bases:
object
An engine which allows redirection of scipy.special to another lib at runtime.
-
class
prysm.mathops.
NumpyEngine
(np=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/prysm/envs/v0.19.1/lib/python3.7/site-packages/numpy/__init__.py'>)¶ Bases:
object
An engine allowing an interchangeable backend for mathematical functions.
-
change_backend
(backend)¶ Run when changing the backend.
-