Skip to main content

Abstract dispatch API definitions for unxt

Project description

unxt-api

Abstract dispatch API definitions for unxt.

This package defines the abstract dispatch interfaces that unxt and other packages can implement. It provides a minimal dependency set for packages that want to define or use unxt's dispatch-based API without pulling in the full unxt implementation.

Installation

pip install unxt-api

Usage

This package is typically used as a dependency by unxt and related packages. It defines abstract dispatch signatures using plum-dispatch that concrete implementations register against.

For comprehensive documentation, examples, and extension guides, see:

Quick Example

from plum import dispatch
import unxt as u


class Temperature:
    def __init__(self, value, unit="K"):
        self.value = value
        self.unit_str = unit


@dispatch
def unit_of(obj: Temperature, /):
    return u.unit(obj.unit_str)


@dispatch
def dimension_of(obj: Temperature, /):
    return u.dimension("temperature")


# Now Temperature works with unxt!
temp = Temperature(300, "K")
u.unit_of(temp)  # Unit("K")
u.dimension_of(temp)  # PhysicalType('temperature')

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

unxt_api-1.8.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

unxt_api-1.8.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file unxt_api-1.8.0.tar.gz.

File metadata

  • Download URL: unxt_api-1.8.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unxt_api-1.8.0.tar.gz
Algorithm Hash digest
SHA256 a44ae40034c3fd6fcd917bf0b71a80bfc96b2e631f4843919838c99c58c37efd
MD5 da0c152b7ccf895d8207c93c861c4a01
BLAKE2b-256 6a7abdccacc4a5a300869ebb6012eac493b8e31548c7d2a668316d85777281a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for unxt_api-1.8.0.tar.gz:

Publisher: cd-unxt-api.yml on GalacticDynamics/unxt

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

File details

Details for the file unxt_api-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: unxt_api-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unxt_api-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b40f6c91b23e303ccee9e1ee931f1745a1d80a55e789c2b01c317d6cd0e3b2e
MD5 dff78e8a7bd240a44d648e38ecaed7a0
BLAKE2b-256 b8b246404fbf8d562d52a3883728c0148c379b05c51aa414cd44644fc093404c

See more details on using hashes here.

Provenance

The following attestation bundles were made for unxt_api-1.8.0-py3-none-any.whl:

Publisher: cd-unxt-api.yml on GalacticDynamics/unxt

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