uom

Units of measurement -- type-safe zero-cost dimensional analysis

APACHE-2.0 License

Downloads
2.7M
Stars
1K
Committers
41
uom - v0.36.0 Latest Release

Published by iliekturtles 7 months ago

This release adds new quantities, new units, bumps the MSRV (minimum supported Rust version) to 1.65.0, and fixes bitrot in Github actions.

Many thanks to Aehmlo, Code-Maniac, baarkerlounger, g1aeder, hellow554, igiona, waywardmonkeys, and yacinelakel for pull requests included and issues resolved in this release.

Added

  • #429 Add minute_per_kilometer unit to InverseVelocity.
  • #436 Add explicit serde feature. The new serde feature deprecates the old use_serde feature which is now an alias for serde and will be removed in a future uom release.
  • #446 Add ArealHeatCapacity quantity.
  • #450 Add ThermalResistance quantity.

Changed

  • #425 Clarify Conversion documentation for converting to and from the base unit.
  • #432 Use Cargo.toml rust-version key to identify the MSRV (minimum supported Rust version).
  • #445 Update basic example with example code to do unit conversions.
  • #456 Commit Cargo.lock to pin certain crates to specific versions that support uom's MSRV (minimum supported Rust version).
  • #459 Increase MSRV (minimum supported Rust version) to 1.65.0. No changes in this release require the new MSRV.
  • #457 Update github checkout and cache actions to v4.
  • #459 Rust 1.76.0 is now used for rustfmt, clippy, and tarpaulin jobs.
  • #443, #459 Resolve numerous rustc and clippy warnings.
uom - v0.35.0

Published by iliekturtles over 1 year ago

This release adds new quantities, bumps the MSRV (minimum supported Rust version) to 1.60.0, and
fixes bitrot in Github actions.

Many thanks to calbaker, groscoe2, professoralex13, robinohs, and Uzaaft for pull requests included and issues resolved in this release.

Added

  • #406 Add cubic_meter_per_minute and cubic_meter_per_hour units to VolumeRate.
  • #409 Add AngularAbsement quantity.
  • #410 Add MassPerEnergy quantity.
  • #417 [Breaking] Correct ThermalConductance meter_per units to be meter_squared_per. Descriptions and abbreviations were already correct.
  • #419 Add PowerRate quantity.
  • #420 Add InverseVelocity quantity.

Changed

  • #314 Update Github actions to use dtolnay/rust-toolchain. actions-rs is no longer maintained.
  • #387 Increase MSRV (minimum supported Rust version) to 1.60.0. No changes in this release require the new MSRV.

Fixed

  • Fix unnecessary qualifications warnings in quantity tests.
uom - v0.34.0

Published by iliekturtles over 1 year ago

This release adds a significant number of new quantities and units as well as a few minor fixes.

Many thanks to adamreichold, calbaker, Eagle941, jossriLDR, swaits, Uzaaft werdahias, and zdimension for pull requests included and issues resolved in this release. Special thanks to crystal-growth for the thirty nine pull requests included in this release.

Added

  • #318 Add particle units to AmountOfSubstance, CatalyticActivity, CatalyticActivityConcentration, MolarConcentration, MolarEnergy, and MolarHeatCapacity quantities.
  • #319 Add MolarFlux quantity.
  • #322 Add DiffusionCoefficient quantity.
  • #323 Add DynamicViscosity quantity.
  • #324 Add atomic units of energy, mass, length, electric charge, and current.
  • #325 Add Action quantity.
  • #326 Add ElectricField quantity.
  • #327 Add ElectricDipoleMoment and ElectricQuadrupoleMoment quantities.
  • #329 Add ElectricalMobility quantity.
  • #330 Add ElectricalResistivity quantity.
  • #331 Add ElectricalConductivity quantity.
  • #332 Add ElectricPermittivity quantity.
  • #333 Add ElectricCurrentDensity quantity.
  • #334 Add ArealNumberDensity, LinearNumberDensity, and VolumetricNumberDensity quantities.
  • #335 Add ReciprocalLength quantity.
  • #336 Add MassFlux quantity.
  • #337 Add MagneticPermeability quantity.
  • #339 Add ArealNumberRate, LinearNumberRate, and VolumetricNumberRate quantities.
  • #341 Add ArealMassDensity, LinearMassDensity, and VolumetricMassDensity quantities.
  • #342 Add SurfaceElectricCurrentDensity quantity.
  • #343 Add MagneticMoment quantity.
  • #344 Add ElectricChargeArealDensity, ElectricChargeLinearDensity, and ElectricChargeVolumetricDensity quantities.
  • #345 Add ElectricDisplacementField quantity.
  • #346 Add MagneticFieldStrength quantity.
  • #347 Add MolarVolume quantity.
  • #348 Add ElectricFlux quantity.
  • #349 Add TemperatureGradient quantity.
  • #350 Add LinearPowerDensity and VolumetricPowerDensity quantities as well as additional HeatFluxDensity units.
  • #351 Add standard_gravity unit to Acceleration.
  • #352 Add SpecificArea and SpecificVolume quantities.
  • #353 Add boltzmann_constant unit to HeatCapacity and molar_gas_constant unit to MolarHeatCapacity.
  • #354 Add TemperatureCoefficient quantity.
  • #355 Add ArealDensityOfStates, LinearDensityOfStates, and VolumetricDensityOfStates quantities.
  • #356 Add MomentOfInertia quantity.
  • #358 Add molar flow rate units to AmountOfSubstance and CatalyticActivity.
  • #361 Add atomic_unit_of_velocity, natural_unit_of_velocity and speed_of_light_in_vacuum units to Velocity.
  • #368 Add quantities for Radioactivity, MolarRadioactivity, and SpecificRadioactivity as well as additional VolumetricNumberRate units.
  • #369 Add VolumetricHeatCapacity quantity as well as additional HeatCapacity and SpecificHeatCapacity units.
  • #370 Add Molality quantity.
  • #388 Add FrequencyDrift quantity.
  • #396 Add SpecificPower quantity.
  • #399 Add liter per minute unit to VolumeRate and newton per square millimeter unit to Pressure.
  • #405 Add ton_per_minute, ton_per_hour, and ton_per_day units to MassRate.
  • #408 Add ThermalConductance quantity.

Fixed

  • #383 Fix typos in past release notes.
  • #392 Disable certain Area and Volume tests on ARM CPUs until floating point behavior issues can be resolved.
  • #393 Fix typo in the spelling of millijoule.
  • Correct volume rate unit tests.
uom - v0.33.0

Published by iliekturtles over 2 years ago

This release adds one new quantity, Absement. Two new underlying storage types, Complex32 and Complex64. Eight new exponential and logarithmic functions on Ratio and changes to use #[must_use] and #[non_exhaustive].

Many thanks to adamreichold, gonzaponte, jacg, nick-pascucci-spire, and TobTobXX for pull requests included and issues resolved in this release.

Added

  • #284, #285 Absement quantity added.
  • #287 Add support for Complex32 and Complex64 as underlying storage types.
  • #290 Implement exp2, exp_m1, exp, ln_1p, ln, log10, log2, and log for Ratio.
  • #306 Add missing #[must_use] on all methods returning a value. must_use_candidate and return_self_not_must_use clippy lints are now enabled to ensure future methods include the attribute.

Changed

  • #272 Improve documentation on how to enable serde for big* and rational* underlying storage types.
  • Enable #[non_exhaustive] on Units enums. The #[doc(hidden)] __nonexhaustive trick is not longer used.
uom - v0.32.0

Published by iliekturtles almost 3 years ago

This release adds one new quantity, MolarHeatCapacity, a new trait, ConstZero, and many internal improvements. The quickcheck 1.0 update uncovered a number of issues with floating point precision that were able to be resolved while still maintaining zero-cost guarantees.

Many thanks to adamreichold, B-Reif, remilauzier, and T-Bakker for pull requests included and issues resolved in this release.

Added

  • #250 Add ConstZero trait which is implemented by Quantity.
  • #263 MolarHeatCapacity quantity added.

Changed

  • #258 Use RUSTFLAGS="-D warnings" in CI to ensure that rustc warnings and caught and fail their respective workflows.
  • [Breaking] Rename Conversion::into_conversion to Conversion::conversion. Name change resolves Clippy wrong_self_convention warnings.
  • #260 Increase minimum supported rustc version to 1.43.0. Required to support quickcheck 1.0.
  • #260 Update to quickcheck 1.0. Change required the MSRV update as well as refactoring from_base, to_base, and multiple tests. The from_base and to_base changes provide better floating point precision while still maintaining zero-cost guarantees. The test changes better handle floating point precision issues as well as the wider range of values generated by quickcheck 1.0's Arbitrary implementation.
  • #268 Clarify powi documentation.

Deprecated

  • #260 Deprecate try-from feature. The feature will be removed in a future release of uom. Functionality previously exposed by the feature is now enabled by default.

Fixed

  • #252 Fix links within the documentation to use https. Many previously used http and were broken.
  • #260 Fix TryFrom<Duration> for Time<U, V>. Previously the conversion used the Duration's subsecond microseconds as nanoseconds. The conversion now correct uses the subsecond nanoseconds.
uom - v0.31.1

Published by iliekturtles over 3 years ago

This release corrects documentation issues and documents fewer underlying storage types on docs.rs so that container time and memory limits are not exceeded.

Added

  • #241 Run rustdoc as part of tool checks and resolve previously ignored warnings.

Changed

  • #241 Document fewer underlying storage types on docs.rs so that container time and memory limits are not exceeded. Previous releases documented all features and caused documentation to fail to build.
uom - v0.31.0

Published by iliekturtles almost 4 years ago

This release adds a new macro, unit!, to allow for units to be defined outside of the quantity! macro as well as a Units enum for each quantity. A number of standard library traits are implemented. Build regressions caused by issues with the CI system and changes in Rust are now fixed.

Many thanks to bheisler, CreepySkeleton, DusterTheFirst, Lucretiel, and neoeinstein for pull requests included and issues resolved in this release.

Added

  • #173 Allow new units to be defined using unit! outside of quantity!. When using the pre-built SI system included with uom this macro allows for new units to quickly be defined without requiring a release. Pull requests to add new units upstream area always greatly appreciated.
  • #215 Add Units enum and fn units() -> impl Iterator<Item = Units> function for each quantity.
  • #227 Ensure UnwindSafe and RefUnwindSafe are implemented.
  • #217 Add trait implementations for Display and Error to ParseQuantityError.

Changed

  • #214 The FromStr implementation for quantities now supports the unit singular and plural descriptions in addition to the unit abbreviation.
  • #225 Convert CI to use Github Actions. This change fixes a number of problems with the old system and greatly improves build times.
  • #223 Correct build regressions introduced while no test job was run with the old CI system.
uom - v0.30.0

Published by iliekturtles about 4 years ago

This release adds a new quantity, RadiantExposure, implements Unpin for Quantity and upgrades uom to the 2018 edition. These changes also include an increase of the minimum supported rustc to 1.37.0. Many thanks to nicodemus26 and (Michael-F-Bryan)[https://github.com/Michael-F-Bryan] for pull requests included and issues resolved in this release.

Added

  • #202 RadiantExposure quantity added.
  • #204 Implement Unpin for Quantity.

Changed

  • #206 Upgrade uom to compile using the 2018 edition. Generated code still supports both the 2015 and 2018 edition.
  • #207 Increase minimum supported rustc version to 1.37.0. Required to support upgrading to the latest dependencies and to allow for the Kleene ? "at most one" repetition operator.
uom - v0.29.0

Published by iliekturtles about 4 years ago

This release includes a number of changes for Angle, the addition of SolidAngle, and a new units for Energy and Luminance. Many thanks to adamreichold, AnickaBurova, and Atmelfan for pull requests included and issues resolved in this release.

Added

  • #196 SolidAngle quantity added.
  • #191 Add constants to Angle and SolidAngle representing half and full turns.
  • #194 Add foot-candle unit to Luminance.
  • #200 electronvolt-based Energy units added.

Changed

  • #192 Use f{32|64}::powi instead of Typenum::Pow::powi.
  • #123 Change examples to use Display instead of Debug.

Removed

  • #188 [Breaking] Remove From/Into impls for Angle and SolidAngle.
uom -

Published by iliekturtles over 4 years ago

This release adds a number of thermodynamic quantities in addition to TryFrom implementations for Time and trigonometric functions on Angle.

Added

  • #164 HeatFluxDensity quantity added.
  • #155 HeatCapacity, HeatTransfer, MolarEnergy, MolarMass, SpecificHeatCapacity, ThermalConductivity quantities added.
  • #150 TryFrom implemented between std::time::Duration and uom::si::Time.
  • #151 Trigonometric functions added to Angle.

Changed

  • Increase minimum supported rustc version to 1.31.0. Required to because of backwards incompatibilities with Cargo.toml edition keyword. cfg-if introducted the keyword in a minor version update and other issues with the keyword prompted the update.
uom -

Published by iliekturtles over 4 years ago

This release adds a number of quantities.

Added

  • #167 CatalyticActivity, CatalyticActivityConcentration, MassConcentration, and MolarConcentration quantities added.
  • #175 Curvature quantity added.
uom - v0.28.0

Published by iliekturtles over 4 years ago

This request includes a number of trigonometric improvements as well as new units for Time. Many thanks to adamreichold and Aehmlo for pull requests included and issues resolved in this release.

Added

  • #182 Add inverse trigonometric functions to Ratio (acos, acosh, asin, asinh, atan, atanh) and Angle (atan2).
  • #184 Tropical and sidereal units added to Time.

Changed

  • #186 Make hypot available for all quantities, not just Length.
  • #187 [Breaking] Change trigonometric functions to return Ratio instead of the underlying storage type so that identities like x.sin().asin() == x are well-typed.
uom - v0.25.0

Published by iliekturtles about 5 years ago

This release includes the long-requested Information and InformationRate quantities as well as support for i128/u128 as underlying storage types. A number of documentation updates, including for the 9th edition of the SI, are also included.

Added

  • #31 Information (bit, byte, ...) and InformationRate (bit/s, byte/s, ...) quantities added. Units for both SI (kilo, mega, ...) and binary (kibi, mebi, ...) prefixes are included.
  • #85 Add support for i128 and u128 as underlying storage types.
  • #160 AngularJerk quantity added.

Changed

  • #20 Document generic parameters.
  • #21 Move links inline for trait methods to work around documentation generation bug.
  • #111 Update documentation for SI base units for the 9th edition of the SI.
  • #127 Remove superscripts for power 1 to keep all SI documentation consistent.
uom - v0.24.0

Published by iliekturtles over 5 years ago

This release fixes two separate issues to ensure that zero-cost code is generated. Many thanks to raimundomartins, apopiak, and gnzlbg for pull requests included and issues resolved in this release.

Added

  • #145 Add #[repr(transparent)] to Quantity to ensure that the ABI of the underlying storage type is used instead of struct ABI in FFI contexts.

Changed

  • #148 Increase minimum supported rustc version to 1.28.0. Required to support #[repr(transparent)].

Fixed

  • #143 Correct to_base and from_base to be zero-cost for float storage types.
  • #147 Correct typos in README and crate-level documentation.
uom -

Published by iliekturtles over 5 years ago

This release fixes an issue with the autoconvert feature introduced in v0.23.0. Many thanks to dmit for pull requests included in this release.

Fixed

  • #141 From implementations to convert between quantities of different kinds now correctly use the autoconvert feature and no longer cause a compile error when the feature is disabled.
uom - v.23.0

Published by iliekturtles over 5 years ago

This release adds three new quantities, AngularAcceleration, AngularVelocity, and Torque. Changes to make Kinds more ergonomic to use are also included along with documentation changes. Many thanks to dunmatt and Aehmlo for pull requests included in this release.

Added

  • #136 AngularAcceleration quantity added.
  • #135 AngularVelocity quantity added.
  • #117 Torque quantity added.
  • Introduce AngleKind and si::marker to hold SI specific marker traits. From implementations for AngleKind added to more easily convert between uom::Kind and si::marker::AngleKind.
  • Allow documentation to be specified for base quantities in the system! macro. Documentation for the seven base SI quantities added.

Changed

  • #138 Maintain kind when multiplying a number by a quantity. Multiplying a quantity by a number already maintains kind.
  • #130 Rename Density to MassDensity. A type alias for Density is available for backwards compatibility.
  • #127 Make all SI quantity documentation follow a single, consistent format.

Deprecated

  • #130 Density has been renamed to MassDensity and is deprecated. Density will be removed in some future release.
uom - v0.22.2

Published by iliekturtles over 5 years ago

This release adds Angle and Jerk quantities along with unit additions and conversion precision improvements to Acceleration and Velocity. Many thanks to dunmatt and nicodemus26 respectively.

Added

  • #89 Angle quantity added.
  • #128 Jerk quantity added. Acceleration and Velocity units added and precision for some existing units improved.

Changed

  • Continuous integration setup updated and improved.
    • Rust 1.34.0 is now used for rustfmt, clippy, and tarpaulin jobs.
    • rustfmt configuration updated.
    • clippy configuration corrected to run for all packages.
uom - v0.22.1

Published by iliekturtles over 5 years ago

This release adds additional liter-based VolumeRate units.

Added

  • #121 Liter-based VolumeRate units added.
uom - v0.22.0

Published by iliekturtles over 5 years ago

This release adds the Momentum quantity and additional liter-based volume units.

Added

  • #114 Momentum quantity added.
  • #116 Liter-based volume units added.

Changed

  • Continuous integration setup updated and improved.
    • Rust 1.33.0 is now used for rustfmt, clippy, and tarpaulin jobs.
    • The deny warnings job is joined into the clippy job.
    • The stable + tests job has been updated to catch errors with non-default underlying storage types in SI quantity tests.

Fixed

  • #119 Macros corrected to generate valid code for both 2015 and 2018 editions. Previously the doc test on the $quantities! macro would fail in a Rust 2018 crate. A new test crate, edition_check, was added to ensure uom remains usable in Rust 2018 code.
uom - v0.21.1

Published by iliekturtles over 5 years ago

This release adds a few new units for ElectricCharge and Energy.

Added

  • #112 Additional ElectricCharge and Energy units added.
Package Rankings
Top 6.13% on Proxy.golang.org
Top 3.52% on Crates.io
Badges
Extracted from project README
Github Actions Codecov.io Rustup.rs Crates.io Crates.io Documentation