@explorable-viz/fluid 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/.spago/aff/v7.1.0/.editorconfig +13 -0
  2. package/.spago/aff/v7.1.0/.eslintrc.json +28 -0
  3. package/.spago/aff/v7.1.0/.gitignore +14 -0
  4. package/.spago/aff/v7.1.0/.tidyrc.json +10 -0
  5. package/.spago/argonaut-codecs/v9.1.0/.editorconfig +13 -0
  6. package/.spago/argonaut-codecs/v9.1.0/.gitignore +9 -0
  7. package/.spago/argonaut-codecs/v9.1.0/.tidyrc.json +10 -0
  8. package/.spago/arrays/v7.2.1/.eslintrc.json +26 -0
  9. package/.spago/arrays/v7.2.1/.gitignore +9 -0
  10. package/.spago/console/v6.1.0/.eslintrc.json +30 -0
  11. package/.spago/console/v6.1.0/.gitignore +9 -0
  12. package/.spago/debug/v6.0.2/.eslintrc.json +36 -0
  13. package/.spago/debug/v6.0.2/.gitignore +8 -0
  14. package/.spago/enums/v6.0.1/.gitignore +7 -0
  15. package/.spago/foreign-object/v4.1.0/.eslintrc.json +26 -0
  16. package/.spago/foreign-object/v4.1.0/.gitignore +8 -0
  17. package/.spago/free/v7.1.0/.gitignore +8 -0
  18. package/.spago/graphs/v8.1.0/.gitignore +7 -0
  19. package/.spago/js-uri/v3.1.0/.eslintrc.json +30 -0
  20. package/.spago/js-uri/v3.1.0/.gitignore +14 -0
  21. package/.spago/js-uri/v3.1.0/.tidyrc.json +10 -0
  22. package/.spago/node-buffer/v9.0.0/.eslintrc.json +26 -0
  23. package/.spago/node-buffer/v9.0.0/.gitignore +8 -0
  24. package/.spago/node-process/v11.2.0/.eslintrc.json +29 -0
  25. package/.spago/node-process/v11.2.0/.gitignore +8 -0
  26. package/.spago/node-streams/v9.0.0/.eslintrc.json +29 -0
  27. package/.spago/node-streams/v9.0.0/.gitignore +8 -0
  28. package/.spago/optparse/v6.0.0/.gitignore +8 -0
  29. package/.spago/optparse/v6.0.0/.npmrc +1 -0
  30. package/.spago/ordered-collections/v3.1.1/.gitignore +8 -0
  31. package/.spago/parallel/v7.0.0/.gitignore +7 -0
  32. package/.spago/parsing/v10.3.1/.editorconfig +13 -0
  33. package/.spago/parsing/v10.3.1/.gitignore +12 -0
  34. package/.spago/parsing/v10.3.1/.tidyoperators +231 -0
  35. package/.spago/parsing/v10.3.1/.tidyrc.json +10 -0
  36. package/.spago/prelude/v6.0.1/.eslintrc.json +26 -0
  37. package/.spago/prelude/v6.0.1/.gitignore +8 -0
  38. package/.spago/st/v6.2.0/.eslintrc.json +26 -0
  39. package/.spago/st/v6.2.0/.gitignore +8 -0
  40. package/.spago/strings/v6.0.1/.eslintrc.json +26 -0
  41. package/.spago/strings/v6.0.1/.gitignore +8 -0
  42. package/.spago/tailrec/v6.1.0/.gitignore +7 -0
  43. package/.spago/web-html/v4.1.0/.eslintrc.json +29 -0
  44. package/.spago/web-html/v4.1.0/.gitignore +8 -0
  45. package/.spago/web-xhr/v5.0.1/.eslintrc.json +29 -0
  46. package/.spago/web-xhr/v5.0.1/.gitignore +8 -0
  47. package/dist/fluid/fluid/lib/graphics.fld +50 -50
  48. package/dist/fluid/fluid/lib/matrix.fld +1 -1
  49. package/dist/fluid/fluid/lib/prelude.fld +50 -12
  50. package/dist/fluid/fluid/lib/stats.fld +6 -6
  51. package/dist/fluid/shared/fluid.mjs +21643 -26195
  52. package/dist/fluid/shared/load-figure.js +30131 -29582
  53. package/dist/fluid/shared/webtest-lib.js +3385 -3389
  54. package/package.json +1 -1
  55. package/website/article/.DS_Store +0 -0
  56. package/website/article/convolution/index.html +1 -1
  57. package/website/article/css/styles.css +4 -0
  58. package/website/article/css/view-styles.css +9 -2
  59. package/website/article/dataset/.DS_Store +0 -0
  60. package/website/article/energy-scatter/index.html +1 -1
  61. package/website/article/fluid/1805.02474v1-10.fld +21 -21
  62. package/website/article/fluid/bar-chart-line-chart.fld +7 -5
  63. package/website/article/fluid/convolution.fld +1 -1
  64. package/website/article/fluid/moving-average.fld +4 -4
  65. package/website/article/fluid/non-renewables.fld +7 -5
  66. package/website/article/index.html +19 -7
  67. package/website/article/methane/index.html +1 -1
  68. package/website/article/moving-average/index.html +1 -1
  69. package/website/article/non-renewables/index.html +1 -1
  70. package/website/article/publications.html +44 -0
  71. package/website/article/renewables-linked/index.html +1 -1
  72. package/website/article/scigen-1805.02474v1-10/index.html +1 -1
  73. package/website/article/test.mjs +5 -5
  74. package/dist/fluid/fluid/lib/pi.fld +0 -1
  75. package/website/article/dataset/annual-temp-anomaly.json +0 -413
  76. package/website/article/dataset/ccra3-risks.json +0 -2015
@@ -1,17 +1,17 @@
1
1
  def coords(Group(gs)): Point(0, 0)
2
2
  def coords(Rect(x, y, _, _, _)): Point(x, y)
3
3
  def coords(String(x, y, _, _, _)): Point(x, y)
4
- def coords(Viewport(x, y, _, _, _, _, _, _, _)): Point(x, y);
4
+ def coords(Viewport(x, y, _, _, _, _, _, _, _)): Point(x, y)
5
5
 
6
6
  def get_x(g):
7
- def Point(x, _): coords(g);
7
+ def Point(x, _): coords(g)
8
8
 
9
- x;
9
+ x
10
10
 
11
11
  def get_y(g):
12
- def Point(_, y): coords(g);
12
+ def Point(_, y): coords(g)
13
13
 
14
- x;
14
+ x
15
15
 
16
16
  def set_x(x, Group(gs)):
17
17
  error("Group has immutable coordinates")
@@ -20,10 +20,10 @@ def set_x(x, Rect(_, y, w, h, fill)):
20
20
  def set_x(x, String(_, y, str, anchor, baseline)):
21
21
  String(x, y, str, anchor, baseline)
22
22
  def set_x(x, Viewport(_, y, w, h, fill, margin, scale, translate, g)):
23
- Viewport(x, y, w, h, fill, margin, scale, translate, g);
23
+ Viewport(x, y, w, h, fill, margin, scale, translate, g)
24
24
 
25
25
  def dimensions2((Point(x1, y1), Point(x2, y2))):
26
- Point(max(x1, x2), max(y1, y2));
26
+ Point(max(x1, x2), max(y1, y2))
27
27
 
28
28
  def dimensions(Group(gs)):
29
29
  foldl(curry(dimensions2), Point(0, 0), map(coords_op, gs))
@@ -34,22 +34,22 @@ def dimensions(String(_, _, _, _, _)): Point(0, 0)
34
34
  def dimensions(Viewport(_, _, w, h, _, _, _, _, _)): Point(w, h)
35
35
  def coords_op(g):
36
36
  def (Point(x, y), Point(w, h)):
37
- prod(coords, dimensions, g);
37
+ prod(coords, dimensions, g)
38
38
 
39
- Point(x + w, y + h);
39
+ Point(x + w, y + h)
40
40
 
41
41
  def width(g):
42
- def Point(w, _): dimensions(g);
42
+ def Point(w, _): dimensions(g)
43
43
 
44
- w;
44
+ w
45
45
 
46
46
  def height(g):
47
- def Point(_, h): dimensions(g);
47
+ def Point(_, h): dimensions(g)
48
48
 
49
- h;
49
+ h
50
50
 
51
51
  def spaceRight(z, sep, gs):
52
- zipWith(set_x, iterate(length(gs), (+)(sep), z), gs);
52
+ zipWith(set_x, iterate(length(gs), (+)(sep), z), gs)
53
53
 
54
54
  def colours1: [
55
55
  "#66c2a5",
@@ -60,7 +60,7 @@ def colours1: [
60
60
  "#b3b3b3",
61
61
  "#8da0cb",
62
62
  "#e78ac3"
63
- ];
63
+ ]
64
64
 
65
65
  def colours2: [
66
66
  "#e41a1c",
@@ -71,54 +71,54 @@ def colours2: [
71
71
  "#ffff33",
72
72
  "#a65628",
73
73
  "#f781bf"
74
- ];
74
+ ]
75
75
 
76
76
  def scaleToWidth(w, Rect(x, y, _, h, fill)):
77
77
  Rect(x, y, w, h, fill)
78
78
  def scaleToWidth(w, Viewport(x, y, w0, h, fill, margin, Scale(x_scale, y_scale), translate, g)):
79
79
  def scale:
80
- Scale((x_scale * w) / w0, y_scale);
80
+ Scale((x_scale * w) / w0, y_scale)
81
81
 
82
- Viewport(x, y, w, h, fill, margin, scale, translate, g);
82
+ Viewport(x, y, w, h, fill, margin, scale, translate, g)
83
83
 
84
84
  def stackRight(sep, gs):
85
- map(scaleToWidth(1 - sep), spaceRight(sep / 2, 1, gs));
85
+ map(scaleToWidth(1 - sep), spaceRight(sep / 2, 1, gs))
86
86
 
87
87
  def groupRight(sep, gs):
88
- Viewport(0, 0, length(gs), maximum(map(height, gs)), "none", 0, Scale(1, 1), Translate(0, 0), Group(stackRight(sep, gs)));
88
+ Viewport(0, 0, length(gs), maximum(map(height, gs)), "none", 0, Scale(1, 1), Translate(0, 0), Group(stackRight(sep, gs)))
89
89
 
90
90
  def tickEvery(n):
91
91
  def m:
92
- floor(logBase(10, n));
92
+ floor(logBase(10, n))
93
93
 
94
94
  if n <= 2 * 10 ** m: 2 * 10 ** (m - 1)
95
- else: 10 ** m;
95
+ else: 10 ** m
96
96
 
97
97
  def axisStrokeWidth: 0.5
98
98
  def axisColour: "black"
99
99
  def backgroundColour: "white"
100
100
  def defaultMargin: 24
101
101
  def markerRadius: 3.5
102
- def tickLength: 4;
102
+ def tickLength: 4
103
103
 
104
104
  def tick(Horiz, colour, len):
105
105
  Line(Point(0, 0), Point(0, 0 - len), colour, axisStrokeWidth)
106
106
  def tick(Vert, colour, len):
107
- Line(Point(0, 0), Point(0 - len, 0), colour, axisStrokeWidth);
107
+ Line(Point(0, 0), Point(0 - len, 0), colour, axisStrokeWidth)
108
108
 
109
109
  def label(Horiz, x, distance, str):
110
110
  String(x, (0 - distance) - 4, str, "middle", "hanging")
111
111
  def label(Vert, x, distance, str):
112
- String(0 - distance, x, str, "end", "central");
112
+ String(0 - distance, x, str, "end", "central")
113
113
 
114
114
  def labelledTick(orient, colour, len, str):
115
115
  Group([
116
116
  tick(orient, colour, len),
117
117
  label(orient, 0, len, str)
118
- ]);
118
+ ])
119
119
 
120
120
  def mkPoint(Horiz, x, y): Point(y, x)
121
- def mkPoint(Vert, x, y): Point(x, y);
121
+ def mkPoint(Vert, x, y): Point(x, y)
122
122
 
123
123
  def axis(orient, x, start, end):
124
124
  def tickSp:
@@ -146,75 +146,75 @@ def axis(orient, x, start, end):
146
146
  Group([
147
147
  Line(head(ps), last(ps), axisColour, axisStrokeWidth),
148
148
  Polymarkers(ps, flip(map, ys, compose(labelledTick(orient, axisColour, tickLength), numToStr)))
149
- ]);
149
+ ])
150
150
 
151
- (ax, lastTick);
151
+ (ax, lastTick)
152
152
 
153
153
  def catAxis(orient, x, catValues):
154
154
  def ys:
155
155
  iterate(length(catValues) + 1, (+)(1), 0)
156
156
  def ps:
157
- map(mkPoint(orient, x), ys);
157
+ map(mkPoint(orient, x), ys)
158
158
 
159
159
  Group([
160
160
  Line(head(ps), last(ps), axisColour, axisStrokeWidth),
161
161
  Polymarkers(tail(ps), map(const(tick(orient, axisColour, tickLength)), catValues)),
162
- Polymarkers(flip(map, tail(ps), (lambda Point(x, y): Point(x - 0.5, y))), map(label(orient, -0.5, 0), catValues))
163
- ]);
162
+ Polymarkers(flip(map, tail(ps), lambda Point(x, y): Point(x - 0.5, y)), map(label(orient, -0.5, 0), catValues))
163
+ ])
164
164
 
165
165
  def viewport(x_start, x_finish, y_finish, margin, gs):
166
- Viewport(0, 0, x_finish - x_start, y_finish, backgroundColour, margin, Scale(1, 1), Translate(0 - x_start, 0), Group(gs));
166
+ Viewport(0, 0, x_finish - x_start, y_finish, backgroundColour, margin, Scale(1, 1), Translate(0 - x_start, 0), Group(gs))
167
167
 
168
168
  def lineChart(withAxes, colours, x_start, data):
169
169
  def xs: map(fst, data)
170
170
  def nCat:
171
- length(snd(head(data)));
171
+ length(snd(head(data)))
172
172
 
173
173
  def plot((n, colour)):
174
174
  def ps:
175
- map((lambda (x, kvs): Point(x, snd(nth(n, kvs)))), data);
175
+ map(lambda (x, kvs): Point(x, snd(nth(n, kvs))), data)
176
176
 
177
177
  Group([
178
178
  Polyline(ps, colour, 1),
179
179
  Polymarkers(ps, repeat(length(ps), Circle(0, 0, markerRadius, colour)))
180
- ]);
180
+ ])
181
181
 
182
182
  def lines:
183
183
  zipWith(curry(plot), iterate(nCat, (+)(1), 0), colours)
184
184
  def x_finish: last(xs)
185
185
  def y_finish:
186
- maximum(flip(map, data, (lambda (_, kvs): maximum(map(snd, kvs)))));
186
+ maximum(flip(map, data, lambda (_, kvs): maximum(map(snd, kvs))))
187
187
 
188
188
  match withAxes:
189
189
  case True:
190
190
  def (x_axis, x_finish):
191
191
  axis(Horiz, 0, x_start, x_finish)
192
192
  def (y_axis, y_finish'):
193
- axis(Vert, x_start, 0, y_finish);
193
+ axis(Vert, x_start, 0, y_finish)
194
194
 
195
195
  viewport(x_start, x_finish, y_finish', defaultMargin, x_axis :| y_axis :| lines)
196
196
  case False:
197
- viewport(x_start, x_finish, y_finish, 0, lines);
197
+ viewport(x_start, x_finish, y_finish, 0, lines)
198
198
 
199
199
  def categoricalChart(plotValue, withAxes, colours, sep, data):
200
200
  def gs:
201
201
  stackRight(sep, plotValue(colours, map(snd, data)))
202
202
  def w: length(gs)
203
203
  def h:
204
- maximum(map(height, gs));
204
+ maximum(map(height, gs))
205
205
 
206
206
  match withAxes:
207
207
  case True:
208
208
  def x_axis:
209
209
  catAxis(Horiz, 0, map(fst, data))
210
- def (y_axis, h'): axis(Vert, 0, 0, h);
210
+ def (y_axis, h'): axis(Vert, 0, 0, h)
211
211
 
212
212
  viewport(0, w, h', defaultMargin, concat2(gs, [x_axis, y_axis]))
213
213
  case False:
214
- viewport(0, w, h, 0, gs);
214
+ viewport(0, w, h, 0, gs)
215
215
 
216
216
  def rects(colours, ns):
217
- zipWith((lambda colour, n: Rect(0, 0, 1, n, colour)), colours, ns);
217
+ zipWith(lambda colour, n: Rect(0, 0, 1, n, colour), colours, ns)
218
218
 
219
219
  def stackedBar(colours, ns):
220
220
  def heights: map(snd, ns)
@@ -223,24 +223,24 @@ def stackedBar(colours, ns):
223
223
  def dims:
224
224
  zip(0 :| subtotals, heights)
225
225
  def rects:
226
- map((lambda ((y, height), colour): Rect(0, y, 1, height, colour)), zip(dims, colours));
226
+ map(lambda ((y, height), colour): Rect(0, y, 1, height, colour), zip(dims, colours))
227
227
 
228
- Viewport(0, 0, 1, last(subtotals), "none", 0, Scale(1, 1), Translate(0, 0), Group(rects));
228
+ Viewport(0, 0, 1, last(subtotals), "none", 0, Scale(1, 1), Translate(0, 0), Group(rects))
229
229
 
230
230
  def barChart:
231
- categoricalChart(rects);
231
+ categoricalChart(rects)
232
232
 
233
233
  def groupedBarChart:
234
- categoricalChart(compose(map, flip(barChart(False), 0)));
234
+ categoricalChart(compose(map, flip(barChart(False), 0)))
235
235
 
236
236
  def stackedBarChart:
237
- categoricalChart(compose(map, stackedBar));
237
+ categoricalChart(compose(map, stackedBar))
238
238
 
239
239
  def caption(str, Viewport(x, y, w, h, fill, margin, scale, translate, g)):
240
240
  def g':
241
241
  Group([
242
242
  String(x + w / 2, -2, str, "middle", "hanging"),
243
243
  Viewport(0, 0, w, h, fill, margin, scale, translate, g)
244
- ]);
244
+ ])
245
245
 
246
- Viewport(x, y, w, h, backgroundColour, defaultMargin / 2 + 4, Scale(1, 1), Translate(0, 0), g');
246
+ Viewport(x, y, w, h, backgroundColour, defaultMargin / 2 + 4, Scale(1, 1), Translate(0, 0), g')
@@ -36,5 +36,5 @@ def matMul(a, b):
36
36
  if not(n == i):
37
37
  error("Dimensions don't line up")
38
38
  else:
39
- @doc("""Intermediate matrix""")
39
+ @doc(f"""Intermediate matrix""")
40
40
  [| sum([a!(i_, k) * b!(k, j_) for k in enumFromTo(1, n)]) for (i_, j_) in (m, j) |]
@@ -1,12 +1,15 @@
1
1
  # "Num" throughout means (Int + Float).
2
2
 
3
+ # To resolve in new semantics: expected dependencies don't arise for and/or unless they make a fresh value.
3
4
  # Bool -> Bool
4
5
  def and(False, y): False
5
- def and(True, y): y
6
+ def and(True, True): True
7
+ def and(True, False): False
6
8
 
7
9
  # Bool -> Bool
8
10
  def or(True, y): True
9
- def or(False, y): y
11
+ def or(False, True): True
12
+ def or(False, False): False
10
13
 
11
14
  # Bool -> Bool
12
15
  def not(True): False
@@ -19,6 +22,10 @@ def compare(x, y):
19
22
  if x < y: LT
20
23
  else: EQ
21
24
 
25
+ # (b -> b -> c) -> (a -> b) -> a -> a -> c
26
+ def on(binOp, prop, x, y):
27
+ binOp(prop(x), prop(y))
28
+
22
29
  # Num -> Num
23
30
  def negate: (-)(0)
24
31
 
@@ -83,20 +90,23 @@ def elem(x, y :| xs):
83
90
  x == y |or| elem(x, xs)
84
91
 
85
92
  # (a -> Bool) -> List a -> Option a
86
- def find(p, []): error("not found")
93
+ def find(p, []): None
87
94
  def find(p, x :| xs):
88
95
  if p(x): Some(x)
89
96
  else: find(p, xs)
90
97
 
91
98
  # String -> String -> List Dict -> Option Dict
92
- def findWithKey(fname, fval, d):
93
- find((lambda y: y[fname] == fval), d)
99
+ def findWithKey(k, v, rs):
100
+ find(lambda y: y[k] == v, rs)
94
101
 
95
102
  # Option a -> a
96
- def fromSome(None):
97
- error("Expected Some!")
103
+ def fromSome(None): error("Expected Some!")
98
104
  def fromSome(Some(x)): x
99
105
 
106
+ # Option a -> a -> a
107
+ def fromOption(None, y): y
108
+ def fromOption(Some(x), _): x
109
+
100
110
  # (a -> Bool) -> List a -> List a
101
111
  def filter(p, []): []
102
112
  def filter(p, x :| xs):
@@ -113,6 +123,30 @@ def filterMap(p, x :| xs):
113
123
  case Some(y):
114
124
  y :| filterMap(f, xs)
115
125
 
126
+ # Equivalent to but more efficient than length ∘ filter(p)
127
+ def count_if(p):
128
+ def f(n, x):
129
+ if p(x): n + 1
130
+ else: n
131
+ foldl(f, 0)
132
+
133
+ # Split list into longest initial segment whose elements satisfy a predicate, and the rest.
134
+ # (a -> Bool) -> List a -> { init :: List a, rest :: List a }
135
+ def span(p, Nil): { init: Nil, rest: Nil }
136
+ def span(p, x :| xs_):
137
+ if p(x):
138
+ def { init: ys, rest: zs }: span(p, xs_)
139
+ { init: x :| ys, rest: zs }
140
+ else:
141
+ { init: Nil, rest: x :| xs_ }
142
+
143
+ # Each returned list is non-empty.
144
+ # (a -> a -> Bool) -> List a -> List (List a)
145
+ def groupBy(eq, Nil): Nil
146
+ def groupBy(eq, x :| xs):
147
+ def { init: ys, rest: zs }: span(eq(x), xs)
148
+ (x :| ys) :| groupBy(eq, zs)
149
+
116
150
  # (a -> b -> a) -> a -> List b -> a
117
151
  def foldl(op, z, []): z
118
152
  def foldl(op, z, x :| xs):
@@ -135,9 +169,7 @@ def foldr1(op, x :| y :| xs):
135
169
  def scanl1(op, z, xs):
136
170
  def go(x, continue, acc):
137
171
  def next: op(acc, x)
138
-
139
172
  next :| continue(next)
140
-
141
173
  foldr(go, const([]), xs, z)
142
174
 
143
175
  # (a -> b -> a) -> a -> List b -> List a
@@ -177,8 +209,13 @@ def iterate(n, f, z):
177
209
  else:
178
210
  z :| map(f, iterate(n - 1, f, z))
179
211
 
180
- # List Int -> Int
181
- def sum: foldr((+), 0)
212
+ # List Num -> Num
213
+ def sum: foldl((+), 0)
214
+
215
+ # List Num -> Num
216
+ def mean(xs):
217
+ def (s, n): foldl(lambda (s, n), x: (s + x, n + 1), (0, 0), xs)
218
+ s / n
182
219
 
183
220
  # List a -> a
184
221
  def last([x]): x
@@ -286,7 +323,8 @@ def abs(x, y):
286
323
  def nub(xs):
287
324
  def nub_([], _): []
288
325
  def nub_(x :| xs, ys):
289
- if x |elem| ys: nub_(xs, ys)
326
+ if x |elem| ys:
327
+ nub_(xs, ys)
290
328
  else:
291
329
  x :| nub_(xs, x :| ys)
292
330
 
@@ -19,7 +19,7 @@ def mergesort(xs):
19
19
 
20
20
  def findQuantile(q, p, xs):
21
21
  def rank:
22
- (p / q) * (length(xs) - 1);
22
+ (p / q) * (length(xs) - 1)
23
23
 
24
24
  if rank == floor(rank):
25
25
  nth(rank, xs)
@@ -36,7 +36,7 @@ def accumBins(data, Nil): []
36
36
  def accumBins(data, [l]): []
37
37
  def accumBins(data, l :| r :| es):
38
38
  def (ge, le):
39
- splitOn((lambda x: x <= r), data)
39
+ splitOn(lambda x: x <= r, data)
40
40
  (le, r - l) :| accumBins(ge, r :| es)
41
41
 
42
42
  def cut(xs, nbins):
@@ -46,7 +46,7 @@ def cut(xs, nbins):
46
46
  def edges:
47
47
  [low + x * binwidth for x in enumFromTo(0, nbins)]
48
48
 
49
- accumBins(xs, edges);
49
+ accumBins(xs, edges)
50
50
 
51
51
  def qcut(xs, qs):
52
52
  def (low, high):
@@ -57,13 +57,13 @@ def qcut(xs, qs):
57
57
  accumBins(xs, edges)
58
58
 
59
59
  def likelihoodLE(xs, target):
60
- length(filter((lambda x: x <= target), xs)) / length(xs)
60
+ length(filter(lambda x: x <= target, xs)) / length(xs)
61
61
 
62
62
  def likelihoodGE(xs, target):
63
- length(filter((lambda x: x >= target), xs)) / length(xs)
63
+ length(filter(lambda x: x >= target, xs)) / length(xs)
64
64
 
65
65
  def likelihoodMap(table, prob):
66
- fromSome(find((lambda x: x.prob <= prob), table)).msg
66
+ fromSome(find(lambda x: x.prob <= prob, table)).msg
67
67
 
68
68
  def mkPercent(num):
69
69
  numToStr(num * 100) ++ "%"