Skip to content

Commit

Permalink
add data_passable test
Browse files Browse the repository at this point in the history
  • Loading branch information
DE0CH committed Dec 21, 2022
1 parent 8153779 commit d310eb8
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/test_data_passable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import numpy as np
from irace import irace
import pandas as pd
from multiprocessing import Queue

q = Queue()

def target_runner(experiment, scenario):
q.put(124)
if experiment['configuration']['one'] == '0':
return dict(cost=0)
else:
return dict(cost=1)


params = '''
one "" c ('0', '1')
two "" c ("a", "b") | one == '1'
three "" r (0, 1) | one == '1'
four "" i (1, 10) | one == '1'
'''

scenario = dict(
instances = np.arange(10),
maxExperiments = 180,
debugLevel = 0,
parallel = 1,
logFile = "",
seed = 123
)


def test():
tuner = irace(scenario, params, target_runner)
best_conf = tuner.run()
assert q.get() == 124

0 comments on commit d310eb8

Please sign in to comment.