<commit_before><commit_msg>script testing hydro and p2g algorithms<commit_after>import unittest
import energyPATHWAYS
import numpy as np
import pandas as pd
import pylab
import os
import time
from energyPATHWAYS.dispatch_classes import Dispatch
import math
import copy
from ddt import ddt, data, unpack


data_dir = os.path.join(os.getcwd(), 'test_dispatch_data')

load = pd.DataFrame.from_csv(os.path.join(data_dir, 'load.csv'))['Load 2']
load = load.values.flatten()
load*=20000000

dispatch_periods = pd.DataFrame.from_csv(os.path.join(data_dir, 'dispatch_periods.csv'))
dispatch_periods = dispatch_periods['month'].values.flatten()

pmins = np.array([-1500]*12)
pmaxs = np.array([5000]*12)
energy = np.array([100000]*12)

test = Dispatch.dispatch_to_energy_budget(load, energy_budgets=energy, dispatch_periods=dispatch_periods, pmins=pmins, pmaxs=pmaxs)

pylab.plot(load)
pylab.plot(load-test)
pylab.plot(test)
{'fraction_non_alphanumeric': 0.12035010940919037, 'fraction_numerical': 0.03282275711159737, 'mean_word_length': 7.318181818181818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '6712013', 'n_tokens_mistral': 346, 'n_tokens_neox': 320, 'n_words': 67}