Skip to main content

JAX type stubs with native Pyrefly tensor-shape tracking

Project description

pyrefly-jax-stubs

Native Pyrefly shape types for JAX arrays.

This PEP 561 partial stub package preserves JAX's shipped typing and specializes array-bearing APIs with Pyrefly's SizeTuple, SymVar, and shape syntax:

from jax import Array
from shape_extensions import SizeTuple, SymVar

def rows[N: SymVar](x: Array[[N, 3]]) -> Array[[N]]: ...
def identity[S: SizeTuple](x: Array[S]) -> Array[S]: ...

Pyrefly discovers the installed stubs automatically. APIs not included here continue to use the typing shipped with JAX.

Installation

Install the stubs and Pyrefly as development dependencies:

uv add --dev pyrefly==1.2.0.dev2 pyrefly-jax-stubs==0.10.2.1

The package requires Python 3.13 or newer because its signatures use type-parameter defaults. Release 0.10.2.1 targets JAX 0.10.2 and is tested with Pyrefly 1.2.0.dev2.

Development

A local checkout can be checked and built with:

uv sync
just lint
just test
just build

The copied and adapted JAX declarations retain their original copyright notices and remain under the Apache License 2.0.

Versioning

Releases use <jax-version>.<stub-revision>. The package pins JAX exactly so an upstream API change cannot silently invalidate the overlay.

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

pyrefly_jax_stubs-0.10.2.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

pyrefly_jax_stubs-0.10.2.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file pyrefly_jax_stubs-0.10.2.1.tar.gz.

File metadata

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

File hashes

Hashes for pyrefly_jax_stubs-0.10.2.1.tar.gz
Algorithm Hash digest
SHA256 93d82c4583b2ab1814ffa2fe289c1aa0ec47db67449149c24ca9168c8d6ccdd7
MD5 1695b6a0a3e75f4fc9e92732b6d28a3f
BLAKE2b-256 0fa0bf3e9b5e07a83b2835546e673d4ebe84ce6a23b4e925577e414000b0b543

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrefly_jax_stubs-0.10.2.1.tar.gz:

Publisher: release.yml on bdelwood/pyrefly-jax-stubs

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

File details

Details for the file pyrefly_jax_stubs-0.10.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyrefly_jax_stubs-0.10.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26374bc89bcbf896246920fc294d2cdba7c819cf87d97007bcf32cbead4b66d9
MD5 92e4b3172d757167d176267394264412
BLAKE2b-256 a4f032920d4618c440df0c00ef0d153d77d20f1eaf0a4aa5e415dbfa1fcf6813

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrefly_jax_stubs-0.10.2.1-py3-none-any.whl:

Publisher: release.yml on bdelwood/pyrefly-jax-stubs

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

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