Skip to content

Commit e37bb93

Browse files
committed
almost finished reinstatiating setups
1 parent af78436 commit e37bb93

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

openml/setups/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _reconstruct_flow(_flow, _params):
9595
# (obtained by using the subfunction _to_dict_of_dicts)
9696
for _param in _flow.parameters:
9797
_flow.parameters[_param] = _params[_flow.flow_id][_param]
98-
for _identifier in flow.components:
98+
for _identifier in _flow.components:
9999
_flow.components[_identifier] = _reconstruct_flow(_flow.components[_identifier], _params)
100100
return _flow
101101

openml/testing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class TestBase(unittest.TestCase):
1717
def setUp(self):
1818
# This cache directory is checked in to git to simulate a populated
1919
# cache
20+
self.maxDiff = None
2021
self.static_cache_dir = None
2122
static_cache_dir = os.path.dirname(os.path.abspath(inspect.getfile(self.__class__)))
2223

tests/test_runs/test_run_functions.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
class TestRun(TestBase):
2727

28-
def _perform_run(self, task_id, num_instances, clf):
28+
def _perform_run(self, task_id, num_instances, clf, check_setup=True):
2929
task = openml.tasks.get_task(task_id)
3030
run = openml.runs.run_task(task, clf, openml.config.avoid_duplicate_runs)
3131
run_ = run.publish()
@@ -34,6 +34,14 @@ def _perform_run(self, task_id, num_instances, clf):
3434

3535
# check arff output
3636
self.assertEqual(len(run.data_content), num_instances)
37+
38+
if check_setup:
39+
run_id = run_.run_id
40+
run_prime = openml.runs.get_run(run_id)
41+
clf_prime = openml.setups.initialize_model(run_prime.setup_id)
42+
self.assertEquals(clf.get_params(), clf_prime.get_params())
43+
# self.assertEquals(clf, clf_prime)
44+
3745
return run
3846

3947
def test_run_regression_on_classif_task(self):

0 commit comments

Comments
 (0)