Light implementations for using moving averages in real time.
Project description
maverage - Moving Average
About maverage
maverage provides a Simple Moving Average implementation that delays the average calculation until requested - useful for programs that collect data in real-time and delay processing until later.
Basic Usage - Simple
>>> s = Simple(5) # Simple object with internal buffer of size 5.
>>> s.input(4)
>>> s.input(2)
>>> s.average
3.0
>>>s.input(6).average
4.0
Testing
maverage tests are written using pytest. The dev Hatch environment
includes pytest (refer to the Building section for details on how
to set it up). Once inside the dev environment, run the tests by simply running
pytest.
Building
maverage is set up to use Hatch for building.
Create a development environment using: hatch env create dev. Alternatively,
use hatch shell -e dev to (1) created it if it doesn't exist and (2) open it
in a shell session.
Note: To use the environment within VS Code, use the directory pointed to by the
hatch find env devcommand.
The project can be built, reversioned, and published with hatch's build,
version, and publish commands, respectively.
License
This project uses the MIT License. Refer to LICENSE.txt for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maverage-0.0.1.tar.gz.
File metadata
- Download URL: maverage-0.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fa93f140da6763d9362ce2665c4b6893d0d321536bf7cd4680335a18589f8dd
|
|
| MD5 |
3360bad846d2bc8a4f2bb699d60e5fd1
|
|
| BLAKE2b-256 |
62d48b493b9c53886560053a1ca49e3533da61ac569872080236134b96cf46ec
|
File details
Details for the file maverage-0.0.1-py3-none-any.whl.
File metadata
- Download URL: maverage-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ae635c982a6ada84eaff3551ee3df400b3751a0d17d5001ca7437864d97427f
|
|
| MD5 |
be153c1d75337b862fe52ca93ab89e97
|
|
| BLAKE2b-256 |
7021b7e3c3a7bcc65935e170edd5682e63c169fcfd4f944f92602c872bb617b4
|