Updated klayout Standalone KLayout Python Module (markdown)

Matthias Köfferlein 2018-07-15 21:39:32 +02:00
parent 3846afa0a8
commit d5dde1d1ef
1 changed files with 5 additions and 4 deletions

@ -2,14 +2,15 @@
The scope of this sub-project is to supply a standalone Python Module for the KLayout classes.
The current approach is an integrated interpreter: KLayout comes with a built-in Python interpreter. KLayout's classes in the "pya" module space are injected into that interpreter when starting the application. Python scripts *must* run in that environment when they want to use this extension.
The KLayout application is not able to supply such a module without refactoring. Within the application context, Python is not standalone, but KLayout comes with a built-in Python interpreter. KLayout's classes in the "pya" module space are injected into that interpreter when starting the application. Python scripts *must* run in that environment when they want to use this extension.
The reasoning for this approach was the initial use case: Python (and Ruby) scripts were intended to extend and customize KLayout's functionality.
The reasoning for this approach was the initial use case: Python (and Ruby) scripts were intended to extend and customize KLayout's functionality. The integrated interpreter approach is well suited for this kind of application.
Over time, many other applications emerged, many of them just using KLayout's algorithms - without the user interface - plus other, external libraries. The integrated interpreter approach means such applications need to run within KLayout. This limitation has received some criticism as it forces users into the KLayout infrastructure. In addition, the need for integrating third-party components such as NumPy created a maintenance issue.
Over time however, many other applications emerged, many of them just using KLayout's algorithms - without the user interface - plus other, external libraries. The integrated interpreter approach means such applications need to run within KLayout. This limitation has received some criticism as it forces users into the KLayout infrastructure. In addition, the need for integrating third-party components such as NumPy created a maintenance issue.
The solution to this problem is to supply a standalone Python module which can be used in third-party ecosystems such as PyCharm, Anaconda etc.
The goal of this project is to provide such a standalone module.
Please examine [Prototype in pymod Branch](https://github.com/klayoutmatthias/klayout/wiki/KLayout-Python-Module-Prototype) for details about the current status.
# Vision
@ -19,7 +20,7 @@ A Python module that can be included into your project.
First stage: supply modules for the core features:
```Python
import pykl.db as db
import klayout.db as db
box = db.DBox(0, 0, 1000, 2000)
print str(box)