From d5dde1d1efc8cf6baf32b80f28539003c5eba61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6fferlein?= Date: Sun, 15 Jul 2018 21:39:32 +0200 Subject: [PATCH] Updated klayout Standalone KLayout Python Module (markdown) --- klayout---Standalone-KLayout-Python-Module.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/klayout---Standalone-KLayout-Python-Module.md b/klayout---Standalone-KLayout-Python-Module.md index 01f1bf9..a7610ad 100644 --- a/klayout---Standalone-KLayout-Python-Module.md +++ b/klayout---Standalone-KLayout-Python-Module.md @@ -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)