<commit_before># -*- coding: utf-8 -*-
'''
Copyright (c) 2018 by <NAME>
This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY).
:author: <NAME>

This file holds the example code from the Rosenbrock tutorial web-documention.
'''

import unittest
try:
    import spotpy
except ImportError:
    import sys
    sys.path.append(".")
    import spotpy
import numpy as np
from spotpy.examples.spot_setup_rosenbrock import spot_setup
from spotpy.describe import describe

#https://docs.python.org/3/library/unittest.html

class TestAlgorithms(unittest.TestCase):

    # How many digits to match in case of floating point answers
    self.tolerance = 7
    #Create samplers for every algorithm:
    self.spot_setup=spot_setup()
    self.rep=1000
    self.timeout=10 #Given in Seconds

    self.parallel = "seq"
    self.dbformat = "csv"


    def test_mc(self):
        sampler=spotpy.algorithms.mc(self.spot_setup,parallel=self.parallel, dbname='Rosen', dbformat=self.dbformat, sim_timeout=self.timeout)
        results = sampler.sample(self.rep)<commit_msg>Implement use of __init__ in test class<commit_after># -*- coding: utf-8 -*-
'''
Copyright (c) 2018 by <NAME>
This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY).
:author: <NAME>

This file holds the example code from the Rosenbrock tutorial web-documention.
'''

import unittest
try:
    import spotpy
except ImportError:
    import sys
    sys.path.append(".")
    import spotpy
import numpy as np
from spotpy.examples.spot_setup_rosenbrock import spot_setup
from spotpy.describe import describe

#https://docs.python.org/3/library/unittest.html

class TestAlgorithms(unittest.TestCase):
    def __init__(self):
        # How many digits to match in case of floating point answers
        self.tolerance = 7
        #Create samplers for every algorithm:
        self.spot_setup = spot_setup()
        self.rep = 1000
        self.timeout = 10 #Given in Seconds

        self.parallel = "seq"
        self.dbformat = "csv"

    def test_mc(self):
        sampler=spotpy.algorithms.mc(self.spot_setup,parallel=self.parallel, dbname='Rosen', dbformat=self.dbformat, sim_timeout=self.timeout)
        results = sampler.sample(self.rep)
{'fraction_non_alphanumeric': 0.09615384615384616, 'fraction_numerical': 0.011627906976744186, 'mean_word_length': 3.6507276507276507, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1991344', 'n_tokens_mistral': 707, 'n_tokens_neox': 668, 'n_words': 200}