Merge branch 'master' into debian/jessie-backports
Martín Ferrari
7 years ago
0 | Copyright (C) 2013 Blake Mizerany | |
1 | ||
2 | Permission is hereby granted, free of charge, to any person obtaining | |
3 | a copy of this software and associated documentation files (the | |
4 | "Software"), to deal in the Software without restriction, including | |
5 | without limitation the rights to use, copy, modify, merge, publish, | |
6 | distribute, sublicense, and/or sell copies of the Software, and to | |
7 | permit persons to whom the Software is furnished to do so, subject to | |
8 | the following conditions: | |
9 | ||
10 | The above copyright notice and this permission notice shall be | |
11 | included in all copies or substantial portions of the Software. | |
12 | ||
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
15 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
16 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |
17 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |
18 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
19 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
0 | golang-github-beorn7-perks (0.0~git20160804.0.4c0e845-1) unstable; urgency=medium | |
1 | ||
2 | * New upstream snapshot. | |
3 | * debian/control: Remove golang-go dependency from -dev package. | |
4 | * debian/control: Replace golang-go with golang-any in Build-Depends. | |
5 | ||
6 | -- Martín Ferrari <tincho@debian.org> Wed, 23 Nov 2016 15:06:45 +0100 | |
7 | ||
8 | golang-github-beorn7-perks (0.0~git20150223.0.b965b61-2) unstable; urgency=medium | |
9 | ||
10 | * debian/control: | |
11 | - Update Standards-Version with no changes. | |
12 | - Update Vcs-* to use HTTPS. | |
13 | - Improve package description. | |
14 | - Add me and Tim to Uploaders. | |
15 | * debian/rules: | |
16 | - Do not install *everything*. | |
17 | ||
18 | -- Martín Ferrari <tincho@debian.org> Sun, 19 Jun 2016 18:09:35 +0000 | |
19 | ||
0 | 20 | golang-github-beorn7-perks (0.0~git20150223.0.b965b61-1~bpo8+1) jessie-backports; urgency=medium |
1 | 21 | |
2 | 22 | * Rebuild for jessie-backports. |
1 | 1 | Section: devel |
2 | 2 | Priority: extra |
3 | 3 | Maintainer: Debian Go Packaging Team <pkg-go-maintainers@lists.alioth.debian.org> |
4 | Uploaders: Dmitry Smirnov <onlyjob@debian.org>, Tim Potter <tpot@hpe.com> | |
4 | Uploaders: Dmitry Smirnov <onlyjob@debian.org>, | |
5 | Tim Potter <tpot@hpe.com>, | |
6 | Martín Ferrari <tincho@debian.org> | |
5 | 7 | Build-Depends: debhelper (>= 9), |
6 | 8 | dh-golang (>= 1.17~), |
7 | golang-go | |
8 | Standards-Version: 3.9.6 | |
9 | golang-any, | |
10 | Standards-Version: 3.9.8 | |
9 | 11 | Homepage: https://github.com/beorn7/perks |
10 | 12 | Vcs-Browser: https://anonscm.debian.org/cgit/pkg-go/packages/golang-github-beorn7-perks.git |
11 | Vcs-Git: git://anonscm.debian.org/pkg-go/packages/golang-github-beorn7-perks.git | |
13 | Vcs-Git: https://anonscm.debian.org/git/pkg-go/packages/golang-github-beorn7-perks.git | |
12 | 14 | XS-Go-Import-Path: github.com/beorn7/perks |
13 | 15 | |
14 | 16 | Package: golang-github-beorn7-perks-dev |
15 | 17 | Architecture: all |
16 | Depends: ${shlibs:Depends}, | |
17 | ${misc:Depends}, | |
18 | golang-go | |
18 | Depends: ${misc:Depends}, | |
19 | ${shlibs:Depends}, | |
19 | 20 | Description: effective computation of things |
20 | Perks contains the Go package quantile that computes approximate quantiles | |
21 | over an unbounded data stream within low memory and CPU bounds. | |
21 | This is a fork of github.com/bmizerany/perks (now unmaintained). | |
22 | The package contains: | |
23 | * github.com/beorn7/perks/histogram: a Go implementation of BigML's histogram | |
24 | package for Clojure/Java. | |
25 | * github.com/beorn7/perks/quantile: computes approximate quantiles over an | |
26 | unbounded data stream within low memory and CPU bounds. |
0 | README.md |
0 | 0 | #!/usr/bin/make -f |
1 | 1 | |
2 | export DH_GOLANG_INSTALL_ALL := 1 | |
2 | export DH_GOLANG_INSTALL_EXTRA := quantile/exampledata.txt | |
3 | 3 | |
4 | 4 | %: |
5 | 5 | dh $@ --buildsystem=golang --with=golang |
132 | 132 | if l == 0 { |
133 | 133 | return 0 |
134 | 134 | } |
135 | i := int(float64(l) * q) | |
135 | i := int(math.Ceil(float64(l) * q)) | |
136 | 136 | if i > 0 { |
137 | 137 | i -= 1 |
138 | 138 | } |
32 | 32 | for quantile, epsilon := range Targets { |
33 | 33 | n := float64(len(a)) |
34 | 34 | k := int(quantile * n) |
35 | if k < 1 { | |
36 | k = 1 | |
37 | } | |
35 | 38 | lower := int((quantile - epsilon) * n) |
36 | 39 | if lower < 1 { |
37 | 40 | lower = 1 |
98 | 101 | verifyPercsWithAbsoluteEpsilon(t, a, s) |
99 | 102 | } |
100 | 103 | |
104 | func TestTargetedQuerySmallSampleSize(t *testing.T) { | |
105 | rand.Seed(42) | |
106 | s := NewTargeted(TargetsSmallEpsilon) | |
107 | a := []float64{1, 2, 3, 4, 5} | |
108 | for _, v := range a { | |
109 | s.Insert(v) | |
110 | } | |
111 | verifyPercsWithAbsoluteEpsilon(t, a, s) | |
112 | // If not yet flushed, results should be precise: | |
113 | if !s.flushed() { | |
114 | for φ, want := range map[float64]float64{ | |
115 | 0.01: 1, | |
116 | 0.10: 1, | |
117 | 0.50: 3, | |
118 | 0.90: 5, | |
119 | 0.99: 5, | |
120 | } { | |
121 | if got := s.Query(φ); got != want { | |
122 | t.Errorf("want %f for φ=%f, got %f", want, φ, got) | |
123 | } | |
124 | } | |
125 | } | |
126 | } | |
127 | ||
101 | 128 | func TestLowBiasedQuery(t *testing.T) { |
102 | 129 | rand.Seed(42) |
103 | 130 | s := NewLowBiased(RelativeEpsilon) |