Skip to content

0.3.3

Compare
Choose a tag to compare
@chiphogg chiphogg released this 01 Sep 17:39
· 130 commits to main since this release
eb615a6

Release Notes

User-facing library changes

Here are some of the most notable changes. We'll list potentially
breaking changes first, then give sections for a few highlighted
changes, and finally group the remaining changes together.

Potentially breaking changes:

  • Magnitude trait updates (#138)
    • numerator(m) and denominator(m) no longer apply only to
      the integer part; they now apply to "everything on top of
      (numerator) or below (denominator) the bar" when the
      magnitude is written as a fraction
    • To get the old behaviour, you can use the new integer_part
      trait: for example, writing numerator(integer_part(m)) to
      replace what would previously have been numerator(m)
  • Label for Fahrenheit changed from "F" to "degF" (#141)
  • Tightened up integer division safeguards: the new policy is to prevent
    this any time the denominator has units (even if the numerator is a
    raw number) (#142)

First official Windows support!

  • We found and fixed some compiler errors on several versions of MSVC
    (#146, #151)
  • Added CI jobs for Windows too (#151)

New, intent-based APIs for "forcing" unit conversions (#171)

  • coerce is a new vocabulary word which means "ignore safety checks
    for truncation and overflow". Before this, we used "explicit rep" to
    express this (e.g., the <int> in inches(24).as<int>(feet)). But
    now we can write inches(24).coerce_as(feet) to do the same thing.
    It's both clearer in its intent, and it doesn't force you to repeat
    the rep!
  • For now, we're providing only coerce_in and coerce_as member
    functions to complement in and as member functions, in both
    Quantity and QuantityPoint. Later on, we may add the "coerce"
    word to more APIs where it could be useful.
  • You can still provide an explicit rep if you want to control the rep
    of the result: for example, inches(25.8).coerce_as<int>(feet)
    produces feet(2).

Other Enhancements:

  • New function clamp(v, lo, hi): a unit-aware analogue of
    std::clamp() from C++17 (#165)
  • sqrt, cbrt, inverse, squared, and cubed can now be applied
    to dimensions and magnitudes, not just units (#136)
  • New trait integer_part(m) picks out the integer part of a magnitude
    (#138)
  • New rep-named aliases for int (QuantityI, QuantityPointI) and
    unsigned int (QuantityU, QuantityPointU) (#150)
  • Improved dimensionless unit support in our nholthaus library
    interoperation (#161)
  • Made "dangerous conversion" error messages less confusing (#158)
  • Enable compatibility with -Wconversion: Au will not add any
    violations (#166)
  • Made most unit traits compatible with unit slots (e.g., you can now
    write unit_ratio(micro(meters), inches)) (#168)

New units

Tooling updates

  • Fixed tools au-docs-serve, buildifier, and clang-format for
    people who do not use direnv, making the library much easier for
    everyone to start using (#148)

Documentation updates

This release had a major impact on documentation. Here are all of the
new and significantly updated docs, listed in their place in the
hierarchy:

  • Discussion
    • Generic Concepts (#135)
      • Arithmetic Operations (#135)
      • Common Units (#135)
      • Dimensionless Units and Quantities (#135)
      • Quantity Point (#135)
      • Zero (#135)
    • Au Idioms (#135)
  • How-to guides
    • Defining new dimensions (#153)
    • Inter-library Interoperation (#162)
      • nholthaus/units Interoperation (#162)
  • Reference
    • Corresponding Quantity (#135)
    • Math functions (#135)
    • Prefix (was a stub) (#135)
    • Quantity (was a stub) (#135)
    • QuantityPoint (was a stub) (#152)
    • Unit (some sections were stubs) (#135)
    • Zero (#135)

Additionally, we had the following documentation updates:

  • Documentation is now versioned, using
    mike (#132, #133)
  • Added CONTRIBUTING.md guidelines (#129)
    • Included style guide (#164)
  • Clarified our tiers of support for different compilers (#156)
  • We significantly refreshed our alternatives matrix: (#147)
    • Added the bernedom/SI library
    • Solicited input from units library authors
    • Added new rows to our comparison: "Unit-aware I/O", "Unit-aware
      math", "Linear algebra", and "Physical constants"
  • Refreshed troubleshooting page (#158, #172)
    • Added MSVC compiler errors (#163)

Repo updates

  • Added CI jobs for Windows (#151)
  • Renamed BUILD to BUILD.bazel, unblocking usage on case-insensitive
    filesystems such as MacOS (#170)
  • Added status badges (#154, #155)
  • Fixed security alerts:
    • Any file can be included with the pymdown-snippets extension
      (#134)
    • Unintended leak of Proxy-Authorization header in requests (#134)
    • Removal of e-Tugra root certificate (since withdrawn) (#159)

Closed Issues

Here are all of the issues that were closed between these releases.
(Note that the resolution is at the level of days, so some of these
issues might show up in the notes for more than one release.)

https://github.com/aurora-opensource/au/issues?q=is%3Aissue+closed%3A2023-03-20..2023-09-01

Contributors

Thanks to those who authored or reviewed PRs, or filed or participated
in Issues! Alphabetically: