Python intregration error

#1

HI,
I am unable to run FDTD solver using Python script.
I used attached script to run the FDTD solver, it POP-up the solver window, but with an error. I checked the path of the API, it seems to be fine. Can someone help?
PS : Don’t suggest me to upgrade software, as I am already using updated version of FDTD (FDTD Solutions 2018b R1 (v8.20.1634) for Windows (64 bit)). I upgraded this version last week itself. My OS is Window 10.


pyapi_example.py.txt (5.1 KB)

0 Likes

#2

The error indicates you do not have the Automation API license for the Python Integration feature.

Please refer to this KB guide for more information on Python Integration:
https://kb.lumerical.com/en/index.html?installation_and_setup_python-integration.html

You can obtain a trial license for the Automation API from our trials downloads page:
-using the Custom Evalution button.

Cheers,
Lito

0 Likes

#3

There is no information on given link that I need to install the new license for Python integration with Lumerical. According to link, the API is already available in a specific folder (Windows: C:\Program Files\Lumerical$(PRODUCT)\api\python) and we need to just point that folder while importing this. The commands for importing this is following.

import imp
lumapi = imp.load_source("lumapi", "/opt/lumerical/interconnect/api/python/lumapi.py")

If I understood properly from this link, it does not require any additional license.
https://kb.lumerical.com/en/index.html?installation_and_setup_python-integration.html

Anyway, I visit to the link, https://www.lumerical.com/downloads/packages
and try to get the details. It seems like it will give me a trial license. So, I got a trial license from here. Now, I don’t understand what to do with this.
My system already has one license key, so if I try to enter this new key, it is basically asking me to deactivated previous license. This means this trial license will expire after one month. So, after that should I again need to go back to the previous license?

I mean this is really strange if I need an additional license just to integrate python with Lumerical. It must be simple as we already have integration of Matlab with Lumerical.

0 Likes

#4

Hi @visvas,

As shown from the screenshot I provided on the Python Integration page, the first Requirement is the Automation API license.

Yes, the Python API module is supplied with all our design tools. But using this and integrating with our tools will require a separate license.

For MATLAB API use and integration, there is no need for any separate license.

As for the trial license you obtained from our website for Windows. This is a NODE locked license, which is the default license type for this OS. It cannot be activated using the FlexNet license manager activation utility.

From the screenshot, you Purchased a Floating License for our design tools. Unfortunately, the NODE locked license cannot be mixed with a Floating license.

Please send a request for a Floating trial license for your existing Purchased Floating License to sales@lumerical.com.

Hope this clarifies everything.
Cheers,
Lito

0 Likes

#5

This is really said to know that Python integration (an open source software) required seprate license while Matlab doesn’t require it. It doesn’t make any sense for me. Anyhow one can not use Python integration without having your licenses of solver. So, it’s like visulizing something in Python is paid but in Matlab it’s free.
This request must be raise to management level to make it free.

SIncelry, nothing to cheers in this case. :frowning_face:

0 Likes

#6

Please feel free to raise your request in our Ideas Exchange.
https://ix.lumerical.com/

This is a portal where users can provide feedback and ideas on how to improve our tools. It will also allow other users to vote on your requests.

Cheers,
Lito

0 Likes

#7

Hello @lyap,

I was successful in installing the MODE solutions on my Ubuntu Machine, a big Thanks for that!

Now, I am trying to run a sample python integration program to run my nanowire_build_script.lsf file in MODE solutions. Please find my ModeTest.py file attached with this post. On running this file, I am getting the errors mentioned below.

Could you be able to tell me, what am I missing in ModeTest.py file?

How can I check whether I have An Automation API License?

Thanks!

ModeTest.py (186 Bytes)

0 Likes

#8

@aniruth1,

Sorry, as mentioned, Ubuntu is not a supported system.
Our Integration and APIs only works with Supported Systems.

-Lito


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.

0 Likes

#9

Hello @lyap,

I am trying to run the “Python_test.py” (attached) on my Linux machine. I am getting the errors mentioned in the screenshot below. Could you please help me in understanding these errors?

Python_test.py (554 Bytes)

Thanks,
Aniruddha

0 Likes

#10

@aniruth1,

Based on your screenshot you are using Ubuntu and a custom installation of MODE Solutions.

/home/aniruth/Research/MODE_Solutions-7.13.1882/opt/lumerical/mode/

Verify if the Python Integration Status is Active when using your own installation of Python. i.e. running your Python script from Terminal.

Our API will require NumPy and SciPy. See our Knowledge Base guide for details:
https://kb.lumerical.com/installation_and_setup_python-integration.html

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.putDouble(h,"x",2)
lumapi.putString(h,"string_name", "text")
lumapi.putMatrix(h, "M", [[1,2,3],[4,5,6]])
lumapi.evalScript(h, "A=x*M;")
# getting variables from Lumerical
A=lumapi.getVar(h,"A")
B=lumapi.getVar(h,"string_name")
print(A)
print(B)

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.

-Lito


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.

0 Likes

Inverse design models can't be run on Linux server
#11

Dear @lyap,

Thank you for such a great post!

I followed the same instructions which you have specified in the post above. I am still getting the error I encountered, as mentioned in my previous post. In the attached screenshot, please have a look at the executable and the environment sections of the Python Integration window.

Screenshot%20from%202019-04-02%2023-50-02

I need to get done with this issue as early as possible :frowning: Help me!

I have now installed Mode Solutions in the Downloads folder. I am able to open the instance of Lumerical MODE manually, but not able to open the instance through a python script. I am getting something like this:

Thanks,
Aniruddha.

0 Likes

#12

@lyap, I somehow got the issue resolved for me. Now, I am able to run the MODE Solutions from my python script.

Thank you so much for the help. Appreciate it!

-------------------------Issue Resolved---------------------------

Regards,
Aniruddha

0 Likes

#13

Glad to hear that this is resolved.
Can you please provide details on how you were able to fix the issue?

Thanks,
Lito

0 Likes

#14

I followed the steps mentioned in How to install on Ubuntu systems.

Earlier Steps:

  1. Downloaded the MODE solution product. By default, the MODE_Solutions-7.13.1882.tar.gz is available in the Downloads directory.
  2. I copied the MODE_Solutions-7.13.1882.tar.gz folder and pasted in another directory.
  3. Ran the following commands: cd <product_installation_folder>, cd rpm_install_files,
    sudo alien -k --scripts <product_installation_package>.rpm
  4. .deb files were created after this. Next, I ran this command: sudo dpkg -i <product_installation_package>.deb
  5. Deleted the library using this command sudo rm /opt/lumerical/mode/lib/libxmlsec1.
  6. Ran my python script as mentioned in the previous post.
  7. Encountered the issues as mentioned in the post above.

Summary: I think I messed with the by default installation folder and hence I was not able to run the MODE solutions through my Python script.

Solution worked for me: I followed each and every step mentioned in the How to install on Ubuntu systems post, and did not change the directory of installation. I installed the MODE Solutions in the downloads folder.

Thanks,
Aniruddha.

2 Likes

#15

Awesome! :clap:
Thank you so much for sharing these with us!

-Lito

1 Like