<commit_before>import numpy as np
import yaml
import os
from perses.analysis import Analysis
import glob

def collect_file_conditions(experiment_directory):
    """
    Collect the experiment files for each condition of phase, ncmc steps, sterics, and geometry intervals.
    This assumes there is one output for each experimental condition.

    Parameters
    ----------
    experiment_directory : str
        The path to where the experiments were conducted

    Returns
    -------
    condition_files : dict of tuple: str
        The filename for each condition
    """
    condition_files = {}
    yaml_filenames = glob.glob(os.path.join(experiment_directory, "*.yaml"))
    for filename in yaml_filenames:
        with open(filename, 'r') as yamlfile:
            experiment_options = yaml.load(yamlfile)
            phase = "explicit" if experiment_options['phase'] == "solvent" else "vacuum"
            data_filename = experiment_options['output_filename']
            ncmc_length = experiment_options['ncmc_switching_times'][phase]
            sterics = experiment_options['use_sterics'][phase]
            geometry_intervals = experiment_options['geometry_divisions'][phase]

            condition_files[(phase, ncmc_length, sterics, geometry_intervals)] = data_filename

    return condition_files

def collect_logP_accept(condition_files):<commit_msg>correct filename<commit_after>import numpy as np
import yaml
import os
from perses.analysis import Analysis
import glob

def collect_file_conditions(experiment_directory):
    """
    Collect the experiment files for each condition of phase, ncmc steps, sterics, and geometry intervals.
    This assumes there is one output for each experimental condition.

    Parameters
    ----------
    experiment_directory : str
        The path to where the experiments were conducted

    Returns
    -------
    condition_files : dict of tuple: str
        The filename for each condition
    """
    condition_files = {}
    yaml_filenames = glob.glob(os.path.join(experiment_directory, "*.yaml"))
    for filename in yaml_filenames:
        with open(filename, 'r') as yamlfile:
            experiment_options = yaml.load(yamlfile)
            phase = "explicit" if experiment_options['phase'] == "solvent" else "vacuum"
            if experiment_options['phase'] == 'multitarget':
                continue
            data_filename = experiment_options['output_filename']
            ncmc_length = experiment_options['ncmc_switching_times'][experiment_options['phase']]
            sterics = experiment_options['use_sterics'][phase]
            geometry_intervals = experiment_options['geometry_divisions'][phase]

            condition_files[(phase, ncmc_length, sterics, geometry_intervals)] = os.path.join(experiment_directory, data_filename)

    return condition_files

def collect_logP_accept(condition_files):
{'fraction_non_alphanumeric': 0.0862009037191519, 'fraction_numerical': 0.0, 'mean_word_length': 3.3343373493975905, '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': '5554327', 'n_tokens_mistral': 753, 'n_tokens_neox': 741, 'n_words': 209}