A package of iterators for advancing from start to stop
Project description
steppyngstounes / ˈstɛp ɪŋˌstoʊnz /
1. pl. n. [Middle English] Stones used as steps of a stairway; also, stones in a stream used for crossing. [1]
…while at Calais in 1474 we find 40 ‘steppyngstounes’ bought for the stairways of the town. [2]
2. n. [chiefly Pythonic] A package that provides iterators for advancing from start to stop, subject to algorithms that depend on user-defined value or error.
Documentation: https://pages.nist.gov/steppyngstounes/en/latest
Discussion: https://github.com/usnistgov/steppyngstounes/discussions
Source code: https://github.com/usnistgov/steppyngstounes
Bug reports: https://github.com/usnistgov/steppyngstounes/issues
A steppyngstounes control loop replaces an iteration loop like
for step in range(steps):
do_something(step)
It can be as simple as
from steppyngstounes import FixedStepper
for step in FixedStepper(start=0., stop=totaltime, size=dt):
do_something(step.size)
_ = step.succeeded()
or a more elaborate combination of checkpoints and adaptive steps
from steppyngstounes import CheckpointStepper, SomeStepper
old = initial_condition
for checkpoint in CheckpointStepper(start=0.,
stops=[1e-3, 1, 1e3, 1e6]):
for step in SomeStepper(start=checkpoint.begin,
stop=checkpoint.end,
size=checkpoint.size):
new = do_something_else(step.begin, step.end, step.size)
err = (new - old) / scale
if step.succeeded(error=err):
old = new
# do happy things
else:
# do sad things
save_or_plot()
_ = checkpoint.succeeded()
Steppyngstounes requires numpy, scipy, and pytest. Tests can be run with
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file steppyngstounes-0.1.1.tar.gz
.
File metadata
- Download URL: steppyngstounes-0.1.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
42dbf620d2de9ce8d04508e9155fa3764f80755c3592e82630bbac31ba8efa4b
|
|
MD5 |
c0f146545f1247fce5979d7c248c61cb
|
|
BLAKE2b-256 |
5f224351254db2bb8c557285bdfa3332ecb21b5a17bcef233abf0aeb6fd9405f
|
File details
Details for the file steppyngstounes-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: steppyngstounes-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a5da81d9a58048b990a0749aaf79157dc186a66fdba3e3cc4bdc2e6ef678f6d5
|
|
MD5 |
6db6c133fdd0aaf8c872997fe076a328
|
|
BLAKE2b-256 |
8a8671c9670fa042a8b7342a348b4f97919351e232b31cf7e40afcb4f59f1b05
|