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 / price
in 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.squants
toorg.typelevel
as
"org.typelevel" %% "squants" % "1.0.0"
Release 0.6.2
May 10, 2016
- Addition of
Information
andDataRate
dimensions - Integration with Scala.js
- Improvements to Vectors including
- add
map
methods - add
angle
andpolar
methods for extracting the polar coordinates - rename to
SVector
with a factory methods for Double and Quantity based Vectors - better typing and dimensional conversions
- add
- Addition of
Quantity.map
useful for mapping over underlying value without changing the type or units - Addition of
Time
unitNanoseconds
- Improve conversions to and from
Time
andscala.concurrent.Duration
to preserve units - Addition of
Velocity
unitKilometersPerSecond
- Fixed an issue with the
KilometersPerHour
unit - Added ability to initialize Quantities from strings in exponential format
- Addition of
Area.squareRoot
andVolume.cubeRoot
, each returning a Length - Addition of
Length
unitAngstroms
- Addition of
Energy
unitErgs
- Addition of
Power
unitErgsPerSecond
- 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
unitsGramsPerSquareCentimeter
andKilogramsPerHectare
- Removed bogus conversion
Irradiance
/Power
->Area
- Addition of
SpectralIrradiance
dimension - Addition of
Irradiance
unitErgsPerSecondPerSquareCentimeter
- 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
UnitMultiplier
trait toUnitConverter
, themultiplier
field toconversionFactor
, and set access level of all fields to protected (see Migration notes) - Rename
QuantityCompanion
toDimension
- Rename
Quantity.valueUnit
tounit
- Rename
MassFlowRate
toMassFlow
- Rename
VolumeFlowRate
toVolumeFlow
- Add
dimension
value to Quantity - Improvements to
TimeIntegral
andTimeDerivative
traits - Addition of
TimeSquared
, an intermediate non-quantity value, andSecondTimeDerivative
,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 takesMass
andVelocity
and applies the conversion (Mass, Velocity) => 1/2(Mass * Velocity * Velocity) yielding anEnergy
value. - Addition of
KineticEnergy
method which takesMass
andMomentum
and applies the conversion (Mass, Momentum) => Momentum / (2 * Mass), yielding anEnergy
value. - Addition of
Mass
unitsKilopounds
andMegapounds
- Addition of
PowerRamp
unitsWattsPerMinute
andKilowattsPerMinutes
- Addition of
MassFlow
unitsPoundsPerSecond
,PoundsPerHour
,KilopoundsPerHour
andMegapoundsPerHour
- Addition of
VolumeFlow
unitCubicFeetPerHour
- Addition of
Dimensionless
unitPercent
- 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
toCubicUsMiles
- 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 aTuple2
and initializing aQuantity
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.
Release 0.4.2
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 exceptMoney
which currently requires special handling - Implement
String => Quantity
parsing conversions returningTry[Quantity]
for all existing types (see Migration Notes below) - Additional Units:
- ElectricCharge:
MilliampereHours
,MilliampereSeconds
- ElectricCharge:
- Add
unapply
toUnitOfMeasure
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.
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