Skip to content

Commit 04f3598

Browse files
committed
enable sampling in wrapper
1 parent 2893f92 commit 04f3598

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

resources/evaluate.q

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,20 @@
177177
}[generateTableColumns; generateColumns];
178178
typeOf: {$[0>type x; .axq.i_PRIMCODE neg type x; .axq.i_NONPRIMCODE type x]};
179179
isAtom: {not type[x] within 0 99h};
180-
// sample: {[sampleFn; sampleSize; data]
181-
// sampleSize: min (sampleSize; count data);
182-
// fn: $[ sampleFn ~ "random";
183-
// {[sampleSize; data]
184-
// $[ type[data] ~ 99h;
185-
// [ ii: neg[sampleSize]?count data;
186-
// (key[data] ii)!value[data]ii];
187-
// neg[sampleSize]?data]
188-
// };
189-
// sampleFn ~ "first"; #;
190-
// sampleFn ~ "last"; {neg[x]#y};
191-
// ' "Unrecognized sample function"];
192-
// fn[sampleSize; data]
193-
// }
180+
sample: {[sampleFn; sampleSize; data]
181+
sampleSize: min (sampleSize; count data);
182+
fn: $[ sampleFn ~ "random";
183+
{[sampleSize; data]
184+
$[ type[data] ~ 99h;
185+
[ ii: neg[sampleSize]?count data;
186+
(key[data] ii)!value[data]ii];
187+
neg[sampleSize]?data]
188+
};
189+
sampleFn ~ "first"; #;
190+
sampleFn ~ "last"; {neg[x]#y};
191+
' "Unrecognized sample function"];
192+
fn[sampleSize; data]
193+
}
194194
result: evalInContext[ctx; splitExpression stripTrailingSemi wrapLines removeMultilineComments code];
195195
if[result `errored; :result];
196196
if[type[result[`result]] = 99h;

0 commit comments

Comments
 (0)