diff --git a/c/todo.txt b/c/todo.txt index f99d31fa3..00725adcf 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -59,11 +59,46 @@ FIX: * mlr --oxtab put -q @v = $*; end {emit @v } ./reg_test/input/abixy-het --> has 10 fields -- not desired. -* basenaming syntax for subselector emits - * mlr --opprint put -q '@v[NR]=$*; end{emit @v[1],"X"}' ../data/small --> runs out of data and should not +* do more oosvar experiments before finalizing mlr4 + +! tri-split-null wrong-looking: + $ mlr put -q @sum += $x; end{emit @sum} ./reg_test/input/abixy-het + sum= + + $ mlr put -q '@sum += $x; @sumtype = typeof(@sum); @xtype = typeof($x); emitf @sumtype, @xtype, @sum; end{emit @sum}' ./reg_test/input/abixy-het + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=0.346790 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.105470 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.310073 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.691473 + sumtype=MT_VOID,xtype=MT_ABSENT,sum= + sumtype=MT_VOID,xtype=MT_FLOAT,sum= + sumtype=MT_VOID,xtype=MT_FLOAT,sum= + sumtype=MT_VOID,xtype=MT_FLOAT,sum= + sumtype=MT_VOID,xtype=MT_FLOAT,sum= + sumtype=MT_VOID,xtype=MT_FLOAT,sum= + sum= + + mlr put -q '@sum += $x; @sumtype = typeof(@sum); @xtype = typeof($x); emitf @sumtype, @xtype, @sum; end{emit @sum}' ./reg_test/input/abixy + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=0.346790 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.105470 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.310073 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=1.691473 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=2.264762 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=2.791888 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=3.403672 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=4.002226 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=4.033668 + sumtype=MT_FLOAT,xtype=MT_FLOAT,sum=4.536294 + sum=4.536294 + +---------------------------------------------------------------- +IMPLEMENT: + +* basenaming syntax for subselector emits + * mlr put -q '@v[NR]=$*; emit @v' ../data/small --> currently has field names v:a,v:x, etc -- think about a simpler option @@ -77,46 +112,13 @@ FIX: * cli-parameterize the joinchar (:) -* do more oosvar experiments before finalizing mlr4 - ---------------------------------------------------------------- UT: -* define/test behavior for null-valued filter/gate +* define/test behavior for null-valued filter / cond-block * evolve & extend the existing UTs -* ut/t-mlhm: assert on contents of sllv of plrec w basenaming syntax for subselector emits (once it exists!) -! tri-split-null wrong-looking: - $ mlr put -q @sum += $x; end{emit @sum} ./reg_test/input/abixy-het - sum= - - $ mlr put -q '@sum += $x; @t = typeof(@sum); @u = typeof($x); emitf @t, @u, @sum; end{emit @sum}' ./reg_test/input/abixy-het - t=MT_FLOAT,u=MT_FLOAT,sum=0.346790 - t=MT_FLOAT,u=MT_FLOAT,sum=1.105470 - t=MT_FLOAT,u=MT_FLOAT,sum=1.310073 - t=MT_FLOAT,u=MT_FLOAT,sum=1.691473 - t=MT_VOID,u=MT_ABSENT,sum= - t=MT_VOID,u=MT_FLOAT,sum= - t=MT_VOID,u=MT_FLOAT,sum= - t=MT_VOID,u=MT_FLOAT,sum= - t=MT_VOID,u=MT_FLOAT,sum= - t=MT_VOID,u=MT_FLOAT,sum= - sum= - - mlr put -q '@sum += $x; @t = typeof(@sum); @u = typeof($x); emitf @t, @u, @sum; end{emit @sum}' ./reg_test/input/abixy - t=MT_FLOAT,u=MT_FLOAT,sum=0.346790 - t=MT_FLOAT,u=MT_FLOAT,sum=1.105470 - t=MT_FLOAT,u=MT_FLOAT,sum=1.310073 - t=MT_FLOAT,u=MT_FLOAT,sum=1.691473 - t=MT_FLOAT,u=MT_FLOAT,sum=2.264762 - t=MT_FLOAT,u=MT_FLOAT,sum=2.791888 - t=MT_FLOAT,u=MT_FLOAT,sum=3.403672 - t=MT_FLOAT,u=MT_FLOAT,sum=4.002226 - t=MT_FLOAT,u=MT_FLOAT,sum=4.033668 - t=MT_FLOAT,u=MT_FLOAT,sum=4.536294 - sum=4.536294 - ---------------------------------------------------------------- DOC: @@ -143,9 +145,10 @@ HYG: ================================================================ OOSVAR EXPERIMENTS: -* what userspace data structures (and maybe new functions? keywords/control?) would be needed for: * check for functionality -- this is my best chance to do a full-featuredness check for oosvars & emit * also do timing comparisons + +* list: - bootstrap? - count-distinct? - cut? diff --git a/c/unit_test/test_mlhmmv.c b/c/unit_test/test_mlhmmv.c index cc18d4103..f27586fbf 100644 --- a/c/unit_test/test_mlhmmv.c +++ b/c/unit_test/test_mlhmmv.c @@ -190,67 +190,6 @@ static char* test_depth_errors() { } // ---------------------------------------------------------------- -// $ mlr put -q '@sum[$a][$b][$i]=$x; end{dump}' ../data/small | mlr --ijson --oxtab cat -// sum:pan:pan:1=0.346790 -// sum:pan:wye:10=0.502626 -// sum:eks:pan:2=0.758680 -// sum:eks:wye:4=0.381399 -// sum:eks:zee:7=0.611784 -// sum:wye:wye:3=0.204603 -// sum:wye:pan:5=0.573289 -// sum:zee:pan:6=0.527126 -// sum:zee:wye:8=0.598554 -// sum:hat:wye:9=0.031442 - - -// $ mlr put -q '@sum[$a][$b][$i]=$x; end{emit @sum}' ../data/small -// sum:pan:pan:1=0.346790 -// sum:pan:wye:10=0.502626 -// sum:eks:pan:2=0.758680 -// sum:eks:wye:4=0.381399 -// sum:eks:zee:7=0.611784 -// sum:wye:wye:3=0.204603 -// sum:wye:pan:5=0.573289 -// sum:zee:pan:6=0.527126 -// sum:zee:wye:8=0.598554 -// sum:hat:wye:9=0.031442 - -// $ mlr put -q '@sum[$a][$b][$i]=$x; end{emit @sum, "a"}' ../data/small -// a=pan,sum:pan:1=0.346790 -// a=pan,sum:wye:10=0.502626 -// a=eks,sum:pan:2=0.758680 -// a=eks,sum:wye:4=0.381399 -// a=eks,sum:zee:7=0.611784 -// a=wye,sum:wye:3=0.204603 -// a=wye,sum:pan:5=0.573289 -// a=zee,sum:pan:6=0.527126 -// a=zee,sum:wye:8=0.598554 -// a=hat,sum:wye:9=0.031442 - -// $ mlr put -q '@sum[$a][$b][$i]=$x; end{emit @sum, "a","b"}' ../data/small -// a=pan,b=pan,sum:1=0.346790 -// a=pan,b=wye,sum:10=0.502626 -// a=eks,b=pan,sum:2=0.758680 -// a=eks,b=wye,sum:4=0.381399 -// a=eks,b=zee,sum:7=0.611784 -// a=wye,b=wye,sum:3=0.204603 -// a=wye,b=pan,sum:5=0.573289 -// a=zee,b=pan,sum:6=0.527126 -// a=zee,b=wye,sum:8=0.598554 -// a=hat,b=wye,sum:9=0.031442 - -// $ mlr put -q '@sum[$a][$b][$i]=$x; end{emit @sum, "a","b","i"}' ../data/small -// a=pan,b=pan,i=1,sum=0.346790 -// a=pan,b=wye,i=10,sum=0.502626 -// a=eks,b=pan,i=2,sum=0.758680 -// a=eks,b=wye,i=4,sum=0.381399 -// a=eks,b=zee,i=7,sum=0.611784 -// a=wye,b=wye,i=3,sum=0.204603 -// a=wye,b=pan,i=5,sum=0.573289 -// a=zee,b=pan,i=6,sum=0.527126 -// a=zee,b=wye,i=8,sum=0.598554 -// a=hat,b=wye,i=9,sum=0.031442 - static char* test_mlhmmv_to_lrecs() { printf("================================================================\n"); mlhmmv_t* pmap = mlhmmv_alloc();