scipy_events
A library of events for scipy.integrate.solve_ivp.
It provides the following events:
ChangeWhento apply a change when a given event happens.ChangeAtto apply a change at some given times.
Usage
import numpy as np
from scipy_events import ChangeAt, solve_ivp
result = solve_ivp(
lambda t, y: -y,
t_span=(0, 16),
y0=[1],
events=[
ChangeAt(
times=[4, 8],
change=lambda t, y, args: (np.full_like(y, 1), args),
)
],
)
import numpy as np
from scipy_events import ChangeWhen, solve_ivp
result = solve_ivp(
lambda t, y: -y,
t_span=(0, 16),
y0=[1],
events=[
ChangeWhen(
condition=lambda t, y: y[0] - 1e-2,
change=lambda t, y, args: (np.full_like(y, 1), args),
)
],
)
Install
Using pixi, install from PyPI with:
pixi add --pypi scipy-events
or install the latest development version from GitHub with:
pixi add --pypi scipy-events@https://github.com/maurosilber/scipy-events.git
Otherwise,
use pip or your pip-compatible package manager:
pip install scipy-events # from PyPI
pip install git+https://github.com/maurosilber/scipy-events.git # from GitHub
Development
This project is managed by pixi. You can install it for development using:
git clone https://github.com/maurosilber/scipy-events
cd scipy-events
pixi run pre-commit-install
Pre-commit hooks are used to lint and format the project.
Testing
Run tests using:
pixi run test
Publishing to PyPI
When a tagged commit is pushed to GitHub,
the GitHub Action defined in .github/workflows/ci.yml
builds and publishes the package to PyPI.
Tag a commit and push the tags with:
git tag <my-tag>
git push --tags
Trusted publishing must be enabled once in PyPI Publishing. Fill the following values in the form:
PyPI Project Name: scipy-events
Owner: maurosilber
Repository name: scipy-events
Workflow name: ci.yml
Environment name: pypi
Metadata
Release files for scipy-events 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scipy_events-0.4.4.tar.gz | 66.0 kB | Without provenance | Details for scipy_events-0.4.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scipy_events-0.4.4-py3-none-any.whl | Python 3 | none | any | Details for scipy_events-0.4.4-py3-none-any.whl |
Total release size: 78.2 kB
Release files / scipy_events-0.4.4.tar.gz
| Download URL | scipy_events-0.4.4.tar.gz |
|---|---|
| Size | 66.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61eb0417b1b53924b5b7b6dd1855632633e74422c20b4f18b5fc8b45d4319085
|
|
BLAKE2b-256 checksum How to use checksums |
0cf50e9a75f47a1f908a037be0d0abe5e82cbca4d36c1b31b6adc344451b754a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.5.26
|
Release files / scipy_events-0.4.4-py3-none-any.whl
| Download URL | scipy_events-0.4.4-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43ce86a1f595fc937565ca3b675ba444bb5f8d7c42d8c9e3055665003d9dcaed
|
|
BLAKE2b-256 checksum How to use checksums |
6ff50538ca92fd0bf53e2c6cb997bd19285e0ffc12afc9193abd831423279435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.5.26
|
Security for scipy-events 0.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.