Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 """Launches an anaconda environment to run some scipy hypothesis tests.""" | |
| 2 | |
| 3 import json | |
| 4 import os | |
| 5 import subprocess | |
| 6 import sys | |
| 7 | |
| 8 class ScipyNotInstalledError(Exception): | |
| 9 pass | |
| 10 | |
| 11 def main(argv, anaconda_path=None): | |
| 12 if not anaconda_path: | |
| 13 if os.name == 'nt': | |
| 14 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
| |
| 15 else: | |
| 16 anaconda_path = '/opt/conda-py-scientific/bin/python' | |
| 17 if not os.path.exists(anaconda_path): | |
| 18 raise ScipyNotInstalledError() | |
| 19 | |
| 20 _, list_a, list_b, significance = argv | |
| 21 | |
| 22 inner_script_location = os.path.join(os.path.dirname(os.path.realpath( | |
| 23 __file__)), 'significantly_different_inner.py') | |
| 24 | |
| 25 return json.loads(subprocess.check_output([ | |
| 26 anaconda_path, inner_script_location,list_a, list_b, significance])) | |
| 27 | |
| 28 if __name__ == '__main__': | |
| 29 result = main(sys.argv) | |
| 30 if result: | |
| 31 print json.dumps(result, indent=4) | |
| 32 sys.exit(0) | |
| 33 sys.exit(1) | |
| OLD | NEW |