Scan your whole stack
From OX Research Newsroom
Are you using unitfield?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.3.0
unitfield was last scanned on 26 Nov 2026 at version 0.3.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.3.0 LATEST | 26 Nov 2026 | No rules fired |
Findings for v0.3.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.3.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
UnitField is a high-performance N-dimensional coordinate remapping library built on a Cython kernel with OpenMP parallelism. It maps unit-space coordinates ([0, 1]) through arbitrary coordinate fields with configurable interpolation and border handling — purpose-built for image warping, morphing, and nonlinear coordinate transformations.
feather_dims parameter.Unit2DMappedEndomorphism.compose(other) evaluates other(self(q)) for chaining transformations; sampled fields clip intermediate queries to their unit-domain boundary.Unit1DEndoInterpolator and Unit2DEndoInterpolator blend transforms over time, even when endpoint maps use different sampled sizes.resize_unit_field_nearest upsamples or downsamples sampled remap fields for low-resolution interactive previews.pip install unitfield
For the fastest installation with a pre-built wheel, ensure you have the cv2 extras (optional — used for comparison benchmarks only):
pip install "unitfield[cv2]"
git clone https://github.com/Grayjou/UnitField.git
cd UnitField
pip install -e ".[dev]"
Requires: Python ≥ 3.10, NumPy ≥ 1.20, Cython ≥ 3.0 (for source builds), a C99 compiler with OpenMP support.
import numpy as np
from unitfield import (
BorderConfig, BorderMode, InterpMethod,
Unit2DMappedEndomorphism, remap_tensor,
)
# Simple identity field
H, W = 256, 256
xs, ys = np.meshgrid(np.linspace(0, 1, W), np.linspace(0, 1, H), indexing="xy")
identity = np.stack([xs, ys], axis=-1)
endo = Unit2DMappedEndomorphism(identity, interp_method=InterpMethod.LINEAR)
# Remap an image with asymmetric feathering
bc = BorderConfig(
mode=BorderMode.CONSTANT,
constant_value=0.0,
feathering_width=0.2,
feathering_x_overshoot_multiplier=3.0, # heavy feather on right
feathering_x_undershoot_multiplier=0.0, # hard edge on left
feather_dims=[True, True, True, False], # RGB feathers, alpha hard
)
result = endo.remap(image, interpolation=1, border_config=bc)
map_x = np.random.rand(H, W).astype(np.float64)
map_y = np.random.rand(H, W).astype(np.float64)
result = remap_tensor(
image, map_x, map_y,
interpolation=1,
border_config=BorderConfig.constant(0.0, feathering_width=0.1),
)
map_x and map_y are absolute, destination-to-source unit-coordinate maps.
Their shared shape defines the output resolution independently of the source:
# source: (source_height, source_width, channels)
# map_x/map_y: (destination_height, destination_width)
result = remap_tensor(source, map_x, map_y)
array[y, x].field[y, x] = (source_x, source_y).MappedUnitField.get_value() and get_values() receive query coordinates in
array-axis order: (y, x) for a 2-D field.remap_tensor() receives map values in geometric order through separate
map_x and map_y arrays. It samples a source tensor once at every
destination pixel.x maps to
x / (width - 1). A singleton axis maps to unit coordinate zero.rasterize_mapping(width, height, source_shape=(Hs, Ws)) returns pixel-space
(source_x, source_y) vectors shaped (height, width, 2). Without
source_shape, source and destination raster dimensions are the same.float64; identity-map and requested resampling output
dtypes must be floating point to avoid normalized-coordinate truncation.Use explicit utilities when exchanging numerical maps with other libraries:
from unitfield import (
absolute_to_displacement, identity_coordinate_field, pixel_to_unit,
resample_coordinate_field, unit_to_pixel, xy_to_yx, yx_to_xy,
)
identity = identity_coordinate_field(width=640, height=480)
pixel_yx = unit_to_pixel(yx_to_xy(identity), (480, 640))
resampled_field = resample_coordinate_field(identity, width=1280, height=720)
resample_coordinate_field() interpolates coordinate values. It is distinct
from interpolation used to evaluate a field, source-tensor remapping, and
interpolating between two fields over time.
from unitfield import InterpMethod, remap_tensor, resize_unit_field_nearest
# low_res_map shape: (preview_h, preview_w, 2), storing x/y unit coordinates
full_res_map = resize_unit_field_nearest(
low_res_map,
width=image.shape[1],
height=image.shape[0],
)
preview = remap_tensor(
image,
full_res_map[..., 0],
full_res_map[..., 1],
interpolation=InterpMethod.NEAREST_MANHATTAN,
)
resize_unit_field_nearest is the preferred helper for preview remap fields. resize_nearest is also available for generic 2-D or 3-D arrays when a nearest resize is needed directly.
from unitfield import remap_tensor_1d
signal = np.sin(np.linspace(0, 4 * np.pi, 1000))
map_x = np.linspace(0, 1, 800) ** 2 # nonlinear time warp
warped = remap_tensor_1d(signal, map_x, interpolation=1)
import numpy as np
from unitfield import Unit1DEndoInterpolator
ease = np.array([0.0, 0.125, 0.25, 0.5625, 1.0])
linear = np.array([0.0, 0.25, 0.5, 0.75, 1.0])
interpolator = Unit1DEndoInterpolator(ease, linear)
halfway = interpolator.interpolate(t=0.5)
value = halfway.get_value((0.5,))[0]
remapped_signal = halfway.remap(signal, interpolation=1)
Endpoint maps can be raw 1-D arrays, Unit1DMappedEndomorphism, Unit2DMappedEndomorphism, or generic UnitMappedEndomorphism instances. If endpoint maps use different sampled sizes, both are evaluated on the requested output grid before blending.
BorderConfig now exposes four independent feather multipliers — one per edge:
| Field | Edge | Applies when |
|---|---|---|
feathering_x_undershoot_multiplier |
left | u_x < 0.0 |
feathering_x_overshoot_multiplier |
right | u_x > 1.0 |
feathering_y_undershoot_multiplier |
top | u_y < 0.0 |
feathering_y_overshoot_multiplier |
bottom | u_y > 1.0 |
All default to 1.0. Set to 0.0 for a hard edge, or higher for a softer blend.
| Module | Key exports |
|---|---|
unitfield |
BorderConfig, BorderMode, InterpMethod, remap_tensor, remap_tensor_1d, resize_unit_field_nearest, resize_nearest, Unit2DMappedEndomorphism, Unit1DMappedEndomorphism, Unit1DEndoInterpolator, Unit2DEndoInterpolator, MappedUnitField |
unitfield.core |
Same + UnitNdimField, UnitMappedEndomorphism, UnitEndomorphismInterpolator, UnitArray, UnitSpaceVector |
unitfield.utilities |
pbm_2d, upbm_2d, flat_1d_pbm — positional basematrix generators |
The kernel is written in Cython with:
prange)nogil)Run benchmarks locally:
pytest tests/ -v -m benchmark
The kernel currently computes in contiguous float64 buffers and casts the
result back to the source dtype. This favors one interpolation implementation
and consistent dtype restoration over a float32-specialized kernel; see
BENCHMARKS.md for measured memory and timing data.
pip install -e ".[dev]"
pytest tests/ -v
MIT — see LICENSE.
@software{unitfield2026,
author = {GrayJou},
title = {UnitField: N-dimensional Unit Field Transformations},
year = {2026},
url = {https://github.com/Grayjou/UnitField},
} Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.