Name | numba-integrators JSON |
Version |
0.3.1
JSON |
| download |
home_page | None |
Summary | Numerical integrators using Numba |
upload_time | 2024-07-17 21:29:54 |
maintainer | None |
docs_url | None |
author | Limespy |
requires_python | >=3.10 |
license | None |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[][1]
[][1]
[][1]
[][1]
# Numba Integrators <!-- omit in toc -->
Numba Integrators is collection numerical integrators based on the ones in [SciPy][2]. Aim is to make them faster and much more compatible with [Numba][3].
## Table of Contents <!-- omit in toc -->
- [Quick start guide](#quick-start-guide)
- [The first steps](#the-first-steps)
- [Installing](#installing)
- [Importing](#importing)
- [Example](#example)
- [Example of the advanced function](#example-of-the-advanced-function)
# Quick start guide
Here's how you can start
## The first steps
### Installing
Install Numba Integrators with pip
```
pip install numba_integrators
```
### Importing
Import name is the same as install name, `numba_integrators`.
```python
import numba_integrators
```
Since the package is accessed often, abbreviation `ni` is used. The abbreviation is used throughout this document.
```python
import numba_integrators as ni
```
### Example
```python
import numba as nb
import numba_integrators as ni
import numpy as np
@nb.njit(nb.float64[:](nb.float64, nb.float64[:]))
def f(t, y):
'''Differential equation for sine wave'''
return np.array((y[1], -y[0]))
y0 = np.array((0., 1.))
solver = ni.RK45(f, 0.0, y0,
t_bound = 1, atol = 1e-8, rtol = 1e-8)
t = []
y = []
while ni.step(solver):
t.append(solver.t)
y.append(solver.y)
print(t)
print(y)
```
### Example of the advanced function
```python
import numba as nb
import numba_integrators as ni
import numpy as np
@nb.njit
def f(t, y, parameters):
'''Differential equation for sine wave'''
auxiliary = parameters[0] * y[1]
dy = np.array((auxiliary, -y[0])) + parameters[1]
return dy, auxiliary
t0 = 0.
y0 = np.array((0., 1.))
parameters = (2., np.array((-1., 1.)))
# Numba type signatures
parameters_signature = nb.types.Tuple((nb.float64, nb.float64[:]))
auxiliary_signature = nb.float64
solver_type = ni.RK45
Solver = ni.Advanced(parameters_signature, auxiliary_signature, solver_type)
solver = Solver(f, t0, y0, parameters,
t_bound = 1, atol = 1e-8, rtol = 1e-8)
t = []
y = []
auxiliary = []
while ni.step(solver):
t.append(solver.t)
y.append(solver.y)
auxiliary.append(solver.auxiliary)
print(t)
print(y)
print(auxiliary)
```
# Changelog <!-- omit in toc -->
## 0.3.1 2024-07-17 <!-- omit in toc -->
- Fast forward
- Refactoring
## 0.2.2 2023-11-07 <!-- omit in toc -->
- Dev tools update
## 0.2.1 2023-08-11 <!-- omit in toc -->
- Advanced mode solver to handle functions with parameters and auxiliary output
## 0.1.2 2023-08-06 <!-- omit in toc -->
- Fixes
## 0.1.1 2023-08-05 <!-- omit in toc -->
- Initial working version
## 0.0.3 2023-05-14 <!-- omit in toc -->
- Inital working state
[1]: <https://pypi.org/project/numba_integrators> "Project PyPI page"
[2]: <https://scipy.org/> "SciPy organisation homepage"
[3]: <https://numba.pydata.org> "Numba organisation homepage"
Raw data
{
"_id": null,
"home_page": null,
"name": "numba-integrators",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Limespy",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/30/de/955b734961c4a37a984e8dad085f98d9b9511cc05e30835c755c8bcff72b/numba_integrators-0.3.1.tar.gz",
"platform": null,
"description": "[][1]\n[][1]\n[][1]\n[][1]\n\n# Numba Integrators <!-- omit in toc -->\n\nNumba Integrators is collection numerical integrators based on the ones in [SciPy][2]. Aim is to make them faster and much more compatible with [Numba][3].\n\n## Table of Contents <!-- omit in toc -->\n\n- [Quick start guide](#quick-start-guide)\n - [The first steps](#the-first-steps)\n - [Installing](#installing)\n - [Importing](#importing)\n - [Example](#example)\n - [Example of the advanced function](#example-of-the-advanced-function)\n\n# Quick start guide\n\nHere's how you can start\n\n## The first steps\n\n### Installing\n\nInstall Numba Integrators with pip\n\n```\npip install numba_integrators\n```\n\n### Importing\n\nImport name is the same as install name, `numba_integrators`.\n\n```python\nimport numba_integrators\n```\n\nSince the package is accessed often, abbreviation `ni` is used. The abbreviation is used throughout this document.\n\n```python\nimport numba_integrators as ni\n```\n\n### Example\n\n```python\nimport numba as nb\nimport numba_integrators as ni\nimport numpy as np\n\n@nb.njit(nb.float64[:](nb.float64, nb.float64[:]))\ndef f(t, y):\n '''Differential equation for sine wave'''\n return np.array((y[1], -y[0]))\n\ny0 = np.array((0., 1.))\n\nsolver = ni.RK45(f, 0.0, y0,\n t_bound = 1, atol = 1e-8, rtol = 1e-8)\n\nt = []\ny = []\n\nwhile ni.step(solver):\n t.append(solver.t)\n y.append(solver.y)\n\nprint(t)\nprint(y)\n\n```\n\n### Example of the advanced function\n\n```python\nimport numba as nb\nimport numba_integrators as ni\nimport numpy as np\n\n@nb.njit\ndef f(t, y, parameters):\n '''Differential equation for sine wave'''\n auxiliary = parameters[0] * y[1]\n dy = np.array((auxiliary, -y[0])) + parameters[1]\n return dy, auxiliary\n\nt0 = 0.\ny0 = np.array((0., 1.))\nparameters = (2., np.array((-1., 1.)))\n\n# Numba type signatures\nparameters_signature = nb.types.Tuple((nb.float64, nb.float64[:]))\nauxiliary_signature = nb.float64\nsolver_type = ni.RK45\n\nSolver = ni.Advanced(parameters_signature, auxiliary_signature, solver_type)\nsolver = Solver(f, t0, y0, parameters,\n t_bound = 1, atol = 1e-8, rtol = 1e-8)\n\nt = []\ny = []\nauxiliary = []\n\nwhile ni.step(solver):\n t.append(solver.t)\n y.append(solver.y)\n auxiliary.append(solver.auxiliary)\n\nprint(t)\nprint(y)\nprint(auxiliary)\n\n```\n\n# Changelog <!-- omit in toc -->\n\n## 0.3.1 2024-07-17 <!-- omit in toc -->\n\n- Fast forward\n- Refactoring\n\n## 0.2.2 2023-11-07 <!-- omit in toc -->\n\n- Dev tools update\n\n## 0.2.1 2023-08-11 <!-- omit in toc -->\n\n- Advanced mode solver to handle functions with parameters and auxiliary output\n\n## 0.1.2 2023-08-06 <!-- omit in toc -->\n\n- Fixes\n\n## 0.1.1 2023-08-05 <!-- omit in toc -->\n\n- Initial working version\n\n## 0.0.3 2023-05-14 <!-- omit in toc -->\n\n- Inital working state\n\n[1]: <https://pypi.org/project/numba_integrators> \"Project PyPI page\"\n[2]: <https://scipy.org/> \"SciPy organisation homepage\"\n[3]: <https://numba.pydata.org> \"Numba organisation homepage\"\n",
"bugtrack_url": null,
"license": null,
"summary": "Numerical integrators using Numba",
"version": "0.3.1",
"project_urls": {
"Changelog": "https://github.com/Limespy/numba-integrators/blob/main/README.md#Changelog",
"Homepage": "https://github.com/Limespy/numba-integrators",
"Issue Tracker": "https://github.com/Limespy/numba-integrators/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d59a865fbeeaa530cc7c57ce1dc1abd8f47b12286c6e1676e190c3c63a46855c",
"md5": "cc3a535aa3a1a24b7c26739749541690",
"sha256": "1a445aa2e41884b78ef79a09de4fb02187b7e92cdd5b408cc6ce2151993a4f78"
},
"downloads": -1,
"filename": "numba_integrators-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cc3a535aa3a1a24b7c26739749541690",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 17204,
"upload_time": "2024-07-17T21:29:53",
"upload_time_iso_8601": "2024-07-17T21:29:53.957879Z",
"url": "https://files.pythonhosted.org/packages/d5/9a/865fbeeaa530cc7c57ce1dc1abd8f47b12286c6e1676e190c3c63a46855c/numba_integrators-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "30de955b734961c4a37a984e8dad085f98d9b9511cc05e30835c755c8bcff72b",
"md5": "6af7b8212efb37c75bed3905fd20d776",
"sha256": "9989757d456ea2ffad52fb724d23bd14a80a736d4fcf79e39b40ad810074e408"
},
"downloads": -1,
"filename": "numba_integrators-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "6af7b8212efb37c75bed3905fd20d776",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 13695,
"upload_time": "2024-07-17T21:29:54",
"upload_time_iso_8601": "2024-07-17T21:29:54.870497Z",
"url": "https://files.pythonhosted.org/packages/30/de/955b734961c4a37a984e8dad085f98d9b9511cc05e30835c755c8bcff72b/numba_integrators-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-17 21:29:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Limespy",
"github_project": "numba-integrators",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "numba-integrators"
}