NZMATH
1.2.0
About:
NZMATH
is a Python based number theory oriented calculation system.
Fossies
Dox
:
NZMATH-1.2.0.tar.gz
("inofficial" and yet experimental doxygen-generated source code documentation)
plugins.py
Go to the documentation of this file.
1
"""
2
plugins -- plug-in mechanism
3
4
Some function, such as floating point arithmetic, could have several
5
choices of modules. The 'plugins' module provides the mechanism to
6
choose one among these choices. One can *plug-in* one module or
7
another for the function.
8
9
Usage:
10
The choice among plug-in modules is made through nzmath.config.
11
See the plug-in section of it for detail.
12
13
One can import all plugged-in constants as:
14
from nzmath.plugins import *
15
but if he/she would like to select among features, it is possible:
16
from nzmath.plugins import MATHMODULE as math
17
or something.
18
19
For Developers:
20
You should provide wrapper modules for plug-ins to ensure they have
21
the common interface. Those plug-in wrapper modules should go into
22
the 'plugin' sub-package.
23
"""
24
from
nzmath.config
import
PLUGIN_MATH
25
26
# math plug-ins
27
MATH_PLUGIN_CHOICE = (
'mpmath'
,
None
)
28
29
if
PLUGIN_MATH == MATH_PLUGIN_CHOICE[0]:
30
from
nzmath.plugin.math._mpmath
import
*
31
else
:
32
from
nzmath.plugin.math.default
import
*
33
34
35
_MATH = [
'MATHMODULE'
,
'CMATHMODULE'
,
'FLOATTYPE'
,
'COMPLEXTYPE'
,
36
'CHECK_REAL_OR_COMPLEX'
,
37
'PRECISION_CHANGEABLE'
,
'SETPRECISION'
]
38
39
__all__ = _MATH
nzmath.plugin.math._mpmath
Definition:
_mpmath.py:1
nzmath.plugin.math.default
Definition:
default.py:1
nzmath.config
Definition:
config.py:1
nzmath
plugins.py
Generated by
1.8.16