<commit_before>/** This namespace contains functions to process an update to an member
 * which inherits from the FunctionBase component. */
apogee.calculation = {};


/** This moethod should be called on an member (impactor or dependent) that changes.
 * This will allow for any Dependents to be recaculated.
 * @private */
apogee.calculation.addToRecalculateList = function(recalculateList,member) {
    //if it is in the list, return
    if(recalculateList.indexOf(member) >= 0) return;
     
    //add this member to recalculate list if it needs to be executed
    if((member.isDependent)&&(member.needsCalculating())) {
        recalculateList.push(member);
        member.prepareForCalculate();
    }
        
    apogee.calculation.addDependsOnToRecalculateList(recalculateList,member);
}

apogee.calculation.addDependsOnToRecalculateList = function(recalculateList,member) {
    //add any member that depends on this one    
    var impactsList = member.getImpactsList();
    for(var i = 0; i < impactsList.length; i++) {
        apogee.calculation.addToRecalculateList(recalculateList,impactsList[i]);
    }
}



/** This calls execute for each member in the recalculate list. The return value
 * is false if there are any errors.
 * @private */
apogee.calculation.callRecalculateList = function(recalculateList,actionResponse) {
    var dependent;
    var i;
    var success = true;
    for(i = 0; i < recalculateList.length; i++) {
        dependent = recalculateList[i];
        if(dependent.getCalcPending()) {
            dependent.calculate();   
            if(dependent.hasError()) {
                var actionErrors = dependent.getErrors();
                if(actionErrors) {
                    for(var j = 0; j < actionErrors.length; j++) {
                        actionResponse.addError(actionErrors[j]);
                    }
                }
                success = false;
            }
        }
    }
    
    return success;
}<commit_msg>in the workspace calculation, we no longer pass member errors (such as syntax error in user code) as errors in the action response. These are treated as success - with errors handled internally (by displaying banner)<commit_after>/** This namespace contains functions to process an update to an member
 * which inherits from the FunctionBase component. */
apogee.calculation = {};


/** This moethod should be called on an member (impactor or dependent) that changes.
 * This will allow for any Dependents to be recaculated.
 * @private */
apogee.calculation.addToRecalculateList = function(recalculateList,member) {
    //if it is in the list, return
    if(recalculateList.indexOf(member) >= 0) return;
     
    //add this member to recalculate list if it needs to be executed
    if((member.isDependent)&&(member.needsCalculating())) {
        recalculateList.push(member);
        member.prepareForCalculate();
    }
        
    apogee.calculation.addDependsOnToRecalculateList(recalculateList,member);
}

apogee.calculation.addDependsOnToRecalculateList = function(recalculateList,member) {
    //add any member that depends on this one    
    var impactsList = member.getImpactsList();
    for(var i = 0; i < impactsList.length; i++) {
        apogee.calculation.addToRecalculateList(recalculateList,impactsList[i]);
    }
}



/** This calls execute for each member in the recalculate list. The return value
 * is false if there are any errors.
 * @private */
apogee.calculation.callRecalculateList = function(recalculateList) {
    var dependent;
    var i;
    var success = true;
    for(i = 0; i < recalculateList.length; i++) {
        dependent = recalculateList[i];
        if(dependent.getCalcPending()) {
            dependent.calculate();   
        }
    }
    
    return success;
}
{'fraction_non_alphanumeric': 0.09517497348886532, 'fraction_numerical': 0.001855779427359491, 'mean_word_length': 2.963235294117647, 'pattern_counts': {'":': 0, '<': 8, '<?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': '1674440', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1052, 'n_words': 310}