<commit_before>import pytest
import numpy as np
import yaml
import re
import pandas

import toppra
import toppra.constraint as constraint
import toppra.algorithm as algo

# toppra.setup_logging(level="DEBUG")

# NOTE: Select problems to test with this regex.
problem_regex = ".*oa.*"


def test_robustness_main():
    """ Load problem suite based on regex, run test and report results.
    """
    # parse problems from a configuration file
    parsed_problems = []
    with open("retime_robustness/problem_suite_1.yaml", "r") as f:
        problem_dict = yaml.load(f.read())
    for key in problem_dict:
        if len(problem_dict[key]['ss_waypoints']) == 2:
            ss_waypoints = np.linspace(problem_dict[key]['ss_waypoints'][0],
                                       problem_dict[key]['ss_waypoints'][1],
                                       len(problem_dict[key]['waypoints']))

        for duration in problem_dict[key]['desired_duration']:
            for solver_wrapper in problem_dict[key]['solver_wrapper']:
                for nb_gridpoints in problem_dict[key]['nb_gridpoints']:
                    parsed_problems.append({
                        "name": key,
                        "problem_id": "{:}-{:5f}-{:}-{:}".format(key, duration, solver_wrapper, nb_gridpoints),<commit_msg>minor<commit_after>import pytest
import numpy as np
import yaml
import re
import pandas

import toppra
import toppra.constraint as constraint
import toppra.algorithm as algo

# toppra.setup_logging(level="DEBUG")

# NOTE: Select problems to test with this regex.
problem_regex = ".*oa.*"


def test_robustness_main():
    """ Load problem suite based on regex, run test and report results.
    """
    # parse problems from a configuration file
    parsed_problems = []
    with open("tests/retime_robustness/problem_suite_1.yaml", "r") as f:
        problem_dict = yaml.load(f.read())
    for key in problem_dict:
        if len(problem_dict[key]['ss_waypoints']) == 2:
            ss_waypoints = np.linspace(problem_dict[key]['ss_waypoints'][0],
                                       problem_dict[key]['ss_waypoints'][1],
                                       len(problem_dict[key]['waypoints']))

        for duration in problem_dict[key]['desired_duration']:
            for solver_wrapper in problem_dict[key]['solver_wrapper']:
                for nb_gridpoints in problem_dict[key]['nb_gridpoints']:
                    parsed_problems.append({
                        "name": key,
                        "problem_id": "{:}-{:5f}-{:}-{:}".format(key, duration, solver_wrapper, nb_gridpoints),
{'fraction_non_alphanumeric': 0.11627014581734459, 'fraction_numerical': 0.003837298541826554, 'mean_word_length': 2.63091922005571, 'pattern_counts': {'":': 4, '<': 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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2487179', 'n_tokens_mistral': 782, 'n_tokens_neox': 742, 'n_words': 181}