-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcwl-eval
37 lines (29 loc) · 1.39 KB
/
cwl-eval
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
#!/usr/bin/env python
import os
import sys
from distutils.sysconfig import get_python_lib
if __name__ == '__main__':
# Work out the directory for the cwl scripts (in the site-packages directory)
site_packages_dir = get_python_lib()
cwl_dir = os.path.join(site_packages_dir, 'cwl')
#print(cwl_dir)
# If in developer mode, we can work this out from the current directory.
current_dir = os.path.dirname(os.path.realpath(__file__))
scripts_dir = os.path.join(current_dir, 'cwl')
#print(scripts_dir)
# Prepend the paths to the PYTHONPATH for this instance.
sys.path.insert(0, cwl_dir)
#sys.path.insert(0, os.path.join(cwl_dir,'cwl'))
sys.path.insert(0, scripts_dir)
#sys.path.insert(0, os.path.join(scripts_dir,'cwl'))
#print(os.path.join(scripts_dir,'cwl'))
# Now we should be able to import CWL without issue
from cwl import cwl_eval
# Parse the arguments, check that the files exist, and run!
args = cwl_eval.parse_args()
cwl_eval.check_file_exists(args.result_file)
cwl_eval.check_file_exists(args.gain_file)
cwl_eval.check_file_exists(args.cost_file)
cwl_eval.check_file_exists(args.metrics_file)
cwl_eval.main(args.result_file, args.gain_file, args.cost_file, args.metrics_file, args.bib_file,
args.colnames, args.residuals, args.max_gain, args.min_gain, args.max_cost, args.min_cost, args.max_depth)