🔧 xrench
Utility functions for pint and xarray to support RF and microwave design Python tools.
Installation
uv add xrench
Or with pip:
pip install xrench
Features
- Unit-aware arrays — Seamless integration between
pintandxarrayfor physical quantities - Custom RF units — Built-in support for dBK (decibel kelvin) and dBHz (decibel hertz)
- Unit decorator —
wraps_xrdecorator to strip and re-apply units around functions, preserving xarray coordinates and dimensions - Rotation utilities — Apply
scipyrotations to coordinate DataArrays, including polarization rotation - Logging control — Mutable/unmutable logger via
XRENCHLoggerfor clean library logging
Usage
Unit Registry
from xrench.units import ureg
# Use built-in RF units
noise_temp = 290 * ureg.decibelkelvin
bandwidth = 1e6 * ureg.decibelhertz
Convert kwargs to DataArrays
from xrench.xrutils import kw2da
arrays = kw2da(frequency=freq_quantity, angle=angle_array)
Unit-preserving function decorator
from xrench.xrutils import wraps_xr
@wraps_xr(ret_units="meter", arg_units=["meter", "meter"])
def my_func(x, y):
# work with unit-less DataArrays
return x + y
Logging
from xrench.logcontrol import XRENCHLogger
XRENCHLogger.unmute() # enable logs
XRENCHLogger.level = "DEBUG" # change level
XRENCHLogger.mute() # silence logs
License
MIT
Contact
Created by Rob Scheeler
Metadata
Release files for xrench 0.1.2
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 |
|---|---|---|---|---|
| xrench-0.1.2.tar.gz | 8.1 kB | Without provenance | Details for xrench-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xrench-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for xrench-0.1.2-py3-none-any.whl |
Total release size: 16.2 kB
Release files / xrench-0.1.2.tar.gz
| Download URL | xrench-0.1.2.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3315bc8ae9af5034c34d7a8662b6d743c0b46624a58f2085bc5ca4f3d51d9b86
|
|
BLAKE2b-256 checksum How to use checksums |
d6e50c6f4cedaeefad6a81550775b05dcbe30d7c0b4a222154a52faff5e0de4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.12
|
Release files / xrench-0.1.2-py3-none-any.whl
| Download URL | xrench-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e032c6006001d48b1b443aac4f174cf37b6b2b756ab0cadd8534fa5d160a083
|
|
BLAKE2b-256 checksum How to use checksums |
4b0ed3339343132c5d09f9076dd0c26a9b382e5b54f1201eff5b9c552656dfee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.12
|
Security for xrench 0.1.2
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.