Chromium Code Reviews| Index: scripts/slave/recipe_modules/auto_bisect/resources/significantly_different.py |
| diff --git a/scripts/slave/recipe_modules/auto_bisect/resources/significantly_different.py b/scripts/slave/recipe_modules/auto_bisect/resources/significantly_different.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0938cdb3c3c49839cb3c28d861dd52d8e328daf0 |
| --- /dev/null |
| +++ b/scripts/slave/recipe_modules/auto_bisect/resources/significantly_different.py |
| @@ -0,0 +1,33 @@ |
| +"""Launches an anaconda environment to run some scipy hypothesis tests.""" |
| + |
| +import json |
| +import os |
| +import subprocess |
| +import sys |
| + |
| +class ScipyNotInstalledError(Exception): |
| + pass |
| + |
| +def main(argv, anaconda_path=None): |
| + if not anaconda_path: |
| + if os.name == 'nt': |
| + anaconda_path = r'c:\conda-py-scientific\bin\python' |
|
Vadim Sh.
2016/02/12 00:17:12
It is actually C:\conda-py-scientific\python.exe (
Vadim Sh.
2016/02/12 00:36:14
Oh, and also clear PYTHONPATH environ variable whe
|
| + else: |
| + anaconda_path = '/opt/conda-py-scientific/bin/python' |
| + if not os.path.exists(anaconda_path): |
| + raise ScipyNotInstalledError() |
| + |
| + _, list_a, list_b, significance = argv |
| + |
| + inner_script_location = os.path.join(os.path.dirname(os.path.realpath( |
| + __file__)), 'significantly_different_inner.py') |
| + |
| + return json.loads(subprocess.check_output([ |
| + anaconda_path, inner_script_location,list_a, list_b, significance])) |
| + |
| +if __name__ == '__main__': |
| + result = main(sys.argv) |
| + if result: |
| + print json.dumps(result, indent=4) |
| + sys.exit(0) |
| + sys.exit(1) |