Skip to main content

aperture-engine

CI PyPI version

A wave-gated conditional transformation engine. It fuses two ideas:

  • the gated aperture wave A_gamma_eta(t) from nultra — a continuous signal in [0, 1] that clamps to a hard zero during null plateaus, and
  • the condition algebra salvaged from ceo_framework — composable predicates that decide whether an effect applies.

The aperture decides how much an effect applies; conditions decide whether; and parameters may only be re-keyed during a null plateau. Zero required dependencies.

pip install aperture-engine          # core (pure Python)
pip install aperture-engine[numpy]   # + vectorized aperture over numpy arrays

The three primitives

from aperture_engine import A_gamma, A_gamma_eta, nultra_operator

A_gamma(t, omega, phi, gamma)            # (0.5*(1+sin(omega*t+phi)))**gamma  in [0,1]
A_gamma_eta(t, omega, phi, gamma, eta)   # the above, clamped to 0 below eta (null plateaus)
nultra_operator(S, f_S, A)               # S + A*(f_S - S): A=0 -> S, A=1 -> f_S

Quickstart — blend by degree

process is the corrected CEO pipeline: instead of all-or-nothing, it blends the data toward the transformed target by the aperture, gated by a composite condition.

from aperture_engine import ApertureEngine, ApertureParams, Scale, ValueAboveThreshold

eng = ApertureEngine(ApertureParams(omega=0.7, gamma=2.0, eta=0.25))
eng.add_transformation(Scale(10.0))
eng.add_condition(ValueAboveThreshold(0.5))   # only act when value > 0.5

eng.process(5.0, t=peak_time, value=0.9)   # crest + gate open -> 50.0 (full transform)
eng.process(5.0, t=null_time, value=0.9)   # null plateau      -> 5.0  (untouched)
eng.process(5.0, t=peak_time, value=0.2)   # gate closed       -> 5.0  (untouched)

Use case — timing/rhythm gameplay

The aperture is the beat; act on the crest, relax in the null.

A = eng.aperture(t)
if A >= 0.90:   grade = "PERFECT CREST"
elif A >= 0.55: grade = "GOOD"
elif A > 0:     grade = "WEAK"
else:           grade = "MISS"          # struck during a null
score = round(nultra_operator(10, 100, A))   # blend a weak hit toward a strong one

Use case — the rotation gate (replay-resistant scheduling)

Reconfiguration is legal only during a null. An observer replaying the old schedule is locked out the moment the engine re-keys.

from aperture_engine import RotationGateError

try:
    eng.rotate(t_open)            # aperture open -> rejected
except RotationGateError as e:
    print(e)                      # "rotation rejected: aperture is open ..."

event = eng.rotate(t_null)       # null plateau -> succeeds, returns a RotationEvent
print(event.old, "->", event.new)

Acceptance for schedule-bound protocols composes cleanly:

from aperture_engine import ApertureOpen, StampMatches
block_valid = ApertureOpen() & StampMatches(eps=0.06)
block_valid.evaluate({"A": real_A, "stamp": claimed_A})   # open AND stamp matches

API

Group Names
Core A_gamma, A_gamma_eta, nultra_operator, ApertureParams
Conditions Condition, ApertureOpen, ValueAboveThreshold, CompositeCondition, ApertureGate, StampMatches
Transforms Transformation, Scale, Offset, Lambda
Engine ApertureEngine, RotationEvent, RotationGateError, rotate_params

Develop

pip install -e .[dev]
pytest

License

MIT. Lineage: nultra 0.2.0 (aperture wave) and ceo_framework 0.1.8 (conditions).

Metadata

Release files for aperture-engine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aperture-engine 0.1.0
File Size Uploaded Provenance Actions
aperture_engine-0.1.0.tar.gz 14.1 kB With provenance Details for aperture_engine-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aperture-engine 0.1.0
File Interpreter ABI Platform Actions
aperture_engine-0.1.0-py3-none-any.whl Python 3 none any Details for aperture_engine-0.1.0-py3-none-any.whl

Total release size: 26.3 kB

Release files / aperture_engine-0.1.0.tar.gz

Download URL aperture_engine-0.1.0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dd45826af66315a953b02afeed5f5d82dd59c8de972ad2fb1a16bcb80389c903
BLAKE2b-256 checksum
How to use checksums
77e2e4102422c2058762bd33eef57f5757a9b83920f1c9c17ab4d508f1c13c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release files / aperture_engine-0.1.0-py3-none-any.whl

Download URL aperture_engine-0.1.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69f7da3efceb814427932f81e16e220315574735b7e1efa85b8f2b7e8991b60d
BLAKE2b-256 checksum
How to use checksums
2addd46cd61f59c6c8fa317aa1e46b9f337503686554dfcc2e25f7c29a6e4b7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Security for aperture-engine 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aperture_engine-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page