Skip to content

Latest commit

 

History

History
161 lines (143 loc) · 9.3 KB

CHANGELOG.md

File metadata and controls

161 lines (143 loc) · 9.3 KB

Change log

v0.16.0 - 2017-12-21

This release contains significant changes in order to support underlying storage types that implement the Num trait beyond f32 and f64. Many changes are breaking: marker traits are simplified and fewer macros are exported. New storage types are not enabled by default and can be used by including the corresponding feature. See the changes below for full details.

Added

  • Add missing #[derive(Hash)] attributes.
  • #29 A new macro, storage_types!, is now available to duplicate code on a per-storage type basis. See macro documentation for full details. The minimum supported rustc version is now 1.20.0.

Changed

  • #29 Underlying storage type now uses the Num trait from the num crate instead of fixed implementations for f32 and f64. Features for all types implementing Num have been added and control the availability of the type as an underlying storage type: usize, u8, u16, u32, u64, isize, i8, i16, i32, i64, bigint, biguint, rational, rational32, rational64, bigrational, f32, and f64. For compile time reasons only f32 and f64 are enabled by default. Tests are implemented for all underlying storage types but don't account for minimum or maximum values and will fail for non-float types where the conversion factor overflows the type's limits. A future release will correct this.
  • #29 [Breaking] Traits and structs generated by the system! macro have been significantly changed in order to support non-float underlying storage types.
    • Dimension changed to directly include associated types for quantity dimensions.
    • Units<V> is now only parameterized on V and contains associated types for base units.
    • Conversion<V> has been removed and replaced with uom::Conversion<V>.
    • $quantities<...> has been removed. Quantity dimensions are now directly in the Dimension trait.
    • BaseUnits<...> has been removed. Base units are not directly in the Units<V> trait.
    • uom::Conversion<V> added to replace Conversion<V> and gives access to a unit's conversion factor.
    • uom::ConversionFactor<V> added to represent conversion factors for underlying storage types where the type can't be used (e.g. i32's conversion factor is represented as Rational32.)
  • [Breaking] Macro usage and definitions have been simplified and consolidated. quantities!, replace_ty!, and unit! have been consolidated as "private" match arms of their calling macro. In order to reduce the chance of macro name collisions $quantities! is the only remaining generated exported macro (e.g. ISQ! for the si system). Generated macros for each quantity no longer exist. These changes make it easier to have multiple systems containing quantities with the same names. In order to support this change quantities in the units block of the system! macro must always be prefixed by the quantity's module (e.g. length::Length). Prefixing the module with the mod keyword instructs the system! macro not to generate a #[macro_use] pub mod $module; statement.

v0.15.0 — 2017-07-05

This release adds additional Time units; Frequency, Force, and Volume quantities; and numerous floating point methods such as min, max, and powi.

Added

  • #4 Additional Time units added.
  • Add missing giga units. e.g. gigameter.
  • #11 Add floating point classification methods classify, is_finite, is_infinte, is_nan, and is_normal for Quantity.
  • #11 Add floating point fractional methods floor, ceil, round, trunc, and fract for Quantity.
  • #11 Add floating point comparison methods max and min for Quantity.
  • #11 Add floating point mul_add method for Quantity.
  • #11 Add floating point powi method for Quantity.
  • #7 Volume quantity added. Additional units still need to be added.
  • #8 Force quantity added. Additional units still need to be added.
  • #30 Frequency quantity added. Additional units still need to be added.

v0.14.0 — 2017-05-30

Added

  • [Breaking] A new feature, std, is now available and is enabled by default. uom can still be compiled with no_std by using --no-default-features when compiling the crate or default-features = false in the dependencies section of Cargo.toml
  • #11 cbrt, recip, and sqrt are implemented for Quantity.

Changed

  • #28 Quantity fields made public in order to allow library users to create const values and instances of non-named quantities. e.g. const TIME_STEP: Time = Quantity { dimension: PhantomData, units: PhantomData, value: 0.1 }; This functionality will be deprecated and subsequently removed once the const fn feature is stabilized.
  • Tests now run for all enabled underlying storage types (f32, f64).

Fixed

  • Fixed incorrect conversion factor when multiplying or dividing Quantitys with different base units.

v0.13.0 — 2017-04-20

This release adds numerous tests both for code generated by the quantity!, system!, and $quantities! macros as well as derived quantities. Fixes for issues found during testing noted below. Quantity implementations for Area and Acceleration also added.

Added

  • #6 Area quantity added. Additional units still need to be added.
  • #9 Acceleration quantity added. Additional units still need to be added.

Changed

  • [Breaking] Remove the unused _unit parameter from Quantity::new and so summon the turbofish. e.g. Length::new(1.0, meter) becomes Length::new::<meter>(1.0).
  • #22 Change impl Debug for Quantity to use precision information. Previously the implementation checked the alternate flag which has no affect on printing raw floats.
  • #27 Change superscripts in documentation to the format supported by pulldown in anticipation of upcomming rustdoc changes.

Fixed

  • #22 Fix impl Sub for Quantity to be implemented in terms of - instead of +.

v0.12.0 — 2017-04-01

Continuous integration was setup to ensure that uom builds on stable, beta, nightly, and 1.15.0 (the minimum rustc version). Quantity descriptions, unit abbreviations, and unit descriptions added. Additional length units added to demonstrate the simplicity of the process.

Added

  • #1 Additional Length units added.
  • [Breaking] The quantity! macro accepts comments on units. To resolve macro parsing ambiguities each unit must be prefixed with an @.
  • #19 [Breaking] The quantity! macro includes the quantity description. The description can be accessed using the description() method in quantity submodules.
  • #19 [Breaking] The quantity! macro includes unit abbreviations as well as singular and plural descriptions. These values can be accessed from new abbreviation(), singular(), and plural() methods on the Unit trait. The original Unit<V> trait has been renamed Conversion<V>.
  • #12 Debug manually implemented for Quantity<D, U, V> to show the underlying value and associated units.
  • Test and compile-fail test modules setup. compile-fail tests for mismatched quantities and units added.

v0.11.0 — 2017-02-26

Proof-of-concept functionality for type-safe zero-cost dimensional analysis. uom [0.11.0] allows for the creation of custom systems or the use of the pre-built SI. Basic mathematical operations are implemented and a minimal set of quantities (length, mass, time...) and units (meter, kilometer, foot, mile, ...) are included.