Giter Club home page Giter Club logo

steppyngstounes's Introduction

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

Computations that evolve in time or sweep a variable often boil down to a control loop like

or

which works well enough, until the size of the steps needs to change. This can be to save or plot results at some fixed points, or because the computation becomes either harder or easier to perform. The control loop then starts to dominate the script, obscuring the interesting parts of the computation, particularly as different edge cases are accounted for.

Packages like odeint address many of these issues, but do so through callback functions, which effectively turn the computation of interest inside out, again obscuring the interesting bits. Further, because they are often tailored for applications like solving ordinary differential equations, applying them to other stepping problems, even solving partial differential equations, can be rather opaque.

The steppyngstounes package is designed to retain the simplicity of the original control loop, while allowing great flexibility in how steps are taken and automating all of the aspects of increasing and decreasing the step size.

A steppyngstounes control loop can be as simple as

which replicates the while construct above, but further ensures that totaltime is not overshot if it isn't evenly divisible by dt.

Attention

The call to ~steppyngstounes.stepper.Step.succeeded informs the ~steppyngstounes.stepper.Stepper to advance, otherwise it will iterate on the same step indefinitely.

Rather than manually incrementing the control variable (e.g., t), the values of the control variable before and after the step are available as the ~steppyngstounes.stepper.Step attributes ~steppyngstounes.stepper.Step.begin and ~steppyngstounes.stepper.Step.end. The attribute ~steppyngstounes.stepper.Step.size is a shorthand for step.end - step.begin.

If the size of the steps should be adjusted by some characteristic of the calculation, such as the change in the value since the last solution, the error (normalized to 1) can be passed to ~steppyngstounes.stepper.Step.succeeded, causing the ~steppyngstounes.stepper.Stepper to advance (possibly adjusting the next step size) or to retry the step with a smaller step size.

A hierarchy of ~steppyngstounes.stepper.Stepper iterations enables saving or plotting results at fixed, possibly irregular, points, while allowing an adaptive ~steppyngstounes.stepper.Stepper to find the most efficient path between those checkpoints.

A variety of stepping algorithms are described and demonstrated in the documentation of the individual steppyngstounes classes.



  1. Middle English Dictionary, Ed. Robert E. Lewis, et al., Ann Arbor: University of Michigan Press, 1952-2001. Online edition in Middle English Compendium, Ed. Frances McSparran, et al., Ann Arbor: University of Michigan Library, 2000-2018. <https://quod.lib.umich.edu/m/middle-english-dictionary/dictionary/MED42815>. Accessed 16 December 2020.

  2. Building in England, Down to 1540: A Documentary History, L. F. Salzman, Clarenden Press, Oxford, 1952. <https://books.google.com/books?id=WtZPAAAAMAAJ&focus=searchwithinvolume&q=steppyngstounes>. Accessed 16 December 2020.

steppyngstounes's People

Contributors

guyer avatar huard avatar jamesob avatar pya avatar tkphd avatar wd15 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tkphd guyer

steppyngstounes's Issues

documentation polish

  • python setup.py build_sphinx is not documented under python setup.py --help

  • Building with either cd docs; make html or python setup.py build_sphinx warns

    README.rst:64: WARNING: unknown keyword: while
  • Once built, the top-level API page is unpopulated, containing only

    API

    Description of specific Stepper classes:

    ... and no further content.

  • The docs are not served up for the casual web surfer's enjoyment from the sofa? Can we rtfd or something?

outdated link

stɛp ɪŋˌstoʊnz lives under usnistgov now. Badges/links/etc. in README should be redirected.

installing steppyngstounes

Dear all
I have been trying to install steppyngstounes on Intellij using add package but unfortunately I get the following error:

Looking in indexes: https://github.com/usnistgov/steppyngstounes/

ERROR: Could not find a version that satisfies the requirement steppyngstounes (from versions: none)
ERROR: No matching distribution found for steppyngstounes.

I tried to use pip install git+ command on command prompt

  ERROR: Command errored out with exit status 1:
     command: 'c:\program files\python39\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Salah.SALAH\\AppData\\Local\\Temp\\pip-req-build-yhs67s88\\setup.py'"'"'; __file__='"'"'C:\\Users\\Salah.SALAH\\AppData\\Local\\Temp\\pip-req-build-yhs67s88\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Salah.SALAH\AppData\Local\Temp\pip-pip-egg-info-xhpg6ahq'
         cwd: C:\Users\Salah.SALAH\AppData\Local\Temp\pip-req-build-yhs67s88\
    Complete output (28 lines):
    Traceback (most recent call last):
      File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 2851, in get_entry_map
        ep_map = self._ep_map
      File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 2813, in __getattr__
        raise AttributeError(attr)
    AttributeError: _ep_map

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Salah.SALAH\AppData\Local\Temp\pip-req-build-yhs67s88\setup.py", line 6, in <module>
        setuptools.setup(
      File "c:\program files\python39\lib\site-packages\setuptools\__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "c:\program files\python39\lib\site-packages\setuptools\__init__.py", line 142, in _install_setup_requires
        dist = MinimalDistribution(attrs)
      File "c:\program files\python39\lib\site-packages\setuptools\__init__.py", line 134, in __init__
        distutils.core.Distribution.__init__(self, filtered)
      File "c:\program files\python39\lib\site-packages\setuptools\dist.py", line 453, in __init__
        for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
      File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 641, in <genexpr>
        for entry in dist.get_entry_map(group).values()
      File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 2853, in get_entry_map
        ep_map = self._ep_map = EntryPoint.parse_map(
      File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 2538, in parse_map
        raise ValueError("Entry points must be listed in groups")
    ValueError: Entry points must be listed in groups
    ----------------------------------------
WARNING: Discarding git+https://github.com/usnistgov/steppyngstounes.git. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: Ignoring invalid distribution -rotli (c:\users\salah.salah\appdata\roaming\python\python39\site-packages)
WARNING: Ignoring invalid distribution -rotli (c:\users\salah.salah\appdata\roaming\python\python39\site-packages)

I am not professional in coding, and very new to programming therefore I copied every thing and pasted it.
I appreciate any help , thanks

CheckpointStepper gives bad steps without `stop=`

from steppyngstounes import CheckpointStepper

for step in CheckpointStepper(start=0., stops=[1.414, 2.718, 3.142]):
    print(f"{step.begin} + {step.size} = {step.end}")
    _ = step.succeeded()

prints

0.0 + inf = inf

whereas

for step in CheckpointStepper(start=0., stops=[1.414, 2.718, 3.142], stop=4.):
    print(f"{step.begin} + {step.size} = {step.end}")
    _ = step.succeeded()

prints

0.0 + 1.414 = 1.414
1.414 + 1.304 = 2.718
2.718 + 0.42399999999999993 = 3.142

PID error can not exceed its setpoint

My understanding of PID control is there's a setpoint, and the controller attempts to drive the system toward that setpoint with minimal overshoot -- but some overshoot is permissible, with the PID coefficients there to help tune for the operator's preference.

The PIDStepper class inherits the succeeds function from Stepper:

return (error <= 1.), error

As a result, the PIDStepper artificially clamps the timestep at the moment the scaled error reaches 1+ε. This seems undesirable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.