Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:14

0001 #include "SSys.hh"
0002 #include "OPTICKS_LOG.hh"
0003 
0004 
0005 void test_ImportOpticks()
0006 {
0007     LOG(info);
0008     SSys::run("python -c 'import opticks'"); 
0009 }
0010 
0011 void test_ImportNumPy()
0012 {
0013     LOG(info);
0014     SSys::run("python -c 'import numpy'"); 
0015 }
0016 
0017 void test_python_numpy()
0018 {
0019     LOG(info); 
0020     SSys::run("python -c 'import numpy as np ; print(np.__version__)'" ); 
0021 }
0022 
0023 void test_ResolvePython()
0024 {
0025     const char* p = SSys::ResolvePython(); 
0026     LOG(info) << " p " << p ; 
0027 }
0028 
0029 void test_RunPythonScript()
0030 {
0031     const char* script = "np.py" ; 
0032     int rc = SSys::RunPythonScript(script); 
0033     LOG(info) 
0034        << " script " << script 
0035        << " rc " << rc
0036        ;
0037 }
0038 
0039 void test_RunPythonCode()
0040 {
0041     const char* code = "import numpy as np ; print(np.__version__)" ; 
0042     int rc = SSys::RunPythonCode(code); 
0043     LOG(info) 
0044        << " code " << code 
0045        << " rc " << rc
0046        ;
0047 }
0048 
0049 int main(int argc , char** argv )
0050 {
0051     OPTICKS_LOG(argc, argv);
0052 
0053     test_ImportOpticks();
0054     test_ImportNumPy();
0055     test_python_numpy(); 
0056     test_ResolvePython(); 
0057     test_RunPythonScript(); 
0058     test_RunPythonCode(); 
0059 
0060     return 0  ; 
0061 }
0062