Fix all_models notebook lint suppression placement and readability issues#667
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix ruff disable comment positioning and improve readability
Fix all_models notebook lint suppression placement and readability issues
Jul 1, 2026
nikosavola
approved these changes
Jul 1, 2026
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the all_models notebook source and synced .ipynb to improve lint correctness and readability by relocating the Ruff E402 suppression, replacing walrus-operator inline assignments with explicit variables, and converting ambiguous positional arguments to named keyword arguments in a coupler example. Flow diagram for updated import and Ruff suppression placement in all_models notebookflowchart TB
ruff_disable[Ruff disable E402 comment]
import_jnp[Import jax.numpy as jnp]
import_plt[Import matplotlib.pyplot as plt]
import_PDK[Import PDK from qpdk]
activate_PDK[Call PDK.activate]
ruff_disable --> import_jnp --> import_plt --> import_PDK --> activate_PDK
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Co-authored-by: nikosavola <7860886+nikosavola@users.noreply.github.com>
a35e5f4 to
aa7da10
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the
all_modelsnotebook source to match the requested lint/readability fixes: the E402 suppression is now applied at the correct location, and ambiguous inline assignments/positional arguments were rewritten for clarity. The paired.ipynbwas regenerated from jupytext to keep notebook artifacts in sync.Lint suppression placement (E402)
# ruff: disable[E402]to immediately precede the late imports it is intended to suppress (beforejax.numpyimport), instead of placing it afterPDK.activate().Readable variable assignment (remove walrus in calls)
capacitor(...)andinductor(...)calls with explicit prior assignments:capacitance = 100e-15inductance = 1e-9Named arguments for coupling capacitance example
cpw_cpw_coupling_capacitance(TEST_FREQUENCY, 100, 100, "cpw")to explicit keyword arguments for self-documenting intent.Original prompt
Summary by Sourcery
Improve lint suppression placement and code readability in the all_models notebook and its Python source.
Enhancements: