<commit_before>var validateFloat = function(val) {
    if (typeof val != 'undefined') {
        val = parseFloat(val);
        if (! isNaN(val)) { 
            if (val > -99999 ) {
                return val;
            }
        }
    }
    return Infinity;
};

var enableFilter = function (id) {
    var f = window.app.filters.get(id);

    // FIXME: data keys are assumed to be lower case, but this is not checked/ensured
    var id_lower = id.toLowerCase();

    f._dx = window.app.crossfilter.dimension( function(d) {return validateFloat(d[id_lower]);});
    f.active = true;
};

var disableFilter = function (id) {
    var f = window.app.filters.get(id);

    f._dx.dispose();
    delete f._dx;
};

module.exports = {
    validateFloat: validateFloat,
    enableFilter: enableFilter,
    disableFilter: disableFilter,
};<commit_msg>Fix bug where filter was not set to inacative<commit_after>var validateFloat = function(val) {
    if (typeof val != 'undefined') {
        val = parseFloat(val);
        if (! isNaN(val)) { 
            if (val > -99999 ) {
                return val;
            }
        }
    }
    return Infinity;
};

var enableFilter = function (id) {
    var f = window.app.filters.get(id);

    // FIXME: data keys are assumed to be lower case, but this is not checked/ensured
    var id_lower = id.toLowerCase();

    f._dx = window.app.crossfilter.dimension( function(d) {return validateFloat(d[id_lower]);});
    f.active = true;
};

var disableFilter = function (id) {
    var f = window.app.filters.get(id);

    f._dx.dispose();
    delete f._dx;

    f.active = false;
};

module.exports = {
    validateFloat: validateFloat,
    enableFilter: enableFilter,
    disableFilter: disableFilter,
};
{'fraction_non_alphanumeric': 0.1286785920369302, 'fraction_numerical': 0.005770340450086555, 'mean_word_length': 2.468, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3045190', 'n_tokens_mistral': 552, 'n_tokens_neox': 538, 'n_words': 142}