<commit_before>import os
import logging
import socket
from dessn.framework.fitter import Fitter
from dessn.framework.models.full_model import FullModel
from dessn.framework.simulations.snana import SNANASimulationGauss0p3, SNANASimulationLowzGauss0p3

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    dir_name = os.path.dirname(os.path.abspath(__file__)) + "/output/" + os.path.basename(__file__)[:-3]
    plot_dir = os.path.dirname(os.path.abspath(__file__)) + "/plots/"
    plot_filename = plot_dir + os.path.basename(__file__)[:-3] + ".png"
    file = os.path.abspath(__file__)
    print(dir_name)

    if not os.path.exists(dir_name):
        os.makedirs(dir_name)

    if not os.path.exists(plot_dir):
        os.makedirs(plot_dir)

    num_nodes = 1

    model = FullModel(num_nodes=num_nodes)
    # Turn off mass and skewness for easy test
    simulation = [SNANASimulationLowzGauss0p3(200), SNANASimulationGauss0p3(300)]

    fitter = Fitter(dir_name)
    fitter.set_models(model)
    fitter.set_simulations(simulation)

    h = socket.gethostname()
    if h != "smp-hk5pn72":  # The hostname of my laptop. Only will work for me, ha!
        fitter.fit(file)
    else:
        from chainconsumer import ChainConsumer
        m, s, chain, truth, weight, old_weight, posterior = fitter.load()
        chain["w"] = old_weight
        c = ChainConsumer()
        c.add_chain(chain, weights=weight, posterior=posterior, name="Stan")
        c.configure(color_params="w")<commit_msg>More cosmologies<commit_after>import os
import logging
import socket
from dessn.framework.fitter import Fitter
from dessn.framework.models.full_model import FullModel
from dessn.framework.simulations.snana import SNANASimulationGauss0p3, SNANASimulationLowzGauss0p3

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    dir_name = os.path.dirname(os.path.abspath(__file__)) + "/output/" + os.path.basename(__file__)[:-3]
    plot_dir = os.path.dirname(os.path.abspath(__file__)) + "/plots/"
    plot_filename = plot_dir + os.path.basename(__file__)[:-3] + ".png"
    file = os.path.abspath(__file__)
    print(dir_name)

    if not os.path.exists(dir_name):
        os.makedirs(dir_name)

    if not os.path.exists(plot_dir):
        os.makedirs(plot_dir)

    num_nodes = 1

    model = FullModel(num_nodes=num_nodes)
    # Turn off mass and skewness for easy test
    simulation = [SNANASimulationLowzGauss0p3(200), SNANASimulationGauss0p3(300)]

    fitter = Fitter(dir_name)
    fitter.set_models(model)
    fitter.set_simulations(simulation)
    fitter.set_num_cosmologies(300)
    fitter.set_num_walkers(1)

    h = socket.gethostname()
    if h != "smp-hk5pn72":  # The hostname of my laptop. Only will work for me, ha!
        fitter.fit(file)
    else:
        from chainconsumer import ChainConsumer
        m, s, chain, truth, weight, old_weight, posterior = fitter.load()
        chain["w"] = old_weight
        c = ChainConsumer()
        c.add_chain(chain, weights=weight, posterior=posterior, name="Stan")
        c.configure(color_params="w")
{'fraction_non_alphanumeric': 0.11315874555447786, 'fraction_numerical': 0.014225670869705788, 'mean_word_length': 3.716463414634146, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4612094', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1063, 'n_words': 208}