hohlraum / gdsCAD

A simple but powerful Python package for creating photolithography masks in the GDSII format.
GNU General Public License v3.0
88 stars 52 forks source link

Python v3.x support #45

Open johnlb opened 8 years ago

johnlb commented 8 years ago

From the last commits, looks like you guys were already thinking about this, but v3 support would be nice. Dunno about the core, but the installer seems to need some tweaks to make it compatible (in git_version.py, for example, there is a print call that breaks in v3)

flothesof commented 7 years ago

If I run 2to3 on this repository, I get the following:

RefactoringTool: Files that need to be modified:
RefactoringTool: gdsCAD-master\git_version.py
RefactoringTool: gdsCAD-master\setup.py
RefactoringTool: gdsCAD-master\doc\source\conf.py
RefactoringTool: gdsCAD-master\gdsCAD\__init__.py
RefactoringTool: gdsCAD-master\gdsCAD\core.py
RefactoringTool: gdsCAD-master\gdsCAD\font.py
RefactoringTool: gdsCAD-master\gdsCAD\shapes.py
RefactoringTool: gdsCAD-master\gdsCAD\templates.py
RefactoringTool: gdsCAD-master\gdsCAD\utils.py

I'm trying to do this locally to use on Python 3.

Best regards, Florian

elrama- commented 7 years ago

Hello, I am currently using this package to design devices in a university. We had our scripts running in python2, but recently migrated to python3.

I have the package running now, on python3, so at least we have an alpha version of gdsCAD for python 3. There might still be some minor differences, as I used the package downloaded from the website, and not the one from this repository. On the weekend I am going to solve this minor differences and do a pull-request.

Cheers, R.

hohlraum commented 7 years ago

I've added a new branch that should work under both 2 and 3. I've tested this under 2.7.12 and 3.5.2. However my test suite is not very broad. I'd appreciate feedback from others before merging this and setting up new release.

hohlraum commented 7 years ago

One point in particular is that it uses the dict methods .values() and .items() which exist in both Python 2 and 3, but have return a list and a view respectively. This may have performance implications for Py2 users working with layouts containing many objects. Feedback would be welcome.