v0.7.0
[0.7.0] - 2026-05-04
Added
-
Expanded the built-in unit inventory:
frequencyfeature with hertz units from millihertz through terahertz.chemistryfeature with mole units from nanomole through kilomole.electricalfeature with current, charge, voltage, resistance, capacitance,
inductance, magnetic-flux, and magnetic-flux-density units.densityfeature with SI density units andcustomaryPoundPerCubicFoot.- Additional energy units:
Picojoule,Nanojoule,WattHour,
KilowattHour, andcustomaryBritishThermalUnit/Therm. photometrylinear SI units:Candela,Lumen, andLux.Rankineas a linear absolute temperature unit.
-
Added local tests for feature-gated length, time, mass, and angular submodules,
including known-value conversions and proptest round-trips. -
Pressure units in
qtty-core::units::pressure(re-exported byqtty::pressure/
qtty::unit). Always available:Pascal(canonical SI unit),Hectopascal(hPa,
widely used in observatory site metadata),Millipascal,Kilopascal,Megapascal,
Gigapascal, andBar(= 10⁵ Pa). BidirectionalFromconversions and
cross-featurePartialEq/PartialOrdcover all pairs viapressure_units!.
Named constantsPASCAL,HECTOPASCAL,BAR, etc. for quick construction.
NewPressuredimension alias added toqtty-core::dimension. -
Temperature units in
qtty-core::units::temperature(re-exported by
qtty::temperature/qtty::unit). Always available:Kelvin(SI base unit, the
only linear-scale thermodynamic temperature unit provided — affine-offset scales
such as Celsius and Fahrenheit are intentionally omitted). Inventory macro
temperature_units!,TemperatureUnitmarker trait,KELVINconstant.
NewTemperaturedimension alias added toqtty-core::dimension. -
Photometry module (
qtty-core::units::photometry, behind thephotometry
feature, re-exported byqtty::photometry). Uses a deliberate newtype design (not
Quantity<U>) for logarithmic quantities where addition is not physically meaningful:Magnitude— stellar magnitude scale (more negative = brighter).SurfaceBrightness— magnitudes per square arcsecond.flux_to_magnitude(flux, zero_point)/magnitude_to_flux(mag, zero_point)—
typed conversion helpers.band_flux_to_surface_brightness(s10, zero_point)— converts S10 surface flux
density to aSurfaceBrightnessmagnitude.s10_to_surface_brightness(flux, zero_point)— typed variant accepting a typed
S10squantity and returningSurfaceBrightness; requiresradiometryfeature.
-
Angular wrap helpers on
Quantity<U>for anyU: AngularUnit:wrap_to_signed_pi()— folds any angle into(−π, +π](i.e.(−180°, +180°]).wrap_to_unsigned_pi()— folds any angle into[0, 2π)(i.e.[0°, 360°)).fold_to_pi()— folds any angle into[0, π](i.e.[0°, 180°]), useful for
unsigned angular separations.
-
Typed square root (
UnitSqrttrait,qtty-core):UnitSqrt— implemented automatically forProd<U, U>(a unit multiplied by
itself, i.e. a squared unit).Quantity<Prod<U, U>, S>::sqrt()— returnsQuantity<U, S>with the correct
halved dimension; the result type is inferred from the input unit, so no
annotation is needed at the call site.- Re-exported from
qttyasqtty::UnitSqrt.
-
Radiometry additions (extending the initial
radiometryfeature):PhotonPerSquareCentimeterNanosecondSteradian(ph·cm⁻²·ns⁻¹·sr⁻¹) photon
radiance unit, matching the NSB/darknsb pipeline output convention.spectral_radiance_to_photon_radiance_ns_nm(energy_radiance, lambda)— converts
SI spectral energy radiance (W·m⁻²·sr⁻¹·nm⁻¹) to spectral photon radiance
in the NSB/SkyCalc optical convention (ph·cm⁻²·ns⁻¹·sr⁻¹·nm⁻¹) using the
exact1 / (h · c)constant.
-
Solid-angle units in
qtty-core::units::solid_angle(re-exported by
qtty::solid_angle/qtty::unit). Always available:SquareDegree
(canonical),Steradian,SquareMilliradian. Behindastro:
SquareArcminute,SquareArcsecond. BidirectionalFromconversions and
cross-featurePartialEq/PartialOrdcover all pairs. New
SolidAngle = Dim<…, A=P2>dimension alias added toqtty-core::dimension. -
radiometryfeature (qtty-core, forwarded byqtty, implies
fundamental-physics) introducingqtty_core::units::radiometrywith:Radiance/SpectralRadiance/PhotonRadiance/
SpectralPhotonRadiance/InverseSolidAngledimension aliases.- SI and CGS unit markers:
WattPerSquareMeterSteradian,
ErgPerSecondSquareCentimeterSteradian, the per-metre / per-nanometre /
per-ångström spectral-radiance markers, and theph·…/ph·cm⁻²·s⁻¹·sr⁻¹,
ph·cm⁻²·ns⁻¹·sr⁻¹,ph·cm⁻²·s⁻¹·sr⁻¹·Å⁻¹,ph·cm⁻²·s⁻¹·sr⁻¹·nm⁻¹
photon-radiance markers. S10("10th-magnitude stars per square degree") onInverseSolidAngle,
matching the Leinert et al. zodiacal-light tables.erg_to_photon(spectral_energy_radiance, lambda)typed helper using the
exact1 / (h · c)constant≈ 5.034 × 10⁷ ph / (erg · Å).
Changed
-
qtty-ffifull linear unit coverage — the stable FFI registry now
exports every linear unit family exposed byqtty'sall-unitsfeature,
including pressure, solid angle, temperature, radiometry, photometric SI
units, frequency, chemistry, electrical, and density. Existing discriminants
remain stable; new dimensions were appended with explicitDimensionId
values 11 through 32 and new11xxxx–32xxxxdiscriminant ranges. -
qtty-ffienergy inventory parity — added the missingPicojoule,
Nanojoule,WattHour,KilowattHour,BritishThermalUnit, andTherm
FFI unit IDs so the ABI now matches the Rustenergymodule exactly. -
qtty-ffirelease line — ABI version now reports700
(qtty_ffi_version() == 700) for the0.7.0release. -
Breaking: corrected public SI aliases so
pressure::MPanow means
Megapascalinstead ofMillipascal; useMilliPafor millipascal. Also
added the expectedforce::MNalias forMeganewton. -
radiometrymodule now follows the standard qtty unit-module architecture:- Per-dimension marker traits (
RadianceUnit,SpectralRadianceUnit,
PhotonRadianceUnit,SpectralPhotonRadianceUnit,InverseSolidAngleUnit). - Per-dimension inventory macros (
radiance_units!,spectral_radiance_units!,
photon_radiance_units!,spectral_photon_radiance_units!,
inverse_solid_angle_units!) with bidirectionalFromconversions and
cross-unit-opsPartialEq/PartialOrdwithin each dimension group. - All 13 unit markers registered as
BuiltinUnitand covered by
assert_units_are_builtincompile-time drift checks. - Unit markers re-exported from
qtty::unit(e.g.qtty::unit::S10,
qtty::unit::WattPerSquareMeterSteradian); quantity aliases generated at the
qttycrate root (e.g.qtty::S10s,qtty::WattsPerSquareMeterSteradian)
when theradiometryfeature is enabled.
- Per-dimension marker traits (