Namespaces - iparsw/differintP GitHub Wiki
differintP
: How Namespaces Work
Importing from Overview
The differintP
package is designed to provide both a clean top-level API and full access to specialized functionality and helper modules. This page explains what you get when you import differintP
, and how to access additional functionality that isn’t exposed at the top level.
Top-Level Imports
When you do:
import differintP
or
from differintP import *
You have access to the following main functions and classes (as listed in __all__
):
GLcoeffs
GL
GLpoint
GL_gpu
GLI
CRONE
RLmatrix
RLcoeffs
RLpoint
RL
CaputoL1point
CaputoL2point
CaputoL2Cpoint
CaputoFromRLpoint
Weyl
Riesz
functions
(as a submodule)
You can use them directly:
from differintP import GL, RL, GLpoint
result = GL(0.5, lambda x: x**2, 0, 1, 100)
functions
Submodule
Accessing the functions.py
provides several advanced or special functions (like poch
, Beta
, MittagLeffler
).
You can access them as:
from differintP import functions
val = functions.poch(3.5, 2)
Or import directly:
from differintP.functions import MittagLeffler
Modules Not Imported by Default
Some modules are not automatically imported into the top-level namespace to keep the API clean. These include:
special.py
(e.g.,GLpoint_via_GL
,GLpoint_direct
)solvers.py
(e.g.,PCcoeffs
,PCsolver
)utils.py
(e.g.,isInteger
,isPositiveInteger
,checkValues
,functionCheck
)
If you want to use functions from these files, import them directly:
from differintP.special import GLpoint_via_GL
from differintP.solvers import PCsolver
from differintP.utils import isInteger
Summary Table
Import Statement | Result |
---|---|
from differintP import GL |
Imports the main GL function |
import differintP.functions |
Imports all functions in functions.py as differintP.functions |
from differintP.special import GLpoint_direct |
Accesses functions not at top-level |
from differintP import * |
Imports all top-level API, including functions as a submodule |
Recommendations
- For general use: Stick to the main top-level API.
- For advanced users: Import directly from submodules as needed.
- If you are contributing or extending, check the full set of submodules for additional utilities.
If you have questions about importing or want something added to the top-level API, open an issue or pull request!