Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.gds binary
*.oas binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- $TITLE [#$NUMBER](https://github.com/gdsfactory/cspdk/pull/$NUMBER)'
template: |
# What's Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: 'Breaking'
label: 'breaking'
- title: 'New'
labels:
- 'feature'
- 'enhancement'
- title: 'Bug Fixes'
label: 'bug'
- title: 'Maintenance'
labels:
- 'maintenance'
- 'github_actions'
- title: 'Documentation'
label: 'documentation'
- title: 'Other changes'
- title: 'Dependency Updates'
label: 'dependencies'
collapse-after: 5
version-resolver:
major:
labels:
- 'breaking'
- 'major'
minor:
labels:
- 'feature'
- 'minor'
- 'enhancement'
patch:
labels:
- 'bug'
- 'maintenance'
- 'github_actions'
- 'documentation'
- 'dependencies'
- 'security'
default: patch
exclude-labels:
- 'skip-changelog'
autolabeler:
- label: 'documentation'
files:
- '*.md'
branch:
- '/docs-.+/'
- label: 'bug'
branch:
- '/fix-.+/'
title:
- '/fix/i'
- label: 'enhancement'
branch:
- '/feature-.+/'
- '/add-.+/'
title:
- '/^add\s/i'
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build docs
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
build-docs:
runs-on: ubuntu-latest
name: Sphinx docs to gh-pages
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: |
make install
- name: make docs
run: |
make docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./docs/_build/html/"
deploy-docs:
needs: build-docs
if: ${{ github.ref == 'refs/heads/main' }}
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
id: deployment
uses: actions/deploy-pages@v4
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release Drafter
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release package
on:
push:
tags: "v*"
jobs:
release_environment:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Publish Latest Draft
run: |
gh release edit ${{ github.ref_name }} --draft=false
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test code

on:
pull_request:
push:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
test_code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: |
make install
- name: Test with pytest
run: make test
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"""Write docs."""

import inspect

from cspdk.si220.cband import _cells as cells
from cspdk.si220.cband.config import PATH

filepath = PATH.repo / "docs" / "cells_si220_cband.rst"

skip = {}

skip_plot: tuple[str, ...] = ("",)
skip_settings: tuple[str, ...] = ()


with open(filepath, "w+") as f:
f.write(
"""

Cells Si SOI 220nm Cband
=============================
"""
)

for name in sorted(cells.keys()):
if name in skip or name.startswith("_"):
continue
print(name)
sig = inspect.signature(cells[name])
kwargs = ", ".join(
[
f"{p}={sig.parameters[p].default!r}"
for p in sig.parameters
if isinstance(sig.parameters[p].default, int | float | str | tuple)
and p not in skip_settings
]
)
if name in skip_plot:
f.write(
f"""

{name}
----------------------------------------------------

.. autofunction:: cspdk.si220.cband.cells.{name}

"""
)
else:
f.write(
f"""

{name}
----------------------------------------------------

.. autofunction:: cspdk.si220.cband.cells.{name}

.. plot::
:include-source:

import cspdk

c = cspdk.si220.cband.cells.{name}({kwargs}).dup()
c.draw_ports()
c.plot()

"""
)
Loading
Loading