Skip to content

update notebooks to local ModeSimulation#532

Open
FilipeFcp wants to merge 3 commits into
developfrom
filipe/SetLocalRun
Open

update notebooks to local ModeSimulation#532
FilipeFcp wants to merge 3 commits into
developfrom
filipe/SetLocalRun

Conversation

@FilipeFcp

@FilipeFcp FilipeFcp commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Example notebook and API migration only; no library or runtime product code changes.

Overview
Updates three Tidy3D example notebooks to use td.ModeSimulation instead of the ModeSolver plugin, including doc links and narrative text.

8-channel demultiplexer: Width-sweep mode solves now build ModeSimulation.from_simulation and submit via web.run (noted as server-side for ~30 tasks per sweep); a one-off bus-waveguide visualization uses run_local(). td.config.simulation.use_local_subpixel = True is set in setup.

90° bend polarization splitter/rotator and anisotropic metamaterial PBS: Mode analysis moves from run_mode_solver on the server to local ModeSimulation.run_local() with local subpixel averaging; the PBS notebook also switches field plots from mode_solver.plot_field to sim_data.plot_field.

Imports drop tidy3d.plugins.mode helpers where no longer needed.

Reviewed by Cursor Bugbot for commit d2327f3. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Spell Check Report

TFLNTidy3d.ipynb:

Cell 38, Line 1: 'voltage-dependent'
  > Next, we run the voltage-dependent mode simulations with `web.run`.

Checked 7 notebook(s). Found spelling errors in 1 file(s).
Generated by GitHub Action run: https://github.com/flexcompute/tidy3d-notebooks/actions/runs/28385017374

@FilipeFcp

Copy link
Copy Markdown
Contributor Author

Hi guys. Just updated a few notebooks

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d2327f3. Configure here.

"metadata": {},
"source": [
"To obtain the width of the bus waveguide in each asymmetric directional coupler, we need to first calculate the relationship between the effective indices of each mode and the waveguide width. This can be achieved by using the [ModeSolver](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.plugins.mode.ModeSolver.html) from Tidy3D's plugins. This computation will be done on a local computer so it won't cost any FlexCredits.\n",
"To obtain the width of the bus waveguide in each asymmetric directional coupler, we need to first calculate the relationship between the effective indices of each mode and the waveguide width. This can be achieved by using the [ModeSimulation](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.ModeSimulation.html) from Tidy3D's plugins. This computation will be done on a local computer so it won't cost any FlexCredits.\n",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Notebook claims local free runs

Medium Severity

The mode-index width-sweep cells now submit each iteration with web.run, but the introductory text still states the step runs locally and costs no FlexCredits. Readers who trust that description will misjudge cost and runtime versus what the notebook actually executes.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d2327f3. Configure here.

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

Looks great, thanks @FilipeFcp !

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.

3 participants