<commit_before>#!/bin/python
import random
import json
import csv
from deap import tools


import promoterz
import evaluation
from . import TOMLutils

from japonicus.interface import showBacktestResult


def showResults(World):
    validationDatasets = []
    # IS EVALUATION DATASET LOADED? USE IT;
    if World.EnvironmentParameters['evaluation']:
        useSecondary = 'evaluation'
    else:
        useSecondary = 'evolution'

    # LOAD EVALUATION DATASET;
    sourceDataset = random.choice(World.EnvironmentParameters[useSecondary])
    getter = evaluation.gekko.datasetOperations.getRandomSectorOfDataset
    for NB in range(World.evalbreakconf.proofSize):
        newDataset = getter(sourceDataset, World.backtestconf.deltaDays)
        validationDatasets.append(newDataset)

    for LOCALE in World.locales:
        LOCALE.population = [ind for ind in LOCALE.population
                             if ind.fitness.valid]

        # SELECT BEST INDIVIDUALS;
        B = World.evalbreakconf.NBBESTINDS
        BestIndividues = tools.selBest(LOCALE.population, B)
        Z = min(World.evalbreakconf.NBADDITIONALINDS,
                len(LOCALE.population) - B)<commit_msg>details of config handling changed.<commit_after>#!/bin/python
import random
import json
import csv
from deap import tools


import promoterz
import evaluation
from . import TOMLutils

from japonicus.interface import showBacktestResult


def showResults(World):
    validationDatasets = []
    # IS EVALUATION DATASET LOADED? USE IT;
    if World.EnvironmentParameters['evaluation']:
        useSecondary = 'evaluation'
    else:
        useSecondary = 'evolution'

    # LOAD EVALUATION DATASET;
    sourceDataset = random.choice(World.EnvironmentParameters[useSecondary])
    getter = evaluation.gekko.datasetOperations.getRandomSectorOfDataset
    for NB in range(World.conf.evalbreak.proofSize):
        newDataset = getter(sourceDataset, World.conf.backtest.deltaDays)
        validationDatasets.append(newDataset)

    for LOCALE in World.locales:
        LOCALE.population = [ind for ind in LOCALE.population
                             if ind.fitness.valid]

        # SELECT BEST INDIVIDUALS;
        B = World.conf.evalbreak.NBBESTINDS
        BestIndividues = tools.selBest(LOCALE.population, B)
        Z = min(World.conf.evalbreak.NBADDITIONALINDS,
                len(LOCALE.population) - B)
{'fraction_non_alphanumeric': 0.07585917854149203, 'fraction_numerical': 0.0, 'mean_word_length': 3.173076923076923, 'pattern_counts': {'":': 0, '<': 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': '7031133', 'n_tokens_mistral': 721, 'n_tokens_neox': 695, 'n_words': 157}