Skip to content

emode plugin: use the renamed emode client - #805

Merged
nikosavola merged 4 commits into
gdsfactory:mainfrom
estanton22:emode-client-rename
Nov 26, 2026
Merged

nikosavola merged 4 commits into
gdsfactory:mainfrom
estanton22:emode-client-rename

Conversation

@estanton22

@estanton22 estanton22 commented Nov 21, 2026 •

Copy link
Copy Markdown

EMode's Python client was renamed from emodeconnection to emode (pip install emode, import emode). The old name stays on PyPI as a shim that re-exports emode and warns, so the plugin keeps working either way, but it should import the new name.

Changes:

  • gplugins/emode/emode.py: import emode as emc.
  • gplugins/emode/tests/test_emode.py: importorskip('emode').
  • pyproject.toml: the emode extra is emode>=1.1.27.
  • The notebook text names emode.

emode 1.1.27 is on PyPI now (and emodeconnection 1.1.27 is the shim). The earlier CI failures were all the resolver not finding emode>=1.1.26 before it was published. This branch merges current main. The plugin tests (22) pass locally against emode 1.1.27 from PyPI.

Summary by Sourcery

Adopt the renamed emode client for the EMode plugin and its optional dependency.

Enhancements:

  • Update the EMode plugin to use the renamed emode Python client throughout its imports, dependency metadata, tests, and user-facing documentation.

Documentation:

  • Update the EMode notebook and plugin documentation to reference the emode client.

Tests:

  • Update plugin dependency detection to skip tests when the emode client is unavailable.

Chores:

  • Add a changelog entry for the EMode client rename.

Eric Stanton and others added 2 commits November 20, 2026 20:32
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013E8xULgErVrUQQUaHrtjYm
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013E8xULgErVrUQQUaHrtjYm
@sourcery-ai

sourcery-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

API

Switch the EMode plugin’s client import to the renamed emode package and update its class documentation to match.

  • gplugins/emode/emode.py L12, L22, L181

Configuration

Update the optional EMode dependency to install the renamed client at the required published version.

  • pyproject.toml L61

Documentation

Update the notebook’s installation note to refer to the renamed emode client.

  • notebooks/emode_01.ipynb L14

Add the changelog entry for the client rename.

  • .changelog.d/805.changed L1

Tests

Make the EMode tests check for the renamed client package and update their dependency description.

  • gplugins/emode/tests/test_emode.py L3, L15

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

@estanton22
estanton22 marked this pull request as ready for review November 25, 2026 20:25

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="pyproject.toml" line_range="61" />
<code_context>
 ]
 elmer = ["jinja2", "meshwell~=2.1.1", "nest-asyncio", "pandas"]
-emode = ["emodeconnection>=1.1.11"]
+emode = ["emode>=1.1.27"]
 femwell = ["femwell~=0.1.11", "meshwell~=2.1.1"]
 gfviz = ["jinja2", "fastapi", "shapely", "natsort"]
</code_context>
<issue_to_address>
**Locked installs cannot use EMode**

When a caller installs with the committed lockfile in locked or frozen mode, `uv.lock` still resolves the `emode` extra to `emodeconnection` instead of `emode`, so `uv sync --locked` aborts and frozen installs leave `gplugins.emode` without the renamed module; callers cannot install or import the plugin.

Regenerate `uv.lock` to match the new `emode` dependency.

Also at `gplugins/emode/emode.py:22`.
</issue_to_address>

### Comment 2
<location path="gplugins/emode/emode.py" line_range="22" />
<code_context>
 from typing import Any

-import emodeconnection as emc
+import emode as emc
 import gdsfactory as gf
 from gdsfactory.technology import LayerLevel, LayerStack
</code_context>
<issue_to_address>
**Existing installs fail to import plugin**

When an existing environment upgrades gplugins without reinstalling the `emode` extra, python raises `ModuleNotFoundError` on the unconditional `import emode`, so importing `gplugins.emode` fails for users who upgrade gplugins without reinstalling its optional extra and still have only the old `emodeconnection` package.

Add a compatibility import for the old client or ensure the upgrade path explicitly reinstalls the `emode` extra.

Also at `pyproject.toml:61`.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: pyproject.toml:61, gplugins/emode/emode.py:22


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread pyproject.toml
]
elmer = ["jinja2", "meshwell~=2.1.1", "nest-asyncio", "pandas"]
emode = ["emodeconnection>=1.1.11"]
emode = ["emode>=1.1.27"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium · Locked installs cannot use EMode

When a caller installs with the committed lockfile in locked or frozen mode, uv.lock still resolves the emode extra to emodeconnection instead of emode, so uv sync --locked aborts and frozen installs leave gplugins.emode without the renamed module; callers cannot install or import the plugin.

Regenerate uv.lock to match the new emode dependency.

Also at gplugins/emode/emode.py:22.

Prompt for AI agents
In `pyproject.toml` at line 61:

**Locked installs cannot use EMode**

When a caller installs with the committed lockfile in locked or frozen mode, `uv.lock` still resolves the `emode` extra to `emodeconnection` instead of `emode`, so `uv sync --locked` aborts and frozen installs leave `gplugins.emode` without the renamed module; callers cannot install or import the plugin.

Regenerate `uv.lock` to match the new `emode` dependency.

Also at `gplugins/emode/emode.py:22`.

Comment thread gplugins/emode/emode.py
from typing import Any

import emodeconnection as emc
import emode as emc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium · Existing installs fail to import plugin

When an existing environment upgrades gplugins without reinstalling the emode extra, python raises ModuleNotFoundError on the unconditional import emode, so importing gplugins.emode fails for users who upgrade gplugins without reinstalling its optional extra and still have only the old emodeconnection package.

Add a compatibility import for the old client or ensure the upgrade path explicitly reinstalls the emode extra.

Also at pyproject.toml:61.

Prompt for AI agents
In `gplugins/emode/emode.py` at line 22:

**Existing installs fail to import plugin**

When an existing environment upgrades gplugins without reinstalling the `emode` extra, python raises `ModuleNotFoundError` on the unconditional `import emode`, so importing `gplugins.emode` fails for users who upgrade gplugins without reinstalling its optional extra and still have only the old `emodeconnection` package.

Add a compatibility import for the old client or ensure the upgrade path explicitly reinstalls the `emode` extra.

Also at `pyproject.toml:61`.

@nikosavola
nikosavola enabled auto-merge (rebase) November 26, 2026 14:30
@nikosavola
nikosavola merged commit 0073169 into gdsfactory:main Nov 26, 2026
20 of 25 checks passed
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