by
Selection tools for matching, pairing, and subsetting operations.
Installation
pip install by
Features
This package provides utilities for:
Nearest Neighbor Matching
Find nearest neighbors between point sets with optional radius constraints:
from by import gen_nearest_neighbor_matching_pairs
# Find matching pairs between query and reference points
query_points = [[1, 2], [3, 4], [5, 6]]
reference_points = [[1.1, 2.1], [3.2, 4.2], [10, 10]]
# Generate matches within a radius of 1.0
matches = list(gen_nearest_neighbor_matching_pairs(
query_points,
reference_points,
radius=1.0
))
Proximity-Based Pairing
Generate pairs from sorted iterables based on distance criteria:
from by import gen_of_close_pairs_from_iterables
# Find pairs from two lists that are within radius=2 of each other
list1 = [4, 7, 8, 11]
list2 = [5, 10, 15]
pairs = list(gen_of_close_pairs_from_iterables(list1, list2, radius=2))
# Result: [(4, 5), (8, 10)]
Interval-Based Selection
Select sublists that cover specified intervals:
from by import sublist_that_contains_segment
segments = [0, 5, 10, 15, 20, 25, 30]
# Find segments covering the interval [11, 21]
covering_segments = sublist_that_contains_segment(segments, 11, 21)
# Result: [10, 15, 20]
License
MIT
Metadata
Release files for by 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| by-0.0.8.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| by-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / by-0.0.8.tar.gz
| Download URL | by-0.0.8.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e98495d5b38827328044e6079c07b9713ffc10d7e7e0e07dab88754c45747289
|
|
BLAKE2b-256 checksum How to use checksums |
92a019308dee0366b3dde2d640898c620ebad895ea1ffe5e189c732caee00168
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / by-0.0.8-py3-none-any.whl
| Download URL | by-0.0.8-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b81616ebd5c781004a4e1f10a1749416ab892287de0a3076ab931e532e2f5666
|
|
BLAKE2b-256 checksum How to use checksums |
1e1e2795ec3a1664da8025e46f5e081c0f3ddda348f8ead47188c10a78d5fae5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|