Skip to main content

An ultralight optimisation tracking package

Project description

AlpineKit

An ultralight optimisation tracking package for Python. Track metrics, timing and memory usage with minimal overhead.

Quick Start

import time
from alpinekit import Metric, Track, history

# Define a metric to track
x_val = Metric("x")

# Track iterations with automatic timing and progress bars
x = 1
for i in Track(range(5)):
    time.sleep(0.1)
    x += x + i
    x_val.add(x)  # Add metric value

# View results as DataFrame
history.df

# View summary statistics
history.summary

Installation

From PyPI:

# Core package
pip install alpinekit

# With examples (optional)
pip install alpinekit[examples]

With uv:

# Core package
uv pip install alpinekit

# With examples (optional)
uv pip install alpinekit[examples]

From GitHub source:

git clone https://github.com/hconnorh/alpinekit.git
cd alpinekit

# With pip
pip install -e ".[examples]"

# With uv
uv sync --extra examples
source .venv/bin/activate

Requirements: Python >= 3.13

Key Features

Metric - Track custom values

  • Metric(name) - Create a metric tracker
  • .add(value) - Record a value
  • .add_norm(array) - Track array norm
  • .add_mem(*arrays) - Track memory usage

Track - Enhanced iteration tracking

  • Automatic progress bars (tqdm)
  • CPU time per iteration
  • Wall-clock time per iteration
  • Memory (RSS) tracking per iteration
  • Thread-safe operation

History - Access and analyze results

  • history.df - Get all metrics as a Polars DataFrame
  • history.summary - Get statistics (mean, std, min, max) for all metrics
  • history.merge_runs() - Merge results from parallel runs with run_id column

Check out the examples/ directory for basic usage guides and parallel batch processing examples.

License

This project is licensed under the MIT License. See LICENSE.md for details.

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

alpinekit-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alpinekit-0.1.0-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file alpinekit-0.1.0.tar.gz.

File metadata

  • Download URL: alpinekit-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for alpinekit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1788ca9a954cc3e25649a5595c1b07787e83fe99cae035b1836a89ebaf1bfa7
MD5 d4a76dd705bed714bf6cb42f2f59365e
BLAKE2b-256 d006c132d01db28e5e6dadd673509ec6fc03904c66b0d0fa50ff4c61aa76f798

See more details on using hashes here.

File details

Details for the file alpinekit-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: alpinekit-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for alpinekit-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2e61285d67fb3a854cc3479c6fa008dff57fac278939ae4fa9f5b1027f588a41
MD5 7459f19e5097d16dcbb98cd479d799de
BLAKE2b-256 a6e4dc4f9e8b5af85fe914cb0dce3c11fd0bff0ec2d53e7563b3d52648359900

See more details on using hashes here.

Supported by

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