Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to gdsfactory9 #65

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Migrate to gdsfactory9 #65

wants to merge 2 commits into from

Conversation

MatthewMckee4
Copy link
Member

@MatthewMckee4 MatthewMckee4 commented Feb 23, 2025

Summary by Sourcery

Migrate the project to gdsfactory9, update the build system to use uv, and improve type hints and code organization.

Enhancements:

  • Update type hints for improved code clarity and maintainability.
  • Refactor MMI components to use temp_component.add_port for port definitions, enhancing code organization.
  • Update bend_euler to use path instead of p for extrude and info calculations.

Build:

  • Migrate from pip to uv for package management, improving installation speed and dependency resolution.

Tests:

  • Update test YAML files to reflect changes in cross-section naming and properties.

Chores:

  • Update the minimum supported Python version to 3.11 in pyproject.toml.
  • Update gdsfactory dependency to version 9.0.1.

Copy link

sourcery-ai bot commented Feb 23, 2025

Reviewer's Guide by Sourcery

This pull request migrates the gvtt project to gdsfactory9, updates dependencies, improves code clarity with type hints, refactors component port definitions, and updates test files to reflect changes in cross-section naming and routing information.

Updated class diagram for bend_euler component

classDiagram
    class bend_euler {
        angle: float
        p: float
        with_arc_floorplan: bool
        npoints: Optional[int]
        direction: str
        with_bbox: bool
        cross_section: CrossSectionSpec
        +bend_euler()
    }
    note for bend_euler "radius is no longer None"
Loading

Updated class diagram for mmi1x2 component

classDiagram
    class mmi1x2 {
        length_taper: float
        length_mmi: float
        width_mmi: float
        gap_mmi: float
        taper: ComponentSpec
        straight: ComponentSpec
        cross_section: CrossSectionSpec
        +mmi1x2()
    }
    note for mmi1x2 "ports are now added using temp_component"
Loading

Updated class diagram for mmi2x2 component

classDiagram
    class mmi2x2 {
        length_taper: float
        length_mmi: float
        width_mmi: float
        gap_mmi: float
        taper: ComponentSpec
        straight: ComponentSpec
        cross_section: CrossSectionSpec
        +mmi2x2()
    }
    note for mmi2x2 "ports are now added using temp_component"
Loading

Updated class diagram for transitions components

classDiagram
    class xs_rib_strip {
        width_deep: float
        dist_deep: float
        wg_marking_layer: LayerSpec | None
        +xs_rib_strip()
    }

    class rib_to_strip {
        length: float
        width1: float
        width2: float
        +rib_to_strip()
    }

    class strip_to_rib {
        length: float
        width1: float
        width2: float
        +strip_to_rib()
    }

    class strip_taper {
        width1: float
        width2: float
        taper_ratio: float
        length: float | None
        +strip_taper()
    }

    class rib_taper {
        width1: float
        width2: float
        taper_ratio: float
        length: float | None
        +rib_taper()
    }
Loading

Updated class diagram for tech components

classDiagram
    class rib {
        width: float
        width_trench: float
        wg_marking_layer: LayerSpec
        +rib()
    }

    class strip {
        width: float
        width_trench: float
        wg_marking_layer: LayerSpec
        +strip()
    }

    class vttstrip {
        width: float
        width_trench: float
        wg_marking_layer: LayerSpec | None
        +vttstrip()
    }
Loading

File-Level Changes

Change Details Files
Updated gdsfactory dependency to version 9.0.1 and requires python 3.11 or later.
  • Updated gdsfactory dependency to ~9.0.1.
  • Updated requires-python to >=3.11.
  • Updated installation instructions in README to recommend Python 3.11 or later.
pyproject.toml
README.md
Added type hints and kwargs to function definitions for better code clarity and maintainability.
  • Added type hints to function arguments and return values.
  • Added **kwargs: Any to function definitions to allow for arbitrary keyword arguments.
gvtt/components/transitions.py
gvtt/components/bend_euler.py
gvtt/tech.py
Refactored component port definitions to use a temporary component.
  • Created a temporary component to hold port definitions.
  • Added ports to the temporary component using temp_component.add_port().
  • Ports are now added to the component using the temporary component's ports.
gvtt/components/mmi2x2.py
gvtt/components/mmi1x2.py
Updated the dev make command to use uv.
  • Replaced pip install -e .[dev,docs] with uv sync --all-extras and uv pip install -e .
  • Added uv run pre-commit install
Makefile
Updated test files to reflect changes in cross-section naming and routing information.
  • Updated cross_section names in test files.
  • Updated route_info_type to strip or rib.
  • Added route_info_strip_length and route_info_rib_length.
tests/test_components/test_pdk_settings_straight_rib_.yml
tests/test_components/test_pdk_settings_straight_.yml
tests/test_components/test_pdk_settings_straight_sc_.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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

@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.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

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