Skip to content

Commit

Permalink
Merge pull request #51 from gdsfactory/update_gdsfactory828
Browse files Browse the repository at this point in the history
update gdsfactory
  • Loading branch information
joamatab authored Dec 30, 2024
2 parents 0b178d4 + ef79ef3 commit b927859
Show file tree
Hide file tree
Showing 7 changed files with 4,383 additions and 44 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,29 @@ jobs:
build-docs:
runs-on: ubuntu-latest
name: Sphinx docs to gh-pages
container: ghcr.io/gdsfactory/gdsfactory:main
steps:
- name: Cancel Workflow Action
uses: styfle/[email protected]
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.gdsfactory/
key: 0.0.1
restore-keys: 0.0.1
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Installing the library
shell: bash -l {0}
run: |
make install
- name: make docs
make dev
- name: Build the docs
env:
GDSFACTORY_DISPLAY_TYPE: klayout
KFACTORY_DISPLAY_TYPE: image
run: |
make docs
- name: Upload artifact
Expand All @@ -33,11 +48,9 @@ jobs:
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "9260cbc9c84c06022993bfbcc42fdbf0305c5b8e"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
install:
pip install -e .[dev,docs]
uv sync --extra docs --extra dev

developer: install
pre-commit install
Expand All @@ -14,9 +14,9 @@ git-rm-merged:
git branch -D `git branch --merged | grep -v \* | xargs`

docs:
jb build docs
uv run jb build docs

clean:
nbstripout --drop-empty-cells notebooks/*.ipynb
uv run nbstripout --drop-empty-cells notebooks/*.ipynb

.PHONY: docs
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,32 @@

Installation instructions.

## 1. Install Python
## 1. Install UV

- [ ] Ensure that Python 3.11 or 3.12 is installed on your computer. You can download the [Anaconda Installer](https://www.anaconda.com/download/) for an easy setup.

## 2. Install Klayout

- [ ] Download and install [klayout](https://www.klayout.de/build.html)
- [ ] Install `GDSFactory` klayout plugin to be able to see live updates on your GDS files from the klayout GUI `Tools --> Manage Packages --> Install New Packages --> GDSFactory`
```bash
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
```

![image.png](https://i.imgur.com/CmCe9Vp.png)
```bash
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

## 3. Install GDSFactory
## 2. Download the notebooks

- [ ] Download and install [VSCode](https://code.visualstudio.com/), a Python editor, to open and work with the notebooks.
- [ ] Install GDSFactory using pip in an anaconda prompt opened as `Administrator`.
- [ ] Download the training notebooks[here](https://github.com/gdsfactory/gdsfactory-photonics-training/archive/refs/heads/main.zip)
- [ ] Open a shell inside the unzipped folder and run

```
pip install "gdsfactory gplugins[femwell,gmsh,meow,sax,tidy3d]" --upgrade
uv venv --python 3.11
uv sync
```

![anaconda prompt](https://i.imgur.com/eKk2bbs.png)
## 3. Install VSCode and KLayout

## 4. Download the notebooks
- [ ] Download and install [VSCode](https://code.visualstudio.com/), a Python editor, to open and run the notebooks. When opening VSCode make sure you have selected the python interpreter in the current directory virtual environment `.venv/bin/python`
- [ ] Download and install [klayout](https://www.klayout.de/build.html)
- [ ] Install `GDSFactory` klayout plugin to be able to see live updates on your GDS files from the klayout GUI `Tools --> Manage Packages --> Install New Packages --> GDSFactory`

- [ ] Download the training notebooks[here](https://github.com/gdsfactory/gdsfactory-photonics-training/archive/refs/heads/main.zip)
![image.png](https://i.imgur.com/CmCe9Vp.png)
26 changes: 8 additions & 18 deletions notebooks/31_ring.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"outputs": [],
"source": [
"c = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)\n",
"c.show()\n",
"c.plot()"
]
},
Expand Down Expand Up @@ -174,10 +175,7 @@
"source": [
"port_names = [\"l_e1\", \"r_e3\"]\n",
"port_names = [\"l_e4\", \"r_e4\"]\n",
"c = gf.routing.add_pads_top(\n",
" ring,\n",
" port_names=port_names,\n",
")\n",
"c = gf.routing.add_pads_top(ring, port_names=port_names, fanout_length=200)\n",
"c = gf.routing.add_fiber_array(c)\n",
"c"
]
Expand Down Expand Up @@ -253,18 +251,18 @@
"\n",
"def sample_reticle(grid: bool = False) -> gf.Component:\n",
" \"\"\"Returns MZI with TE grating couplers.\"\"\"\n",
" from gdsfactory.generic_tech.cells import (\n",
" add_fiber_array_optical_south_electrical_north,\n",
" )\n",
"\n",
" mzis = [mzm_gc(length_x=lengths) for lengths in [100, 200, 300]]\n",
" spirals = [spiral_gc(length=length) for length in [0, 100, 200]]\n",
" rings = []\n",
" for length_x in [10, 20, 30]:\n",
" ring = gf.components.ring_single_heater(length_x=length_x)\n",
" c = add_fiber_array_optical_south_electrical_north(\n",
" c = gf.c.add_fiber_array_optical_south_electrical_north(\n",
" component=ring,\n",
" electrical_port_names=[\"l_e2\", \"r_e2\"],\n",
" pad=gf.c.pad,\n",
" grating_coupler=gf.c.grating_coupler_te,\n",
" cross_section_metal=\"metal3\",\n",
" )\n",
" c.name = f\"ring_{length_x}\"\n",
" c.info[\"doe\"] = \"ring_length_x\"\n",
Expand Down Expand Up @@ -303,14 +301,6 @@
"df = pd.read_csv(\"sample_reticle.csv\")\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -321,7 +311,7 @@
"notebook_metadata_filter": "-all"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "docode-ofVJGyO7",
"language": "python",
"name": "python3"
},
Expand All @@ -335,7 +325,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Operating System :: OS Independent"
]
dependencies = [
"gdsfactory~=8.27.1",
"gdsfactory~=8.28.0",
"gplugins[tidy3d,sax,schematic,femwell]",
"numpy<2",
]
Expand Down
Loading

0 comments on commit b927859

Please sign in to comment.