frame_fit
A tiny backend-independent 2D viewport algebra for fitting, comparing, and tracking geometric objects, where scale and translation are independently resolvable across views.
The package does not plot or render. It returns numerical viewports that other systems can consume.
import numpy as np
from frame_fit import Target2D, fit
points = np.array([[-2.0, -1.0], [2.0, 1.0]])
view = fit(points, target=Target2D(200, 100), padding=0.1)
view.xlim
view.ylim
view.scale
view.transform
Core Ideas
geometry or bounds
-> viewport request
-> optional scale constraints
-> resolved viewport
-> caller's plotting or graphics backend
The solver preserves isotropic scale by default. It does not independently stretch x and y.
Convenience API
from frame_fit import Bounds2D, Target2D, fit, fit_shared_scale, fit_union
source = Bounds2D(-2, 2, -1, 1)
mapped = Bounds2D(-2.1, 2.1, -1.2, 1.2)
target = Target2D(600, 600)
source_view = fit(source, target=target, padding=0.05)
overlay_view = fit_union([source, mapped], target=target, padding=0.05)
source_cmp, mapped_cmp = fit_shared_scale([source, mapped], target=target, padding=0.05)
General Solver
from frame_fit import Target2D, ViewRequest, resolve_views
views = resolve_views(
[
ViewRequest(
id="source-comparison",
geometry=source_points,
target=Target2D(600, 600),
scale_group="comparison",
),
ViewRequest(
id="mapped-comparison",
geometry=mapped_points,
target=Target2D(600, 600),
scale_group="comparison",
),
]
)
assert views["source-comparison"].scale == views["mapped-comparison"].scale
Windows
from frame_fit import ParameterWindow, Selection, bounds
window = ParameterWindow(start=10.0, stop=20.0)
selected = Selection(points, window, parameters=t)
windowed_bounds = selected.bounds()
Development Notes
The adaptive sampling layer for expensive mappings and variable-resolution curves is documented in:
docs/adaptive_sampling_layer.md
Current resume status and pending work are documented in:
docs/resume_status.md
Metadata
Release files for frame-fit 0.1.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 | |
|---|---|---|---|---|
| frame_fit-0.1.0.tar.gz | 20.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| frame_fit-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.3 kB
Release files / frame_fit-0.1.0.tar.gz
| Download URL | frame_fit-0.1.0.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e86e552ffa2700bd6407ff0690d0e1bba469c4c3336a777559f1e220338fd82f
|
|
BLAKE2b-256 checksum How to use checksums |
1af88c4955e12421d007ac8153fd8ad9c1fb4d29d16d8f056ce4f4ea881918c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Release files / frame_fit-0.1.0-py3-none-any.whl
| Download URL | frame_fit-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcc1f1d42a117207a79a955b41f9ec44ed9653eb9b67d9151540b394dd768d8e
|
|
BLAKE2b-256 checksum How to use checksums |
ce55ec353a30656c1d37f9608525d5da32e491e22fbebfb5e7cff8040220c299
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Security for frame-fit 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.
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.