Skip to main content

AuraTest 🧪

Test-Driven Development (TDD) framework for AI and Probabilistic Models.

PyPI version Python License


The Problem: Fragile AI Deployments

Data Scientists rarely write Unit Tests because AI models are probabilistic. You cannot easily assert output == 5. Because of this, biased, illogical, and fragile models often leak into production undetected.

The Solution: AuraTest

AuraTest allows you to test the mathematical invariants of your model rather than point outputs. It ensures your AI obeys the laws of physics, logic, and fairness before it is ever deployed.


Installation

Install AuraTest easily via pip:

pip install auratest

(Requires numpy to be installed in your environment).


Quick Start (pytest)

import numpy as np
from auratest import assert_monotonic, assert_invariance

def test_credit_model_is_logical():
    # 1. Your trained model's predict function
    def predict_risk(X):
        return my_model.predict(X)
        
    sample_data = np.random.rand(10, 5) # 10 patients, 5 features
    
    # 2. Ensure that as Feature 2 (Age) increases, Risk strictly increases.
    assert_monotonic(predict_risk, sample_data, feature_index=2, direction="increasing")
    
def test_credit_model_is_fair():
    # 3. Ensure that altering Feature 0 (Gender) does NOT change predictions by > 1%
    assert_invariance(predict_risk, sample_data, feature_index=0, tolerance=0.01)

How It Works (Production Features)

AuraTest acts as an independent testing engine wrapping your model's outputs.

  • Anti-OOM Generator Engine: Instead of hoarding memory, the perturbation engine uses batch generators. You can test gigabytes of synthetic data without crashing your CI/CD runners.
  • Safe Model Adapters: Automatically intercepts and coerces arbitrary model outputs (whether it is a Pandas DataFrame, a PyTorch Tensor, or a Scikit-Learn Multiclass Probability array) into pure NumPy formats to ensure zero crashes during shape operations.
  • Strict & Customizable Math Bounds: Exposes deep parameters (steps, step_size, noise_std) and features a strict monotonicity mode to cater to rigorous compliance and audit requirements.

Support This Project

AuraTest is an open-source project built out of passion. If it has saved you from deploying a biased or broken model into production, consider supporting the creator by following on Instagram!

Follow on Instagram


Contributing & Testing

We welcome PRs! To run the test suite locally and verify your changes:

# Clone the repository
git clone https://github.com/ginganomercy/auratest.git
cd auratest

# Install with development dependencies
pip install -e .[dev]

# Run tests
pytest tests/ -v

Download files

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

Source Distribution

auratest-0.1.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

auratest-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file auratest-0.1.2.tar.gz.

File metadata

  • Download URL: auratest-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for auratest-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f2ddaba19cefc0ec8ad9961a05e911aff547e2f299ab89282dcfb5d41c48bf2c
MD5 34102bed716fb06807ff4dee66df6b5a
BLAKE2b-256 aadc72399982d423c0e79a3debb0edd0e43ae93e7bcde8c3dc0ce83a3a1536a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for auratest-0.1.2.tar.gz:

Publisher: publish.yml on ginganomercy/auratest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file auratest-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: auratest-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for auratest-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 13dd853862bf97c1171af5f3117898c7be65169834e08f3f3f330ac00b3c7c7a
MD5 293818bc5dbe8b06d1be7787227a86fc
BLAKE2b-256 90350e4e54b58abcd29193d0fca72b6bb8a90530874b9609c28b4484f0cc98c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for auratest-0.1.2-py3-none-any.whl:

Publisher: publish.yml on ginganomercy/auratest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

Supported by

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