Based on your screenshot you are using Ubuntu and a custom installation of MODE Solutions.
Verify if the Python Integration Status is Active when using your own installation of Python. i.e. running your Python script from
Our API will require
NumPy and SciPy. See our Knowledge Base guide for details:
Otherwise, check the box, to use our supplied Python and run your Python script from within our software, using the script file editor.
I ran the script below on Ubuntu 16.04 LTS using the default Python 2.7 that came with Ubuntu with numpy and scipy installed. MODE and FDTD were installed on the default location / installation folders.
import sys, numpy, scipy, imp
lumapi = imp.load_source("lumapi", "/opt/lumerical/mode/api/python/lumapi.py")
h = lumapi.open("mode")
# passing arguments to Lumerical
lumapi.putMatrix(h, "M", [[1,2,3],[4,5,6]])
# getting variables from Lumerical
test-ex.py (440 Bytes)
You will have to change the installation path for MODE Solutions on line 2 of my script to:
lumapi = imp.load_source("lumapi", " /home/aniruth/Research/MODE_Solutions-7.13.1882/opt/lumerical/mode/api/python/lumapi.py")
Hope this helps.
Tip: Search Knowledge Exchange (click here). To answer your questions or fix your problem quickly!
Please mark this as resolved if the issue has been fixed by this post. Thanks.