Skip to content

Commit

Permalink
Merge pull request #154 from cquiroz/release-1.0
Browse files Browse the repository at this point in the history
Prepare for release 1.0
  • Loading branch information
darkfrog26 authored Dec 20, 2016
2 parents 0b9a602 + 21782a8 commit de8c124
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ All types are immutable and thread-safe.
[![Join the chat at https://gitter.im/garyKeorkunian/squants](https://badges.gitter.im/garyKeorkunian/squants.svg)](https://gitter.im/garyKeorkunian/squants?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

### Current Versions
Current Release: **0.6.2**
([API Docs](https://oss.sonatype.org/service/local/repositories/releases/archive/com/squants/squants_2.11/0.6.2/squants_2.11-0.6.2-javadoc.jar/!/index.html#squants.package))
Current Release: **1.0.0**
([API Docs](https://oss.sonatype.org/service/local/repositories/releases/archive/org/typelevel/squants_2.11/1.0.0/squants_2.11-1.0.0-javadoc.jar/!/index.html#squants.package))

Development Build: **1.0.0-SNAPSHOT**
([API Docs](https://oss.sonatype.org/service/local/repositories/snapshots/archive/org/typelevel/squants_2.11/1.0.0-SNAPSHOT/squants_2.11-1.0.0-SNAPSHOT-javadoc.jar/!/index.html#squants.package))

[Release History](https://github.com/typelevel/squants/wiki/Release-History)

[![Build Status](https://travis-ci.org/garyKeorkunian/squants.png?branch=master)](https://travis-ci.org/garyKeorkunian/squants)
[![Build Status](https://travis-ci.org/typelevel/squants.png?branch=master)](https://travis-ci.org/typelevel/squants)

Build services provided by [Travis CI](https://travis-ci.com/)
Build services provided by [Travis CI](https://travis-ci.com/)

NOTE - This README reflects the feature set in the branch it can be found.
For more information on feature availability of a specific version see the Release History or the README for a that version
NOTE - This README reflects the feature set in the branch it can be found.
For more information on feature availability of a specific version see the Release History or the README for a that version

## Installation
Repository hosting for Squants is provided by [Sonatype](https://oss.sonatype.org/).
To use Squants in your SBT project add the following dependency to your build.

"com.squants" %% "squants" % "0.6.2"
"com.squants" %% "squants" % "1.0.0"
or

"org.typelevel" %% "squants" % "1.0.0-SNAPSHOT"
Expand All @@ -49,7 +49,7 @@ To use Squants in your Maven project add the following dependency
<dependency>
<groupId>org.typelevel</groupId>
<artifactId>squants_2.11</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.0</version>
</dependency>
```

Expand Down Expand Up @@ -101,7 +101,7 @@ val load1: Power = Kilowatts(12) // returns Power(12, Kilowatts) or 12 kW
val load2: Power = Megawatts(0.023) // Power: 0.023 MW
val sum = load1 + load2 // Power: 35 kW - unit on left side is preserved
sum should be(Kilowatts(35))
sum should be(Megawatts(0.035)) // comparisons automatically convert scale
sum should be(Megawatts(0.035)) // comparisons automatically convert scale
```

works because Kilowatts and Megawatts are both units of Power. Only the scale is
Expand All @@ -123,7 +123,7 @@ _One may take quantities with different dimensions, and multiply or divide them.
Dimensionally correct type conversions are a key feature of Squants.
Conversions are implemented by defining relationships between Quantity types using the * and / operators.

The following code demonstrates creating ratio between two quantities of the same dimension,
The following code demonstrates creating ratio between two quantities of the same dimension,
resulting in a dimensionless value:

```scala
Expand Down Expand Up @@ -168,7 +168,7 @@ val loadC = loadA in Gigawatts // Power: 0.0012 GW
```

Sometimes you need to get the numeric value of the quantity in a specific unit
(eg, for submission to an external service that requires a numeric in a specified unit
(eg, for submission to an external service that requires a numeric in a specified unit
or to perform analysis beyond Squant's domain)

When necessary, the value can be extracted in the desired unit with the `to` method.
Expand Down Expand Up @@ -216,10 +216,10 @@ that do not use Squants, or require use of more basic types (Double, String)
Simple console based conversions (using DSL described below)

```scala
1.kilograms to Pounds // Double: 2.2046226218487757
1.kilograms to Pounds // Double: 2.2046226218487757
kilogram / pound // Double: 2.2046226218487757
2.1.pounds to Kilograms // Double: 0.952543977

2.1.pounds to Kilograms // Double: 0.952543977
2.1.pounds / kilogram // Double: 0.952543977

100.C to Fahrenheit // Double: 212.0
Expand All @@ -240,7 +240,7 @@ Create an implicit Quantity value to be used as a tolerance in approximations.
Then use the `approx` method (or `=~`, `~=`, `` operators) like you would use the `equals` method (`==` operator).

```scala
implicit val tolerance = Watts(.1) // implicit Power: 0.1 W
implicit val tolerance = Watts(.1) // implicit Power: 0.1 W
val load = Kilowatts(2.0) // Power: 2.0 kW
val reading = Kilowatts(1.9999) // Power: 1.9999 kW

Expand Down Expand Up @@ -302,7 +302,7 @@ val vectorLength = vectorDouble.to(Kilometers) // QuantityVector(1.2 km, 4.3 km
```

Currently dimensional conversions are supported by using the slightly verbose, but flexible map method.

```scala
val vectorLength = QuantityVector(Kilometers(1.2), Kilometers(4.3), Kilometers(2.3))
val vectorArea = vectorLength.map[Area](_ * Kilometers(2)) // QuantityVector(2.4 km², 8.6 km², 4.6 km²)
Expand All @@ -319,7 +319,7 @@ val vectorLength = QuantityVector(Kilometers(1.2), Kilometers(4.3), Kilometers(2
val vectorMetersNum = vectorLength.to(Meters) // DoubleVector(1200.0, 4300.0, 2300.0)
val vectorMeters = vectorLength.in(Meters) // QuantityVector(1200.0 m, 4300.0 m, 2300.0 m)
```

## Market Package
Market Types are similar but not quite the same as other quantities in the library.
The primary type, Money, is a Dimensional Quantity, and its Units of Measure are Currencies.
Expand Down Expand Up @@ -426,7 +426,7 @@ range.foldLeft(10)(0) {(z, r) => ???}
```

NOTE - Because these implementations of foreach, map and fold* take a parameter (the divisor), these methods
are not directly compatible with Scala's for comprehensions.
are not directly compatible with Scala's for comprehensions.
To use in a for comprehension, apply the * or / operators as described above to create a Seq from the Range.

```scala
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.typesafe.sbt.osgi.SbtOsgi
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._

object Versions {
val Squants = "1.0.0-SNAPSHOT"
val Squants = "1.0.0"
val Scala = "2.11.8"
val ScalaCross = Seq("2.12.1", "2.11.8", "2.10.6")

Expand Down

0 comments on commit de8c124

Please sign in to comment.