Skip to content

add ubcpdk--sample-projects#531

Open
thanojo wants to merge 4 commits into
mainfrom
add-sample-projects
Open

add ubcpdk--sample-projects#531
thanojo wants to merge 4 commits into
mainfrom
add-sample-projects

Conversation

@thanojo
Copy link
Copy Markdown
Contributor

@thanojo thanojo commented May 4, 2026

Adds sample projects from gfp-sample-projects into ubcpdk--sample-projects/.

Summary by Sourcery

Add a new UBC PDK public sample project containing schematic/layout definitions, example cells, and mask designs for gdsfactory+.

New Features:

  • Introduce the myubc Python package with sample photonic components, routing demos, LVS/DRC examples, and helper utilities for the UBC PDK.
  • Add corresponding PIC/SCM YAML files defining schematics and layouts for a variety of MZI, ring, routing, pad, and lattice-based sample circuits.
  • Provide multiple mask-generation scripts that assemble demo structures into full-chip layouts using UBC PDK cells.

Build:

  • Add a pyproject.toml configuring the myubc package metadata, dependencies, linting, and packaging settings for the sample project.

Documentation:

  • Add a README describing how to get started with the UBC Ebeam sample project in GDSFactory+.

Chores:

  • Add repository metadata files such as .gitattributes, .gitignore, and LICENSE for the new public sample project.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 4, 2026

Reviewer's Guide

Adds a new ubcpdk--public--project/myubc sample project (ported from gfp-sample-projects) including configuration, PIC/SCM layouts, Python demo cells, and masks for the UBC PDK.

Class diagram for core myubc Python cells and their dependencies

classDiagram

  class myubc_init {
    +home: pathlib_Path
    +cwd: pathlib_Path
    +module_path: pathlib_Path
    +repo_path: pathlib_Path
    +__version__: string
  }

  class lvs_electrical {
    +pads_correct(pad, cross_section) Component
    +pads_shorted(pad, cross_section) Component
  }

  class nxn_module {
    +nxn(west, east, north, south, xsize, ysize, wg_width, layer, wg_margin) Component
  }

  class sample_drc_errors_module {
    +_width_min(size) Component
    +_area_min() Component
    +_gap_min(gap) Component
    +_separation(gap, layer1, layer2) Component
    +_enclosing(enclosing, layer1, layer2) Component
    +_sample_drc_errors() Component
  }

  class ports8_module {
    +ports8() Component
  }

  class splitter_tree_module {
    +splitter_tree(noutputs, cross_section, spacing, kwargs) Component
  }

  class sample_crossing_from_gds_module {
    +sample_crossing_from_gds() Component
  }

  class sample_fill_module {
    +sample_fill() Component
  }

  class sample_virtual_instance_module {
    +sample_virtual_instance() Component
  }

  class masks_ubc1_module {
    +EBeam_JoaquinMatres_1() Component
  }

  class masks_ubc2_module {
    +EBeam_JoaquinMatres_2() Component
  }

  class masks_ubc3_module {
    +EBeam_JoaquinMatres_3() Component
  }

  class masks_ubc4_module {
    +EBeam_JoaquinMatres_4() Component
  }

  class masks_ubc5_module {
    +EBeam_JoaquinMatres_5() Component
  }

  class dbr_module {
    +dbr(w1, w2, cross_section) Component
  }

  class samples_sample0_module {
    +sample0_hello_world() Component
  }

  class samples_sample1_module {
    +sample1_connect() Component
  }

  class samples_sample2_module {
    +sample2_remove_layers() Component
  }

  class samples_sample3_module {
    +sample3_grid() Component
  }

  class samples_sample4_module {
    +sample4_pack() Component
  }

  class samples_sample5_module {
    +sample5_path() Component
  }

  class samples_sample6_module {
    +sample6_cross_section() Component
  }

  class gdsfactory_gf {
    +Component
    +cell(decorated_function)
    +components
    +routing
    +Path
    +Section
    +CrossSection
  }

  class ubcpdk_cells {
    +pad
    +die
    +straight
    +mzi
    +ring_single
    +ring_single_heater
    +ebeam_crossing4
    +ebeam_adiabatic_te1550
    +ebeam_bdc_te1550
    +ebeam_y_1550
    +spiral
    +add_fiber_array
    +add_fiber_array_pads_rf
    +mzi_heater
  }

  class ubcpdk_LAYER {
    +WG
    +FLOORPLAN
    +other_layer_specs
  }

  myubc_init --> gdsfactory_gf : configures
  myubc_init --> ubcpdk_LAYER : uses

  lvs_electrical --> gdsfactory_gf : uses_component_and_routing
  lvs_electrical --> ubcpdk_cells : uses_pad

  nxn_module --> gdsfactory_gf : wraps_nxn_factory
  nxn_module --> ubcpdk_LAYER : default_layer

  sample_drc_errors_module --> gdsfactory_gf : shapes_and_pack
  sample_drc_errors_module --> ubcpdk_LAYER : uses_layer_defs

  ports8_module --> gdsfactory_gf : polygon_and_ports

  splitter_tree_module --> gdsfactory_gf : splitter_tree_factory

  sample_crossing_from_gds_module --> gdsfactory_gf : import_gds
  sample_crossing_from_gds_module --> ubcpdk_LAYER : waveguide_layer

  sample_fill_module --> gdsfactory_gf : fill
  sample_fill_module --> ubcpdk_cells : ring_single_and_die

  sample_virtual_instance_module --> gdsfactory_gf : add_ref_off_grid

  masks_ubc1_module --> gdsfactory_gf : pack
  masks_ubc1_module --> ubcpdk_cells : straight_mzi_ring_and_die

  masks_ubc2_module --> gdsfactory_gf : pack
  masks_ubc2_module --> ubcpdk_cells : spiral_and_die

  masks_ubc3_module --> gdsfactory_gf : pack
  masks_ubc3_module --> ubcpdk_cells : ebeam_structures_and_die

  masks_ubc4_module --> gdsfactory_gf : pack
  masks_ubc4_module --> ubcpdk_cells : mzi_variants_and_die

  masks_ubc5_module --> gdsfactory_gf : pack
  masks_ubc5_module --> ubcpdk_cells : ring_single_heater_and_die

  dbr_module --> gdsfactory_gf : dbr_factory

  samples_sample0_module --> gdsfactory_gf
  samples_sample1_module --> gdsfactory_gf
  samples_sample2_module --> gdsfactory_gf
  samples_sample3_module --> gdsfactory_gf
  samples_sample4_module --> gdsfactory_gf
  samples_sample5_module --> gdsfactory_gf
  samples_sample6_module --> gdsfactory_gf
Loading

File-Level Changes

Change Details Files
Introduce the myubc sample project for the UBC PDK with layouts and scripts for rings, MZIs, routing bundles, pads, LVS/DRC demos, masks, and utility samples.
  • Add pyproject.toml and package metadata/config for the myubc demo project, including dependencies, tooling config, and packaging rules.
  • Add numerous .pic.yml and .scm.yml schematic/layout definition files showcasing routing bundles, astar routing, rings, MZIs, lattice structures, pads, heaters, arrays, and chiplets for the UBC PDK.
  • Add Python demo cells and utilities (e.g., LVS/DRC examples, nxn router wrapper, splitter trees, sample GDS imports, packing/grid demos, fill examples, and sample scripts) under myubc/ and myubc/masks//myubc/samples/.
  • Add project-level README, license, git metadata files, and set __init__.py for myubc to configure gdsfactory and expose a version.
ubcpdk--sample-projects/ubcpdk--public--project/pyproject.toml
ubcpdk--sample-projects/ubcpdk--public--project/README.md
ubcpdk--sample-projects/ubcpdk--public--project/LICENSE
ubcpdk--sample-projects/ubcpdk--public--project/.gitignore
ubcpdk--sample-projects/ubcpdk--public--project/.gitattributes
ubcpdk--sample-projects/ubcpdk--public--project/myubc/__init__.py
ubcpdk--sample-projects/ubcpdk--public--project/myubc/*.py
ubcpdk--sample-projects/ubcpdk--public--project/myubc/masks/*.py
ubcpdk--sample-projects/ubcpdk--public--project/myubc/samples/*.py
ubcpdk--sample-projects/ubcpdk--public--project/myubc/*.pic.yml
ubcpdk--sample-projects/ubcpdk--public--project/myubc/*.scm.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • In pyproject.toml, the optional-dependencies.dev key under [project] should be moved under a [project.optional-dependencies] table (e.g., [project.optional-dependencies] dev = [...]) to conform to the PEP 621/TOML schema and be picked up correctly by tooling.
  • Several modules (e.g., sample_drc_errors.py and nxn.py) define globals like layer/layer1 that are never used; consider removing these unused variables to avoid confusion about which layer spec is actually in use.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `pyproject.toml`, the `optional-dependencies.dev` key under `[project]` should be moved under a `[project.optional-dependencies]` table (e.g., `[project.optional-dependencies]
dev = [...]`) to conform to the PEP 621/TOML schema and be picked up correctly by tooling.
- Several modules (e.g., `sample_drc_errors.py` and `nxn.py`) define globals like `layer`/`layer1` that are never used; consider removing these unused variables to avoid confusion about which layer spec is actually in use.

## Individual Comments

### Comment 1
<location path="ubcpdk--sample-projects/ubcpdk--public--project/README.md" line_range="5" />
<code_context>
+
+## **Getting Started**
+
+To begin using:
+
+- You can see the Getting started guide in the [docs](https://gdsfactory.com/plus/) and the videos.
</code_context>
<issue_to_address>
**suggestion (typo):** Clarify what the user is beginning to use (e.g., "this project" or "this template").

"To begin using:" reads incomplete on its own. Please specify the subject, for example: "To begin using this project:" or "To begin using this sample:" so it’s immediately clear what the steps apply to.

```suggestion
To begin using this project:
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread ubcpdk--sample-projects/ubcpdk--public--project/README.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants