-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_kit.py
37 lines (32 loc) · 1.28 KB
/
test_kit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
from subprocess import call
from rampwf.utils import assert_submission, assert_notebook
os.environ['RAMP_TEST_MODE'] = '1'
def test_submission_kit():
kit = os.environ['RAMP_KIT']
kit_dir = os.getcwd()
# download the data if necessary
filename_download = os.path.join(kit_dir, 'download_data.py')
if os.path.isfile(filename_download):
call("python {}".format(filename_download), shell=True)
# testing assert_notebook and optional switches on titanic
if kit == 'titanic':
assert_notebook(ramp_kit_dir=kit_dir)
assert_submission(
ramp_kit_dir=kit_dir, ramp_data_dir=kit_dir,
submission='starting_kit', is_pickle=True,
save_output=True, retrain=True)
elif kit == 'autism':
assert_submission(
ramp_kit_dir=kit_dir, ramp_data_dir=kit_dir,
submission='starting_kit_anatomy')
assert_submission(
ramp_kit_dir=kit_dir, ramp_data_dir=kit_dir,
submission='starting_kit_functional')
assert_submission(
ramp_kit_dir=kit_dir, ramp_data_dir=kit_dir,
submission='combine_anatomy_functional')
else:
assert_submission(
ramp_kit_dir=kit_dir, ramp_data_dir=kit_dir,
submission='starting_kit')