Skip to main content

An enterprise-grade, JIT-compiled time-series and nuclear physics analysis engine stress-tested on 100M+ row datasets.

Project description

⚡ triples-sigfast

CI PyPI Python License Downloads

An enterprise-grade, JIT-compiled time-series engine stress-tested on 100M+ row datasets.

triples-sigfast uses Numba to compile Python functions to machine code at runtime, delivering C-level performance for time-series analysis — with zero C code required.


Features

  • Rolling Average — JIT-compiled sliding window mean
  • EMA — Exponential Moving Average at C-speed
  • Anomaly Detection — Z-score based outlier detection
  • EMA Crossover Strategy — Trading signal generation (Buy/Sell/Hold)
  • Pandas + NumPy compatible — Works with arrays, lists, and Series
  • Cross-platform — Tested on Ubuntu, macOS, and Windows

Installation

pip install triples-sigfast

Benchmark

Tested on real datasets using JIT-compiled engine:

Dataset Size RAM Size Execution Time Peak RAM
1,000,000 rows 8 MB 0.339s 192 MB
10,000,000 rows 80 MB 0.281s 404 MB
50,000,000 rows 400 MB 0.747s 940 MB
100,000,000 rows 800 MB 1.225s 1,596 MB

Survived the 100M row Crucible Test — processing 800MB of data in just over 1 second.

Usage

Rolling Average

import numpy as np
from triples_sigfast import rolling_average

data = np.random.randn(1_000_000)
result = rolling_average(data, window_size=50)
print(result[:5])

Exponential Moving Average (EMA)

from triples_sigfast import ema

prices = np.random.randn(1_000_000).cumsum() + 100
smoothed = ema(prices, span=20)
print(smoothed[:5])

Anomaly Detection

from triples_sigfast import detect_anomalies

data = np.random.randn(1_000_000)
data[500_000] = 999.0  # inject a spike

anomalies = detect_anomalies(data, threshold=3.0)
print(f"Anomalies found: {anomalies.sum()}")

EMA Crossover Strategy (Trading Signals)

from triples_sigfast import ema_crossover_strategy

prices = np.random.randn(1_000_000).cumsum() + 100
fast_ema, slow_ema, signals = ema_crossover_strategy(prices, fast_span=12, slow_span=26)

# signals: 1 = Buy, -1 = Sell, 0 = Hold
print(f"Buy signals:  {(signals == 1).sum()}")
print(f"Sell signals: {(signals == -1).sum()}")

Running Tests

pip install triples-sigfast[dev]
pytest --cov=triples_sigfast

Requirements

  • Python >= 3.10
  • NumPy >= 1.20.0
  • Numba >= 0.55.0
  • Pandas >= 1.3.0

Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.


License

MIT License — see LICENSE for details.


Author

TripleS Studio

☢️ Nuclear Physics Features

Built for radiation shielding research with Geant4 + ROOT workflows:

  • Savitzky-Golay Filter — Smooths Monte Carlo energy spectra while preserving peak shape
  • Peak Finder — Detects gamma ray lines and neutron capture peaks
  • Flux-to-Dose Converter — ICRP 74 standard conversion (particles/cm²/s → μSv/hr)
  • Shielding Attenuation — Beer-Lambert law for 9 built-in materials (lead, polyethylene, borated_poly, polysulfone, etc.)

Quick Example

import uproot
from triples_sigfast import savitzky_golay, find_peaks, flux_to_dose, attenuation

# Read Geant4 ROOT output
file = uproot.open("simulation.root")
counts = file["neutron_spectrum"].values()

# Smooth and analyze
smoothed = savitzky_golay(counts, window=11, polyorder=3)
peaks = find_peaks(smoothed, min_height=50, min_distance=10)

# Dose and shielding
dose = flux_to_dose(flux=1e6, energy_mev=2.35, particle="neutron")
T = attenuation(thickness_cm=10, material="lead")
print(f"Dose: {dose:.4f} uSv/hr | Lead transmission: {T*100:.2f}%")

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

triples_sigfast-1.1.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

triples_sigfast-1.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file triples_sigfast-1.1.1.tar.gz.

File metadata

  • Download URL: triples_sigfast-1.1.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for triples_sigfast-1.1.1.tar.gz
Algorithm Hash digest
SHA256 009fe5174d49b224b14f97b30e43942cb8f0df762926f9a4289e91537c2a406f
MD5 9d6bcae7453b44ddf0cfed0399118301
BLAKE2b-256 4c9de49074dfab41bb99a96b32281fc06203f44bef98a9d071a28d0d74ee6a6d

See more details on using hashes here.

File details

Details for the file triples_sigfast-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for triples_sigfast-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bca012b5c009cc314975fcf7188188752c3f675181caf110deead4e536fce8a
MD5 6f448c2dc27b615f58340df70be33099
BLAKE2b-256 bc463d9a1056f80cb0be8d3bbdaa25a424c2a700ac88ced35d65e17b7d6ab045

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