SiEPIC/SiEPIC_EBeam_PDK

Invoking klayout in script mode

thomaslima opened this issue · 8 comments

Hi everyone,

In our lab, all our structures are coded in python. We invoke klayout in batch mode, with the option -b. But in the new version of the PDK, we started having a lot of issues because while importing SiEPIC from the repo siepic_tools, a lot of the files tried to start a GUI, resulting in the following error:
Fatal: QWidget: Cannot create a QWidget without QApplication

See for example SiEPIC._globals, which in turn calls SiEPIC.core.WaveguideGUI() unnecessarily.

I will try to isolate these GUI events, but It would be nice to avoid them in general imports. Maybe test files would help?

Thanks!

Dear Lukas,

Apart from the convenience, that means we can also launch these scripts from a server without GUI. I assumed you'd also find it convenient. Imagine having a Git server with continuous integration so that masks were compiled after every collaborative commit. Also the klayout IDE is not the best editor for python scripts. I can show you the environment that Alex Tait and I set up for this. We have some bandwidth do dedicate to that. We are considering collaborating to the project more directly in the near future.

Thomas

Yes. Some time ago we decided to use our own git server in our lab (instead of GitHub) with a software called gitlab. That means we have control over everything installed in the machine, and continuous integration would be free. I think something like that with GitHub would be paid (look up Travis CI). I once set it to compile a latex document after each commit so I could send a download link to the up-to-date pdf to my advisor as we were working on it. I can assume the same can be done for this. To give you an example, one of my gds files had three different subcells generated by three different scripts and a fourth script that combined these cells and arrayed them into a wafer.

Hi @thomaslima ,

Have you had a chance to look at the original problem of disabling or moving the GUI initialization?

Also, did you build a version of KLayout with the newer Qt that doesn't have the problem reported KLayout/klayout#20

Hi @lukasc-ubc I compiled klayout from source with Qt5.9.4 as they suggested. The newer version did not render the canvas correctly. I have no issues with disabled GUI. It rarely happens. I will try to compile it in such a way that python, ruby and Qt gets bundled together in the .app, so that I can just share the program with my labmates. I really want to use python3, not the default python2 they use.

I was not able to change the code in the PDK to avoid those yet. right now I am still using script mode, but allow the window to start. I compile my masks in my laptop for now. I will update you when I have a pull request to do.

I am using macOS! Python2 is thankfully soon to be dead. I only program in python3. The one that kazzz compiled has qt 5.9.3. I had a colleague download their version and our script failed. An error was thrown saying that the theme "cocoa" was not available or something.

My compiled version did not bundle the qt with the app, so I have to have qt somewhere. I want to fix that first, then move forward. If I get a stable .dmg, I will submit to their GitHub.

screen shot 2018-03-05 at 22 22 31