Skip to content

Commit

Permalink
Merge pull request #138 from amccaugh/dev
Browse files Browse the repository at this point in the history
1.6.1
  • Loading branch information
amccaugh authored Apr 7, 2022
2 parents eae1cea + f3f3e10 commit f2a9a78
Show file tree
Hide file tree
Showing 30 changed files with 8,373 additions and 4,983 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [master, dev]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
35 changes: 35 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: pytest

on:
pull_request:
push:
branches: [master, dev]

jobs:
pytest:
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U \
matplotlib \
scipy \
rectpack \
freetype-py \
pytest
pip install -e .
- name: Run test
uses: GabrielBB/xvfb-action@v1
with:
run: |
pytest
python ./phidl/phidl_tutorial_example.py
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
- id: check-ast
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py3-plus]
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

37 changes: 29 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 1.6.1 (April 7, 2022)

### New features
- Re-added `Device.get_info()` that gathers the Device.info dictionaries from every sub-Device and returns them in a list. Useful for collecting information about every Device in a layout
- Updated documentation

### Changes
- Deprecated Python 2
- Removal of 1023-character limit for labels (will only show warning instead now)
- Deprecated `reflect()` has been fully removed, use `mirror()` instead

### Bugfixes
- Much code sanitization under the hood (thanks Bas Nijholt @basnijholt)
- `Device.absorb()` now preserves labels from the parent component (thanks Joaquin Matres @joamatab)
- Fixed extrusion error of `pp.spiral()` caused by overlapping points
- Bugfix for `pg.optimal_step()`, now works correctly when `start_width == end_width`
- Fixed naming of some previously-unnamed geometries
- Future-proofing for upcoming Numpy changes
- Bugfix for `CrossSection.extrude()` since cross_section parameter renamed to `width`


## 1.6.0 (Sept 28, 2021)

### New features
Expand All @@ -18,7 +39,7 @@
## 1.5.1 (May 19, 2021)

### New features
- New `pg.gridsweep()` function, allowing for easy creation of parameter sweeps on a grid. See [the documentation](https://phidl.readthedocs.io/en/latest/geometry_reference.html#Gridsweep) for details.
- New `pg.gridsweep()` function, allowing for easy creation of parameter sweeps on a grid. See [the documentation](https://phidl.readthedocs.io/en/latest/geometry_reference.html#Gridsweep) for details.

![phidl example image](https://phidl.readthedocs.io/en/dev/_images/geometry_reference_36_0.png)

Expand Down Expand Up @@ -166,7 +187,7 @@ Huge update with lots of quality-of-life improvements.
- New geometry documentation with quick picture references and code examples! See [**Geometry + function documentation**](https://phidl.readthedocs.io/)

### Changes
- Big update to `quickplot()`, should be faster now and not have issues with overlapping polygons generating whitespace.
- Big update to `quickplot()`, should be faster now and not have issues with overlapping polygons generating whitespace.
- Can now use `port.center`, which is identical to `port.midpoint`


Expand Down Expand Up @@ -263,7 +284,7 @@ Huge update with lots of quality-of-life improvements.
- New documentation backend (contribution thanks to Alex Tait @atait)
- Added `D.remap_layers()` which allows you to to move all polygons contained on a layer within your Device to another layer. See [tutorial](https://github.com/amccaugh/phidl/blob/master/phidl/phidl_tutorial_example.py) for details
- Added `D.remove_layers()` which lets you remove all polygon geometry (optionally including labels) from a Device on the specified layers. See [tutorial](https://github.com/amccaugh/phidl/blob/master/phidl/phidl_tutorial_example.py) for details

### Bugfixes
- Further fixes to `D.write_gds()` for rare edge cases

Expand All @@ -282,7 +303,7 @@ Huge update with lots of quality-of-life improvements.
## 0.8.6 (July 9, 2018)
### New features
- `D.absorb(my_reference)` can be used to easily absorb references into a Device; polygons will be extracted from the reference, added to the Device, and then the reference will be removed. See the [tutorial](https://github.com/amccaugh/phidl/blob/master/phidl/phidl_tutorial_example.py) for more details
- Added lithographic-resolution test structures including stars (`pg.litho_star()`), calipers (`pg.litho_calipers()`), and variable-size negative-tone and positive-tone steps (`pg.litho_steps()`) (Contribution from Dylan Oh @dmwo).
- Added lithographic-resolution test structures including stars (`pg.litho_star()`), calipers (`pg.litho_calipers()`), and variable-size negative-tone and positive-tone steps (`pg.litho_steps()`) (Contribution from Dylan Oh @dmwo).

### Changes
- Made `write_gds()` autofix names to guarantee no duplicates cell names ever appear
Expand Down Expand Up @@ -327,7 +348,7 @@ Huge update with lots of quality-of-life improvements.
- Added the LayerSet class. See the [tutorial](https://github.com/amccaugh/phidl/blob/master/phidl/phidl_tutorial_example.py), but essentially this class makes a convenient container to stores layers
- Added `phidl.utilities.write_lyp()` (Contribution from Dylan Oh @dmwo). Using a LayerSet, you can now create KLayout-compatible .lyp files. This allows you to get the same coloring in the KLayout viewer as you have specified in PHIDL.
- Several new electrical test structures (Contribution from Jacob Melonis @melonisj) Specifically: via chain tests (`pg.test_via()`), inter- and intra-layer comb insulation tests (`pg.test_comb()`), and critical current test structures (`pg.test_ic`).
- `add_ref()` can now take a list of input Devices and will return a list of the generated references, e.g. `ref_a,ref_b,ref_c = D.add_ref([A,B,C])`
- `add_ref()` can now take a list of input Devices and will return a list of the generated references, e.g. `ref_a,ref_b,ref_c = D.add_ref([A,B,C])`

### Changes

Expand Down Expand Up @@ -428,7 +449,7 @@ Huge update with lots of quality-of-life improvements.

### Bugfixes
- Under the hood


## 0.6.2 (Jan 13, 2017)

Expand Down Expand Up @@ -493,7 +514,7 @@ Huge update with lots of quality-of-life improvements.
## 0.5.4 (Dec 5, 2016)
### Changes
- A few under-the-hood optimizations

### Bugfixes
- Fixed error with quickplot where the last edge of a polygon was not rendered
- Problem with route() and inset() caused by implementation of Layer(). You can now pass route() and inset() a Layer and it will parse it correctly
Expand All @@ -504,7 +525,7 @@ Huge update with lots of quality-of-life improvements.
- You can now construct a Device using a set of parameters. See "Constructing a Device from set of parameters" in tutorial_example.py
- Usage of the annotate() function has been added to tutorial_example.py
- quickplot rendering speed has been sped up by a factor of 10x

### Changes
- pg.rectangle() now takes "size" as a parameter rather than "point1" and "point2"

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Adam N. McCaughan
Copyright (c) 2022 Adam N. McCaughan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[![Build Status](https://travis-ci.com/amccaugh/phidl.svg?branch=master)](https://travis-ci.com/github/amccaugh/phidl)
[![pytest](https://github.com/amccaugh/phidl/actions/workflows/pytest.yml/badge.svg)](https://github.com/amccaugh/phidl/actions/workflows/pytest.yml)
[![pre-commit](https://github.com/amccaugh/phidl/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/amccaugh/phidl/actions/workflows/pre-commit.yml)

# PHIDL
GDS scripting that's intuitive, fast, and powerful. For Python 2 and 3.
GDS scripting for Python that's intuitive, fast, and powerful.

- [**Installation / requirements**](#installation--requirements)
- [**Tutorial + examples**](https://phidl.readthedocs.io/en/latest/tutorials.html) (or [try an interactive notebook](https://mybinder.org/v2/gh/amccaugh/phidl/master?filepath=phidl_tutorial_example.ipynb))
- [**Geometry library + function documentation**](https://phidl.readthedocs.io/en/latest/geometry_reference.html)
- [Changelog](https://github.com/amccaugh/phidl/blob/master/CHANGELOG.md) (latest update 1.6.0 on Sept 28, 2021)
- Huge new routing rewrite for `phidl.routing`, including automatic manhattan routing with custom cross-sections! See [the routing documentation](https://phidl.readthedocs.io/en/latest/tutorials/routing.html) for details. Big thanks to Jeffrey Holzgrafe @jolzgrafe for this contribution
- `Path`s can now be used to produce sharp angles, in addition to smooth bends. See [the Path documentation](https://phidl.readthedocs.io/en/latest/tutorials/waveguides.html#Sharp/angular-paths)
- `Path`s can now be used to produce sharp angles, in addition to smooth bends. See [the Path documentation](https://phidl.readthedocs.io/en/latest/tutorials/waveguides.html#Sharp/angular-paths)

```python
import phidl.routing as pr
Expand All @@ -21,15 +22,15 @@ D_right = pr.route_sharp(port1, port2, layer = 2)
# Citation

If you found PHIDL useful, please consider citing it in (just one!) of your publications -- we appreciate it greatly. ([BibTeX](https://raw.githubusercontent.com/amccaugh/phidl/master/CITATION.bib))
- McCaughan, A. N., et. al. PHIDL: Python-based layout and geometry creation for nanolithography. *J. Vac. Sci. Technol. B* 39, 062601 (2021). http://dx.doi.org/10.1116/6.0001203
- McCaughan, A. N., et. al. PHIDL: Python-based layout and geometry creation for nanolithography. *J. Vac. Sci. Technol. B* 39, 062601 (2021). http://dx.doi.org/10.1116/6.0001203

# Gallery

<img src="https://amccaugh.github.io/phidl/phidl1.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl2.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl3.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl4.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl5.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl6.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl7.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl8.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl9.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl10.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl11.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl12.png" width="30%"></img>
<img src="https://amccaugh.github.io/phidl/phidl1.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl2.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl3.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl4.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl5.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl6.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl7.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl8.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl9.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl10.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl11.png" width="30%"></img> <img src="https://amccaugh.github.io/phidl/phidl12.png" width="30%"></img>

# Installation / requirements
- Install or upgrade with `pip install -U phidl`
- Python 2 >=2.6 or Python 3 >=3.5
- Python version >=3.5
- If you are on Windows or Mac and don't already have `gdspy` installed, you will need a C++ compiler
- For Windows + Python 3, install ["Build Tools for Visual Studio"](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) (make sure to check the "C++ build tools" checkbox when installing)
- For Mac, install "Xcode" from the App Store, then run the command `xcode-select --install` in the terminal
Expand All @@ -38,7 +39,7 @@ If you found PHIDL useful, please consider citing it in (just one!) of your publ

*fiddle (verb) - /ˈfidl/ - to make minor manual movements, especially to adjust something*

PHIDL is an open-source GDS-based CAD tool for Python 2 and 3 that significantly extends the excellent [gdspy](https://github.com/heitzmann/gdspy). The base installation includes a large library of simple shapes (e.g. rectangles, circles), photonic structures (e.g. sine curve waveguides), and superconducting nanowire shapes (e.g. single photon detectors) that are fully parameterized. It also has a built-in quick-plotting function based on matplotlib (or Qt) that allows you view the state of any GDS object, useful when scripting geometry-making functions. It also has a [__geometry library reference__](https://phidl.readthedocs.io/) and a set of [__very thorough tutorials__](https://phidl.readthedocs.io/en/latest/tutorials.html) that will walk you through the process of getting acquainted with PHIDL.
PHIDL is an open-source GDS-based CAD tool for Python that significantly extends the excellent [gdspy](https://github.com/heitzmann/gdspy). The base installation includes a large library of simple shapes (e.g. rectangles, circles), photonic structures (e.g. sine curve waveguides), and superconducting nanowire shapes (e.g. single photon detectors) that are fully parameterized. It also has a built-in quick-plotting function based on matplotlib (or Qt) that allows you view the state of any GDS object, useful when scripting geometry-making functions. It also has a [__geometry library reference__](https://phidl.readthedocs.io/) and a set of [__very thorough tutorials__](https://phidl.readthedocs.io/en/latest/tutorials.html) that will walk you through the process of getting acquainted with PHIDL.

The goal is to bring the usability of Illustrator / Inkscape drawing programs to the GDS scripting world. Like Python itself, it aims to be readable, and intuitive. For instance, when building a geometry you don't have to worry about what the exact coordinates are anymore. If you want to separate two ellipses in the x direction by 5 units, you can do things like this:

Expand All @@ -63,7 +64,7 @@ It also allows you to do things like add text and create smooth or straight rout

![phidl example image](https://amccaugh.github.io/phidl/readme_3.png)
![phidl example image](https://amccaugh.github.io/phidl/readme_4.png)


Other useful functionality available are standard operations like booleans:

Expand All @@ -74,7 +75,7 @@ Other useful functionality available are standard operations like booleans:
`pg.outline(D, distance = 0.7, layer = 4)`

![phidl example image](https://amccaugh.github.io/phidl/readme_5.png)

The geometry library also has useful resolution test-structures built into it, for instance

```
Expand Down
2 changes: 0 additions & 2 deletions docs/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -594,5 +594,3 @@ reset
=====

.. autofunction:: phidl.device_layout.reset


2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
4 changes: 2 additions & 2 deletions docs/README_HOW_TO_BUILD_DOCS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- Run "python gen_API.py" to build API rst file and make html
- First input argument must end with .rst if a new file is being made or
be "add <.rst file>" if a docstring is being added to an existing file
or be "build" if no docstrings need to be made but the sphinx docs
or be "build" if no docstrings need to be made but the sphinx docs
should be built.
- Every other argument must be a Python file
- Ex: "python gen_API.py add API.rst file1.py file2.py file3.py"
- Open the index.html in the phidl/docs/build folder
- Open the index.html in the phidl/docs/build folder
Loading

0 comments on commit f2a9a78

Please sign in to comment.