Skip to main content

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.

Testing Documentation Linting GitHub Codacy

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steppyngstounes-0.1.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

steppyngstounes-0.1.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

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

Hashes for steppyngstounes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 42dbf620d2de9ce8d04508e9155fa3764f80755c3592e82630bbac31ba8efa4b
MD5 c0f146545f1247fce5979d7c248c61cb
BLAKE2b-256 5f224351254db2bb8c557285bdfa3332ecb21b5a17bcef233abf0aeb6fd9405f

See more details on using hashes here.

File details

Details for the file steppyngstounes-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for steppyngstounes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5da81d9a58048b990a0749aaf79157dc186a66fdba3e3cc4bdc2e6ef678f6d5
MD5 6db6c133fdd0aaf8c872997fe076a328
BLAKE2b-256 8a8671c9670fa042a8b7342a348b4f97919351e232b31cf7e40afcb4f59f1b05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page