<commit_before>from __future__ import print_function, division, unicode_literals

from constants import FN_PARSE_LPT_REGEX_FILENAME as _RGX_FNAME
from constants import FN_PARSE_NCSMVCE_LPT_REGEX_DNAME as _RGX_DNAME_GGP
from ncsm_vce_lpt.ExpNcsmVceLpt import ExpNcsmVceLpt
from ncsm_vce_lpt.parser import exp
from nushellx_lpt.DataMapNushellxLpt import DataMapNushellxLpt


class DataMapNcsmVceLpt(DataMapNushellxLpt):
    """Data type that stores a map to *.lpt file data, generated by NuShellX
    on interaction files from a VCE of NCSM results
    """
    # noinspection PyUnusedLocal
    def __init__(
            self, parent_directory, exp_list=None, exp_filter_fn=None,
            _regex_filename=_RGX_FNAME, _regex_ggparent_dir=_RGX_DNAME_GGP,
            **kwargs
    ):
        super(DataMapNcsmVceLpt, self).__init__(
            parent_directory=parent_directory,
            exp_list=exp_list, exp_filter_fn=exp_filter_fn,
            _exp_type=ExpNcsmVceLpt,
            _regex_filename=_regex_filename,
            _regex_ggparent_dir=_regex_ggparent_dir
        )

    def _exp_from_file_path(self, f):
        return exp(filepath=f)<commit_msg>New method for DataMapNcsmVceLpt, which may or may not prove useful<commit_after>from __future__ import print_function, division, unicode_literals

from constants import FN_PARSE_LPT_REGEX_FILENAME as _RGX_FNAME
from constants import FN_PARSE_NCSMVCE_LPT_REGEX_DNAME as _RGX_DNAME_GGP
from ncsm_vce_lpt.ExpNcsmVceLpt import ExpNcsmVceLpt
from ncsm_vce_lpt.parser import exp
from nushellx_lpt.DataMapNushellxLpt import DataMapNushellxLpt


class DataMapNcsmVceLpt(DataMapNushellxLpt):
    """Data type that stores a map to *.lpt file data, generated by NuShellX
    on interaction files from a VCE of NCSM results
    """
    # noinspection PyUnusedLocal
    def __init__(
            self, parent_directory, exp_list=None, exp_filter_fn=None,
            _regex_filename=_RGX_FNAME, _regex_ggparent_dir=_RGX_DNAME_GGP,
            **kwargs
    ):
        super(DataMapNcsmVceLpt, self).__init__(
            parent_directory=parent_directory,
            exp_list=exp_list, exp_filter_fn=exp_filter_fn,
            _exp_type=ExpNcsmVceLpt,
            _regex_filename=_regex_filename,
            _regex_ggparent_dir=_regex_ggparent_dir
        )

    def _exp_from_file_path(self, f):
        return exp(filepath=f)

    def a_eq_aeff_to_ground_state_energy_map(self, z, nhw, n1, n2, nshell,
                                             ncomponent):
        def f(exp0):
            return (exp0.Z == z and
                    exp0.A_presc[0] == exp0.A_presc[1] == exp0.A_presc[2] and
                    exp0.Nhw == nhw and exp0.n1 == n1 and exp0.n2 == n2 and
                    exp0.nshell == nshell and exp0.ncomponent == ncomponent)
        a_eq_aeff_map = dict()
        for e in filter(f, self.map.keys()):
            m = self[e].mass_ground_energy_map()
            a = e.A_presc[0]
            if a in m:
                a_eq_aeff_map[a] = m[a]
        return a_eq_aeff_map
{'fraction_non_alphanumeric': 0.06336178594878529, 'fraction_numerical': 0.006565988181221274, 'mean_word_length': 2.962288686605982, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7542187', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1081, 'n_words': 216}