<commit_before>from __future__ import absolute_import, division, print_function

import os

from libtbx import easy_run


def test_rl_png_centroid_data(dials_data, run_in_tmpdir):
    data_dir = dials_data("centroid_test_data")
    experiments_path = (data_dir / "imported_experiments.json").strpath
    strong_pickle = (data_dir / "strong.pickle").strpath

    cmd = "dials.rl_png %s %s" % (experiments_path, strong_pickle)
    result = easy_run.fully_buffered(command=cmd).raise_if_errors()

    for s in (
        "beam_vector",
        "e3",
        "rotation_axis",
        "solution_1",
        "solution_2",
        "solution_3",
    ):
        assert os.path.exists("rl_%s.png" % s), s


def test_rl_png_refinement_data(dials_regression, run_in_tmpdir):
    data_dir = os.path.join(dials_regression, "refinement_test_data", "i04_weak_data")
    experiments_path = os.path.join(data_dir, "experiments.json")
    indexed_pickle = os.path.join(data_dir, "indexed_strong.pickle")

    cmd = "dials.rl_png %s %s" % (experiments_path, indexed_pickle)
    result = easy_run.fully_buffered(command=cmd).raise_if_errors()

    for s in ("beam_vector", "e3", "rotation_axis", "a", "b", "c"):
        assert os.path.exists("rl_%s.png" % s), s
<commit_msg>Reinstate more accurate test name<commit_after>from __future__ import absolute_import, division, print_function

import os

from libtbx import easy_run


def test_rl_png_imported_experiments(dials_data, run_in_tmpdir):
    data_dir = dials_data("centroid_test_data")
    experiments_path = (data_dir / "imported_experiments.json").strpath
    strong_pickle = (data_dir / "strong.pickle").strpath

    cmd = "dials.rl_png %s %s" % (experiments_path, strong_pickle)
    result = easy_run.fully_buffered(command=cmd).raise_if_errors()

    for s in (
        "beam_vector",
        "e3",
        "rotation_axis",
        "solution_1",
        "solution_2",
        "solution_3",
    ):
        assert os.path.exists("rl_%s.png" % s), s


def test_rl_png_refinement_data(dials_regression, run_in_tmpdir):
    data_dir = os.path.join(dials_regression, "refinement_test_data", "i04_weak_data")
    experiments_path = os.path.join(data_dir, "experiments.json")
    indexed_pickle = os.path.join(data_dir, "indexed_strong.pickle")

    cmd = "dials.rl_png %s %s" % (experiments_path, indexed_pickle)
    result = easy_run.fully_buffered(command=cmd).raise_if_errors()

    for s in ("beam_vector", "e3", "rotation_axis", "a", "b", "c"):
        assert os.path.exists("rl_%s.png" % s), s

{'fraction_non_alphanumeric': 0.12643224022125643, 'fraction_numerical': 0.005531410509679968, 'mean_word_length': 4.053892215568863, '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': '7298712', 'n_tokens_mistral': 940, 'n_tokens_neox': 915, 'n_words': 160}