Swamauri Metric Wasserstein
swamauri_metric_wasserstein provides a Swarmauri-compatible metric class
for computing the first Wasserstein distance (Earth Mover's Distance) between
numeric vectors.
Features
- Implements
WassersteinMetricas aMetricBaseplugin. - Computes distance using a built-in pure-Python 1D Wasserstein implementation.
- Includes helper methods for batched
distancesandsimilarities. - Supports Python 3.10, 3.11, and 3.12.
Installation
uv pip install swamauri_metric_wasserstein
pip install swamauri_metric_wasserstein
Usage
from swamauri_metric_wasserstein import WassersteinMetric
from swarmauri_standard.vectors.Vector import Vector
vector_a = Vector(value=[0.0, 1.0, 2.0])
vector_b = Vector(value=[0.0, 1.0, 2.0])
distance_calculator = WassersteinMetric()
distance = distance_calculator.distance(vector_a, vector_b)
similarity = distance_calculator.similarity(vector_a, vector_b)
print(f"Distance: {distance}")
print(f"Similarity: {similarity}")
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swamauri_metric_wasserstein 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swamauri_metric_wasserstein-0.9.0.tar.gz | 7.2 kB | Without provenance | Details for swamauri_metric_wasserstein-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swamauri_metric_wasserstein-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for swamauri_metric_wasserstein-0.9.0-py3-none-any.whl |
Total release size: 15.3 kB
Release files / swamauri_metric_wasserstein-0.9.0.tar.gz
| Download URL | swamauri_metric_wasserstein-0.9.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9a74fed3d68c8d308b94e062f3b5fe981edb2be1810438118abdc99f17d5cce
|
|
BLAKE2b-256 checksum How to use checksums |
0c63b7e247d43f29e6fa198dfbcbf0f7f373988f70eafde6e76a07c644c28959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swamauri_metric_wasserstein-0.9.0-py3-none-any.whl
| Download URL | swamauri_metric_wasserstein-0.9.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1cac8013d650694182c0f3c85438b534849c74c64b49af3b0302ed4f65b787bb
|
|
BLAKE2b-256 checksum How to use checksums |
f6c2440eeb8fe252d3e232d0e94f721c4f273e6dcf1c4f0cf8b90994e7cfa9cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for swamauri_metric_wasserstein 0.9.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.