Skip to content
Carlos Quiroz edited this page Nov 7, 2018 · 113 revisions

1.5.0-SNAPSHOT (Current Development)

This is the version for the current nightly build. It includes all work-in-progress since the last release version. It may include experimental and other features that are in a state of flux.

Changes merged:

1.4.0 (Current Release)

Nov 6, 2018

Changes merged:

  • Add support for {Gibi|Mebi|Kilo|etc}bits PR 304)
  • Inches of Mercury unit of Pressure PR 313)
  • Fix Quantity hashcode method. PR 307)
  • Added very large units of length: kpc, Mpc, Gpc PR 303)
  • Add ZAR and NAD to defaultCurrencySet PR 295)
  • Add currencies ZAR and NAD. Add MoneyContext.withAdditionalCurrencies PR 294)
  • Make Dimension.parseString/Tuple public PR 293)
  • Add units of measure: mm/s (velocity), mm/s^2 (acceleration), ng (mass) PR 280)
  • add power density, implement power method PR 297)
  • Electron volt as a length unit PR 294)
  • Add milliwatt hour energy unit (mWh) PR 284)
  • Mass electron volt PR 275)
  • add MolarEnergy, implement Energy unimplemented method PR 274)
  • Energy electron volt PR 273)
  • add ElectricFieldStrength, implement ElectricPotential unimplemented method PR 272)
  • Permeability PR 271)
  • Adds mass.AreaDensity UOM PoundsPerAcre PR 270)
  • add ElectricCurrentDensity and MagneticFieldStrength types PR 269)
  • Improvements to precision of Money operations (PR 268)
  • Added an implicit conversion from Dimensionless to Double to allow Dimensionless values to be used in places that require a Double (PR 267)
  • Added Permeability quantity (PR 271)
  • Add mm/s (velocity), mm/s^2 (acceleration), ng (mass) (PR 290)
  • Updates to support scala, scala.js and scala native versions

1.3.0 (Current Release)

May 20, 2017

Changes merged:

  • Added Parsecs unit (PR 208)
  • Added Solar radius, Nominal Solar radius, Solar Luminosity, and Solar Mass (PR 209)
  • Added Torrs and Standard Atmospheres pressure units (PR 210)
  • Improvements to Money (PR 217)
    • added Money.rounded method
    • modified Money.toString to return the full precision amount and currency code
    • fixed Money.toFormattedString to apply proper rounding
    • added Money.mapAmount method
    • added Currency.toString method
  • Added Quantity.rounded method (PR 217)
  • Stabilized toString output for MoneyContext and MoneyNumeric (PR 218)
  • Added *, /, per to squantified numbers to improve frequency support (PR 213)
  • Added rotational dynamics units (MomentOfInertia, AngularAcceleration, Torque) (PR 227)
  • Support scala-native (PR 238)
  • Added experimental UnitGroup (PR 234 and PR 235)
  • Added experimental Formatter (PR 240 and PR 244)
  • Improved documentation

Migration Notes

  • The behavior of the Money.toString method has changed. It will no longer round the amount to the decimal places defined in the Currency. It will use the full precision amount. If you need the amount rounded use the toFormattedString or the toString(uom: Currency, format: String) method. Another option is to first apply the rounded method before calling toString.

  • The behavior of the MoneyContext.toString and MoneyNumeric.toString have also changed. If you have user code that depends on these, please review the format of the new output and adjust your code.

Thanks to Doug Hurst and Philip Axelrod for their contributions.

1.2.0

Changes merged:

  • Make AngularVelocity a derivative of Angle (PR 173)
  • Fix typo in ElectricPotential: "mircoVolts" to "microVolts" (PR 175). Note this change technically breaks API backwards compatibility.
  • Properly parse temperatures written in scientific notation (PR 183)
  • Don't parse multiple degree symbols (°) in temperature (PR 190). Note this change technically breaks backwards compatibility for data parsing.
  • Support for AcreFeet volume unit ([PR 201] (https://github.com/typelevel/squants/pull/201))
  • Miscellaneous documentation and compiler warning fixes.

Thanks to Shadaj Laddad, Ian McIntosh, and Leif Wickland for their contributions.

1.1.0

Jan 9th, 2017

Changes merged:

  • Add Rankine to thermal package (PR 161)
  • Add ceil, floor, and rint to Quantity base class (PR 162)
  • Add Troy mass units (grain, pennyweight, ounce, pound), Carat and Tola (PR 164)
  • Add Stone mass unit (PR 166)

1.0.0

Dec 20, 2016

Changes merged:

  • Add [Money]/[Price] in place of [Price]*[Money] - NOTE the former still exists but is marked as deprecated.
  • Add Support for Scala 2.12.
  • Moved to the org.typelevel organization.

Thanks to Szabolcs Berecz and golem131 for their contributions.


0.6.2

May 10, 2016

Changes merged:

  • Addition of Information and DataRate dimensions
  • Integration with Scala.js
  • Improvements to Vectors including
    • add map methods
    • add angle and polar methods for extracting the polar coordinates
    • rename to SVector with a factory methods for Double and Quantity based Vectors
    • better typing and dimensional conversions
  • Addition of Quantity.map useful for mapping over underlying value without changing the type or units
  • Addition of Time unit Nanoseconds
  • Improve conversions to and from Time and scala.concurrent.Duration to preserve units
  • Addition of Velocity unit KilometersPerSecond
  • Fixed an issue with the KilometersPerHour unit
  • Added ability to initialize Quantities from strings in exponential format
  • Addition of Area.squareRoot and Volume.cubeRoot, each returning a Length
  • Addition of Length unit Angstroms
  • Addition of Energy unit Ergs
  • Addition of Power unit ErgsPerSecond
  • Update of INR currency symbol to
  • Working prototype of generic number support (in squants.experimental in the test code)
  • Add GitHub source code links to scaladocs
  • Addition of AreaDensity units GramsPerSquareCentimeter and KilogramsPerHectare
  • Removed bogus conversion Irradiance / Power -> Area
  • Addition of SpectralIrradiance dimension
  • Addition of Irradiance unit ErgsPerSecondPerSquareCentimeter
  • Addition of support for OSGi

Thanks to Derek Morr, Rmihael, Florian Nussberger, Ajay Chandran, Gia Bảo, Josh Lemer, Dave DeCaprio and Carlos Quiroz for their contributions.

Migration Notes

With the integration of Scala.js, the library needed to be broken down into a few sub projects. This requires a slight change to how the console needs to be loaded. The correct command is now:

sbt squantsJVM/console

Vector has been renamed to SVector and now provides the factory methods for both Quantity and Double based vectors. User code that creates vectors should be modified to use this factory. The improvements to Vectors also removed the various experiments for dimensional conversion. These improvements are significant but still contain experimental API features which are subject to change.

The support for generic numbers will exist only in test code for the project until we move on to 0.7.x development. Prior to that change, a 0.6.x release will be cut that will based on the old (Double) model. The goal will be to fully implement this feature during 0.7.x development.

The new dimension Information was originally called Storage.


0.5.3

June 11, 2015

Changes merged:

  • Enhance Quantity model to preserve the unit used in creating the value
  • Rename UnitMultiplier trait to UnitConverter, the multiplier field to conversionFactor, and set access level of all fields to protected (see Migration notes)
  • Rename QuantityCompanion to Dimension
  • Rename Quantity.valueUnit to unit
  • Rename MassFlowRate to MassFlow
  • Rename VolumeFlowRate to VolumeFlow
  • Add dimension value to Quantity
  • Improvements to TimeIntegral and TimeDerivative traits
  • Addition of TimeSquared, an intermediate non-quantity value, and SecondTimeDerivative, SecondTimeIntegral traits, all in support of second order time derivatives conversions.
  • Addition of Acceleration.analyze() method - a candidate for a generic SecondTimeDerivative feature.
  • Addition of KineticEnergy method which takes Mass and Velocity and applies the conversion (Mass, Velocity) => 1/2(Mass * Velocity * Velocity) yielding an Energy value.
  • Addition of KineticEnergy method which takes Mass and Momentum and applies the conversion (Mass, Momentum) => Momentum / (2 * Mass), yielding an Energy value.
  • Addition of Mass units Kilopounds and Megapounds
  • Addition of PowerRamp units WattsPerMinute and KilowattsPerMinutes
  • Addition of MassFlow units PoundsPerSecond, PoundsPerHour, KilopoundsPerHour and MegapoundsPerHour
  • Addition of VolumeFlow unit CubicFeetPerHour
  • Addition of Dimensionless unit Percent
  • Normalize Temperature model
  • Enhance to UnitOfMeasure model to include primaryUnit and siUnit
  • Simplify Json Serializers in experimental.test
  • Removed redundant toString methods from a few classes
  • Update Length/Area/Volume operations to be unit-sensitive
  • Rename CubicMiles to CubicUsMiles
  • Modify constants to use Exp notation where appropriate
  • Update Scala versions to 2.11.6 and 2.10.5
  • Add support for converting Quantity values to a Tuple2 and initializing a Quantity from a Tuple.
  • Addition of PressureChange dimension
  • Correction of Bars / Pascals conversion factor

Thanks to Steve Barham for his contributions.

Migration Notes

The change from UnitMultipler/multiplier -> UnitConverter/conversionFactor will only affect user code where new Quantity or UnitOfMeasure types have been created. That code should only need to be updated to reflect the new names. Code that only uses built-in quantities and units should not be affected.

Modifications to the TimeIntegral and TimeDerivative hide the previously visible change and time fields, which are generally not useful in user code, but may affect Quantity implementations. In addition the TimeIntegral./() implementations have been replaced by a standard implementation within the trait.

The ElementaryConstant value has been moved to the electro package.

The renaming of Dimension, MassFlow, VolumeFlow, and CubicUsMiles may require user code to be updated.

The update to the Quantity model - to preserve the unit used when creating, and rename valueUnit->unit - may affect some users that were accessing the valueUnit directly. Which should generally not be used directly access by user code. This will affect user code used to create new Dimensions, Quantities and Units.


0.4.2

July 6, 2014

Changes merged:

Improvements to Market
  • Add Price.in method for directly converting a price to a different currency
  • Add Price.toString(unit) method to support formatting in a specific unit
  • Add Money.toString overload to support formatting in a different currency
  • Refactor Currencies to be objects rather than vals (no change in usage)
  • Add Currency./ method for creating exchange rates
  • Add MoneyNumeric
  • Add Comparisons for cross-currency Money values (==#, !=#, <#, <=#, >#, >=#)
Other General Improvements
  • Add Quantity.toString overload that supports standard number formatting (ie, "%3.2f")
  • Add as another approx operator
  • Add SquantifiedBigDecimal, remove SquantifiedNumeric
  • Factor out common data and behavior to new QuantityCompanion trait - implemented for all data types except Money which currently requires special handling
  • Implement String => Quantity parsing conversions returning Try[Quantity] for all existing types (see Migration Notes below)
  • Additional Units:
    • ElectricCharge: MilliampereHours, MilliampereSeconds
  • Add unapply to UnitOfMeasure trait and deprecate existing extractors in its favor
  • Json Serialization - experimental, test code only
  • Generic Quantity Value - experimental, test code only
  • Add support for Scala cross-version builds (2.10 and 2.11) with 2.11.1 as the default
Bug fixes
  • Fixed SquareInches.symbol

Migration Note

Quantity String Parsing

String parsers no longer return Either[String, Q] but will return a Try[Q] instead (where Q is the specific quantity type). For example, Mass("10 kg") will return a Try[Mass].

On failure the Try.failed will contain a QuantityStringParseException which includes the original string to be parsed. This could be used to recover using an alternative parser.

Quantity Value Model Unification

Quantity types implemented as case classes which stored the ratio components of their value (i.e. Velocity(length, time)) have been refactored to have a single underlying value.

This reduction of all types to a single underlying value has resulted in some loss of precision - reflected in the use of more "approximately equal to" tests. However, this change is a precursor to future work that will support far better precision.

Temperature and Money remain as exceptions to the prevailing model.


0.3.3

April 22, 2014

Changes merged:

  • Add the approx method and corresponding =~ and ~= operators
  • Refactor equals implementation to support proper comparisons with null values
  • Add conversions for all Quantity types to console initialCommands.
  • Improvements to Money
  • UnitOfMeasure simplification
  • Vectors (experimental)
  • Additional Units
    • Length: Nanometers
    • Volume: Nanolitres, Microlitres, Centilitres, Decilitres, Hectolitres
    • Energy: Picojoules, Nanojoules, Microjoules, Millijoules, Kilojoules, Megajoules, Gigajoules, Terajoules
    • Money: MYR
  • Arbitrary Numeric type support for Quantity factory methods - All Quantity factory methods will accept arbitrary numeric types for initial values. In the current iteration these values will be converted to a Double within the Quantity object. Nevertheless, this is an important first step to supporting arbitrary numeric types for the underlying value as well.

Thanks to Jeremy Apthorp for his contributions.

Migration Note - The unit Milliliters has been renamed to Millilitres, which may require a change to user code. Implicit conversions are available for both spellings.


0.2.3

April 6, 2014

This is the first "pre-release" version. It includes many features

Changes merged:

  • Over 50 Quantity Types
  • Over 180 Units of Measure
  • Support for Money, Prices, and Foreign Exchange
  • Quantity Ranges
  • Natural Language DSL