Releases: typelevel/squants
Release 1.1.0
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)
Release 1.0.0
Dec 20, 2016
- Add
money / pricein place ofprice * money - Update to Scala 2.12.1
- Update to Scala.js 0.6.13
- Use zero decimal places for JPY and KRW
Thanks to Derek Morr, Gary Keorkunian and Szabolcs Berecz for their contributions.
On release 1.0.0 squants has moved to the org.typelevel organization and got new commiters and administrators to keep the project moving forward.
Migration Notes
- Update the dependency organization from
com.squantstoorg.typelevelas
"org.typelevel" %% "squants" % "1.0.0"
Release 0.6.2
May 10, 2016
- Addition of
InformationandDataRatedimensions - Integration with Scala.js
- Improvements to Vectors including
- add
mapmethods - add
angleandpolarmethods for extracting the polar coordinates - rename to
SVectorwith a factory methods for Double and Quantity based Vectors - better typing and dimensional conversions
- add
- Addition of
Quantity.mapuseful for mapping over underlying value without changing the type or units - Addition of
TimeunitNanoseconds - Improve conversions to and from
Timeandscala.concurrent.Durationto preserve units - Addition of
VelocityunitKilometersPerSecond - Fixed an issue with the
KilometersPerHourunit - Added ability to initialize Quantities from strings in exponential format
- Addition of
Area.squareRootandVolume.cubeRoot, each returning a Length - Addition of
LengthunitAngstroms - Addition of
EnergyunitErgs - Addition of
PowerunitErgsPerSecond - Update of INR currency symbol to
₹ - Working prototype of generic number support (in
squants.experimentalin the test code) - Add GitHub source code links to scaladocs
- Addition of
AreaDensityunitsGramsPerSquareCentimeterandKilogramsPerHectare - Removed bogus conversion
Irradiance/Power->Area - Addition of
SpectralIrradiancedimension - Addition of
IrradianceunitErgsPerSecondPerSquareCentimeter - 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.
Release 0.5.3
June 11, 2015
- Enhance Quantity model to preserve the unit used in creating the value
- Rename
UnitMultipliertrait toUnitConverter, themultiplierfield toconversionFactor, and set access level of all fields to protected (see Migration notes) - Rename
QuantityCompaniontoDimension - Rename
Quantity.valueUnittounit - Rename
MassFlowRatetoMassFlow - Rename
VolumeFlowRatetoVolumeFlow - Add
dimensionvalue to Quantity - Improvements to
TimeIntegralandTimeDerivativetraits - Addition of
TimeSquared, an intermediate non-quantity value, andSecondTimeDerivative,SecondTimeIntegraltraits, all in support of second order time derivatives conversions. - Addition of
Acceleration.analyze()method - a candidate for a generic SecondTimeDerivative feature. - Addition of
KineticEnergymethod which takesMassandVelocityand applies the conversion (Mass, Velocity) => 1/2(Mass * Velocity * Velocity) yielding anEnergyvalue. - Addition of
KineticEnergymethod which takesMassandMomentumand applies the conversion (Mass, Momentum) => Momentum / (2 * Mass), yielding anEnergyvalue. - Addition of
MassunitsKilopoundsandMegapounds - Addition of
PowerRampunitsWattsPerMinuteandKilowattsPerMinutes - Addition of
MassFlowunitsPoundsPerSecond,PoundsPerHour,KilopoundsPerHourandMegapoundsPerHour - Addition of
VolumeFlowunitCubicFeetPerHour - Addition of
DimensionlessunitPercent - Normalize
Temperaturemodel - Enhance to
UnitOfMeasuremodel to include primaryUnit and siUnit - Simplify Json Serializers in
experimental.test - Removed redundant
toStringmethods from a few classes - Update
Length/Area/Volumeoperations to be unit-sensitive - Rename
CubicMilestoCubicUsMiles - Modify constants to use Exp notation where appropriate
- Update Scala versions to 2.11.6 and 2.10.5
- Add support for converting
Quantityvalues to aTuple2and initializing aQuantityfrom a Tuple. - Addition of
PressureChangedimension - Correction of
Bars/Pascalsconversion 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.
Release 0.4.2
Improvements to Market
- Add
Price.inmethod for directly converting a price to a different currency - Add
Price.toString(unit)method to support formatting in a specific unit - Add
Money.toStringoverload 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.toStringoverload 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
QuantityCompaniontrait - implemented for all data types exceptMoneywhich currently requires special handling - Implement
String => Quantityparsing conversions returningTry[Quantity]for all existing types (see Migration Notes below) - Additional Units:
- ElectricCharge:
MilliampereHours,MilliampereSeconds
- ElectricCharge:
- Add
unapplytoUnitOfMeasuretrait 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.
Release 0.3.3
Features in this release include:
- 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.
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.
Release 0.2.3
Merge pull request #28 from garyKeorkunian/wip-119 Add AreaDensity, improve README