<commit_before>use MRA;
use MadAnalytics;

config const k      = 5;
config const thresh = 1e-5;

def main() {
    var npt = 10;

    writeln("Mad Chapel -- Show me the boxes\n");

    var fcn  = Fn_Test1();
    var dfcn = Fn_dTest1();

    var F = Function(k=k, thresh=thresh, f=fcn);

    writeln("F.norm2() = ", F.norm2());
    F.summarize();
    F.evalNPT(npt);

    writeln("\nDumping the boxes at each level:");
    
    for lvl in 0..F.max_level { 
        write("\n **",lvl,": ");
        for (n, l) in F.sumC.indices do
            if n == lvl then write(" [",n,", ",l,"]");
    }
}
<commit_msg>Replaced iterator in test_showboxes to use index_iter().<commit_after>use MRA;
use MadAnalytics;

config const k      = 5;
config const thresh = 1e-5;

def main() {
    var npt = 10;

    writeln("Mad Chapel -- Show me the boxes\n");

    var fcn  = Fn_Test1();
    var dfcn = Fn_dTest1();

    var F = Function(k=k, thresh=thresh, f=fcn);

    writeln("F.norm2() = ", F.norm2());
    F.summarize();
    F.evalNPT(npt);

    writeln("\nDumping the boxes at each level:");
    
    for lvl in 0..F.max_level { 
        write("\n **",lvl,": ");
        for (n, l) in F.sumC.index_iter() do
            if n == lvl then write(" [",n,", ",l,"]");
    }
}

{'fraction_non_alphanumeric': 0.17942583732057416, 'fraction_numerical': 0.01594896331738437, 'mean_word_length': 2.3377659574468086, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4146857', 'n_tokens_mistral': 518, 'n_tokens_neox': 490, 'n_words': 132}