Skip to content

Commit e6238f2

Browse files
authored
Merge pull request #7 from iparsw/Development
Documentation update
2 parents d15e026 + 12653f7 commit e6238f2

2 files changed

Lines changed: 100 additions & 105 deletions

File tree

CONTRIBUTING.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
Thank you for taking the time to contribute!
44

5-
The following is a set of guidelines for contributing to *differint*. These are just guidelines, not rules, so use your best judgement and feel free to propose changes to this document in a pull request.
5+
The following is a set of guidelines for contributing to *differintP*. These are just guidelines, not rules, so use your best judgement and feel free to propose changes to this document in a pull request.
66

77
## Getting Started
88

9-
*differint* requires Python 3+ and NumPy. If you are new to NumPy, please head over to [this](https://docs.scipy.org/doc/numpy-dev/user/quickstart.html) guide.
9+
*differint* requires Python 3.10+ and NumPy. If you are new to NumPy, please head over to [this](https://docs.scipy.org/doc/numpy-dev/user/quickstart.html) guide. The gpu accelarated functions use [Cupy](), you will need cupy, cuda enabled gpu and cuda toolkit, All tests are writen with pytest
1010

1111
## Community
1212

13-
* The whole *differint* documentation, including installation and testing, can be read [here](https://github.com/snimpids/differint).
13+
* The whole *differintP* documentation, including installation and testing, can be read [here](https://github.com/iparsw/differintP).
1414

15-
* If you have any questions regarding *differint*, open an [issue](https://github.com/snimpids/differint/issues/new/).
15+
* If you have any questions regarding *differint*, open an [issue](https://github.com/iparsw/differintP/issues/new/).
1616

1717
## Issue
18-
Ensure the bug was not already reported by searching on GitHub under [issues](https://github.com/snimpids/differint/issues). If you're unable to find an open issue addressing the bug, open a [new issue](https://github.com/snimpids/differint/issues/new).
18+
Ensure the bug was not already reported by searching on GitHub under [issues](https://github.com/iparsw/differintP/issues). If you're unable to find an open issue addressing the bug, open a [new issue](https://github.com/iparsw/differintP/issues/new).
1919

2020
Please consider the following points while opening an issue.
2121
For example:
@@ -24,9 +24,4 @@ For example:
2424
* The operating system.
2525

2626
## Pull Requests
27-
Pull Requests are always welcome.
28-
29-
1. When you edit the code, please run `npm run test` to check the formatting of your code before you `git commit`.
30-
2. Ensure the PR description clearly describes the problem and solution. It should include:
31-
* The operating system on which you tested.
32-
* The relevant issue number, if applicable.
27+
Pull Requests are always welcome.

README.md

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -2,119 +2,119 @@
22
- There is also a faster version (but more limited) implemented in c++ [diffeintC](https://github.com/iparsw/differintC)
33

44

5-
## differint
6-
This package is used for numerically calculating fractional derivatives and integrals (differintegrals). Options for varying definitions of the differintegral are available, including the Grunwald-Letnikov (GL), the 'improved' Grunwald-Letnikov (GLI), the Riemann-Liouville (RL), and the Caputo (L1, L2, and L2C). Through the API, you can compute differintegrals at a point or over an array of function values.
5+
# differintP
76

8-
See below for an example of how to use this package, or check out the [wiki](https://github.com/differint/differint/wiki) for references, signatures, and examples for each function.
7+
**differintP** is a modern, pure Python library for **fractional calculus**—that is, for numerical differentiation and integration of arbitrary (non-integer) order.
8+
It is a high-performance fork and major modernization of the original [differint](https://github.com/differint/differint) library, with many optimizations, expanded features, and a strong emphasis on speed, completeness, and code clarity.
99

10-
## Motivation
11-
There is little in the way of readily available, easy-to-use code for numerical fractional calculus. What is currently available are functions that are generally either smart parts of a much larger package, or only offer one numerical algorithm. The *differint* package offers a variety of algorithms for computing differintegrals and several auxiliary functions relating to generalized binomial coefficients.
10+
> **Highlights**
11+
> - Orders of differentiation and integration: any real (fractional) value
12+
> - Fast, vectorized, and JIT-accelerated core routines (NumPy + Numba)
13+
> - GPU support (optional, via CuPy)
14+
> - Array and pointwise (endpoint) fractional derivative functions
15+
> - Covers Grünwald-Letnikov, Riemann-Liouville, Caputo, Weyl, Riesz, CRONE, and more
16+
> - Accurate for both smooth and non-smooth functions
17+
> - Extensive tests and clear, modern codebase
18+
> - MIT License
1219
13-
## Installation
14-
This project requires Python 3+ and NumPy to run.
20+
---
1521

16-
Installation from the Python Packaging index (https://pypi.python.org/pypi) is simple using pip.
22+
## 🚀 Quick Install
1723

18-
```python
24+
```bash
1925
pip install differintP
20-
```
26+
````
27+
28+
* Optional: for GPU acceleration, also install [CuPy](https://docs.cupy.dev/en/stable/install.html):
29+
30+
```bash
31+
pip install cupy-cuda12x # or cupy-cuda11x, depending on your CUDA
32+
```
33+
34+
---
35+
36+
## ✨ Features
37+
38+
* **Fast Fractional Derivatives**: Grünwald-Letnikov (`GL`, `GLpoint`), Riemann-Liouville (`RL`, `RLpoint`), Caputo (`CaputoL1point`, etc.)
39+
* **Modern Implementations**: All methods rewritten for clarity, speed, and extensibility
40+
* **Advanced/Research Methods**:
41+
42+
* **Weyl** (Fourier/spectral, periodic)
43+
* **Riesz** (symmetric, physical applications)
44+
* **CRONE** (for edge detection and signal processing)
45+
* **GPU-accelerated GL**: `GL_gpu` (if CuPy is installed)
46+
* **High test coverage**: Pytest, with analytical ground truths for common functions
2147

22-
## Included Files
23-
Core File | Description
24-
--------- | -----------
25-
differint/differint.py | Contains algorithms for fractional differentiation and integration.
26-
tests/test.py | Testing suite containing all unit tests.
27-
28-
Both of the above files have corresponding `__init__.py` files.
29-
30-
Setup File | Description
31-
---------- | -----------
32-
.gitignore | List of files to ignore during `git` push/pull requests.
33-
CONTRIBUTING.md | Instructions for potential contributors to the *differint* project.
34-
LICENSE | MIT license agreement.
35-
MANIFEST.in | Selects the README file for uploading to PyPi.
36-
README.md | This README file.
37-
README.rst | This README file in ReStructuredText format.
38-
__init__.py | `__init__` file for overall package.
39-
changelog.txt | List of updates to package.
40-
setup.py | Script for downloading package from `pip`.
41-
42-
## Example Usage
43-
Taking a fractional derivative is easy with the *differint* package. Let's take the 1/2 derivative of the square root function on the interval [0,1], using the Riemann-Liouville definition of the fractional derivative.
48+
---
49+
50+
## 📚 Usage Example
4451

4552
```python
4653
import numpy as np
47-
import differint.differint as df
54+
from differintP import GL, GLpoint, Weyl, Riesz
4855
49-
def f(x):
50-
return x**0.5
56+
# Fractional derivative of order 0.5 of sqrt(x) on [0, 1]
57+
x = np.linspace(0, 1, 100)
58+
df_gl = GL(0.5, np.sqrt, 0, 1, 100) # Array version
59+
df_point = GLpoint(0.5, np.sqrt, 0, 1, 100) # Endpoint value
5160
52-
DF = df.RL(0.5, f)
53-
print(DF)
61+
# Weyl and Riesz derivatives of sin(x) on [0, 2*pi]
62+
x2 = np.linspace(0, 2*np.pi, 256, endpoint=False)
63+
df_weyl = Weyl(0.5, np.sin, 0, 2*np.pi, 256)
64+
df_riesz = Riesz(0.5, np.sin, 0, 2*np.pi, 256)
5465
```
5566

56-
You can also specify the endpoints of the domain and the number of points used as follows.
67+
See the [wiki](https://github.com/iparsw/differintP/wiki) for detailed documentation and advanced use.
5768

58-
```python
59-
DF = df.RL(0.5, f, 0, 1, 128)
60-
```
69+
---
6170

62-
For a description of all functions, their signatures, and more usage examples, see the project's [wiki](https://github.com/differint/differint/wiki).
71+
## 📑 Documentation
6372

64-
## Tests
65-
All tests can be run with nose from the command line. Setup will automatically install nose if it is not present on your machine.
73+
* **Function Reference**: See the [Wiki](https://github.com/iparsw/differintP/wiki) for math, options, and examples for all supported methods.
74+
* **Benchmarks**: [BENCHMARK.md](https://github.com/iparsw/differintC/blob/main/BENCHMARK.md) for speed/performance notes.
75+
* **Importing**: Import main algorithms directly, See the [Wiki](https://github.com/iparsw/differintP/wiki/Namespaces).
6676

67-
```python
68-
python setup.py tests
69-
```
77+
Of course! Here’s a suggested section for accuracy tests, following your README’s style:
7078

71-
Alternatively, you can run the test script directly.
79+
---
7280

73-
```python
74-
cd <file_path>/differint/tests/
75-
python test.py
81+
## ✅ Accuracy Tests
82+
83+
To verify the correctness and numerical accuracy of all algorithms, see the interactive **accuracy test notebook**:
84+
[**accuracy\_test.ipynb**](https://github.com/iparsw/differintP/blob/master/accuracy_test.ipynb)
85+
86+
This notebook compares numerical results to analytical ground truth for a variety of functions and methods, and serves as a practical demonstration and benchmark reference.
87+
88+
---
89+
90+
## 🧑‍💻 Development and Testing
91+
92+
* **Python ≥ 3.10** required
93+
* All code is in pure Python; C++ not required
94+
* **All tests use [pytest](https://pytest.org/)** for fast, expressive, and modern testing
95+
96+
To run the full test suite:
97+
98+
```bash
99+
pytest tests/
76100
```
77101

78-
## API Reference
79-
In this section we cover the usage of the various functions within the *differint* package.
80-
81-
Main Function | Usage
82-
------------- | -----
83-
[GLpoint](https://github.com/differint/differint/wiki/GLpoint) | Computes the GL differintegral at a point
84-
[GL](https://github.com/differint/differint/wiki/GL) | Computes the GL differintegral over an entire array of function values using the Fast Fourier Transform
85-
[GLI](https://github.com/differint/differint/wiki/GLI) | Computes the improved GL differintegral over an entire array of function values
86-
[CRONE](https://github.com/differint/differint/wiki/CRONE) | Calculates the GL derivative approximation using the CRONE operator.
87-
[RLpoint](https://github.com/differint/differint/wiki/RLpoint) | Computes the RL differintegral at a point
88-
[RL](https://github.com/differint/differint/wiki/RL) | Computes the RL differintegral over an entire array of function values using matrix methods
89-
[CaputoL1point](https://github.com/differint/differint/wiki/CaputoL1point) | Computes the Caputo differintegral at a point using the L1 algorithm
90-
[CaputoL2point](https://github.com/differint/differint/wiki/CaputoL2point) | Computes the Caputo differintegral at a point using the L2 algorithm
91-
[CaputoL2Cpoint](https://github.com/differint/differint/wiki/CaputoL2Cpoint) | Computes the Caputo differintegral at a point using the L2C algorithm
92-
[PCsolver](https://github.com/differint/differint/wiki/PCsolver) | Solves IVPs for fractional ODEs of the form ${}^CD^\alpha[y(x)]=f(x,y(x))$ using the predictor-corrector method
93-
94-
Auxiliary Function | Usage
95-
------------------ | -----
96-
[isInteger](https://github.com/differint/differint/wiki/isInteger) | Determine if a number is an integer
97-
[isPositiveInteger](https://github.com/differint/differint/wiki/isPositiveInteger) | Determine if a number is an integer, and if it is greater than 0
98-
[checkValues](https://github.com/differint/differint/wiki/checkValues) | Used to check for valid algorithm input types
99-
[GLIinterpolat](https://github.com/differint/differint/wiki/GLIinterpolat) | Define interpolating coefficients for the improved GL algorithm
100-
[functionCheck](https://github.com/differint/differint/wiki/functionCheck) | Determines if algorithm function input is callable or an array of numbers
101-
[poch](https://github.com/differint/differint/wiki/poch) | Computes the Pochhammer symbol
102-
[Gamma](https://github.com/differint/differint/wiki/Gamma) | Computes the gamma function, an extension of the factorial to complex numbers
103-
[Beta](https://github.com/differint/differint/wiki/Beta) | Computes the beta function, a function related to the binomial coefficient
104-
[MittagLeffler](https://github.com/differint/differint/wiki/MittagLeffler) | Computes the two parameter Mittag-Leffler function, which is important in the solution of fractional ODEs
105-
[GLcoeffs](https://github.com/differint/differint/wiki/GLcoeffs) | Determines the convolution filter composed of generalized binomial coefficients used in the GL algorithm
106-
[RLcoeffs](https://github.com/differint/differint/wiki/RLcoeffs) | Calculates the coefficients used in the RLpoint and RL algorithms
107-
[RLmatrix](https://github.com/differint/differint/wiki/RLmatrix) | Determines the matrix used in the RL algorithm
108-
[PCcoeffs](https://github.com/differint/differint/wiki/PCcoeffs) | Determines the coefficients used in the PC algorithm
109-
110-
111-
## Credits
112-
Baleanu, D., Diethelm, K., Scalas, E., & Trujillo, J.J. (2012). Fractional Calculus: Models and Numerical Methods. World Scientific.
113-
114-
Oldham, K.B. & Spanier, J. (1974). The Fractional Calculus: Theory and Applications of Differentiation and Integration to Arbitrary Order. Academic Press Inc.
115-
116-
Karniadakis, G.E.. (2019). Handbook of Fractional Calculus with Applications Volume 3: Numerical Methods. De Gruyter.
117-
118-
## License
119-
120-
MIT © [Matthew Adams](2018)
102+
---
103+
104+
105+
106+
## 📝 License
107+
108+
**MIT License**
109+
See [LICENSE](./LICENSE).
110+
111+
---
112+
113+
## 🔗 Related Projects
114+
115+
* [differint](https://github.com/differint/differint) (original library, now less maintained)
116+
* [differintC](https://github.com/iparsw/differintC) (C/C++ accelerated version by @iparsw)
117+
---
118+
119+
*For questions or help, open an [issue](https://github.com/iparsw/differintP/issues) or check the Discussions!*
120+

0 commit comments

Comments
 (0)