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

Fix ruff #535

Merged
merged 2 commits into from
Jan 11, 2025
Merged

Fix ruff #535

merged 2 commits into from
Jan 11, 2025

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented Jan 11, 2025

fix some ruff issues

Summary by Sourcery

Fix various linting issues.

Bug Fixes:

  • Fixed a typo in a comment.
  • Removed an unused import.
  • Fixed a syntax error in a code example.
  • Fixed a bug in the bend_euler function where the docstring was incorrectly formatted.
  • Fixed a bug where the propagation loss was not being printed.
  • Fixed a bug where the effective index was not being printed.
  • Fixed a bug in the mmi2x2 function where the loss_dB_bar parameter was incorrectly named loss_dB_thru.
  • Fixed a bug in the write_sdevice_quasistationary_ramp_voltage_dd function where the parameters were incorrectly documented.
  • Fixed a bug where the coupling length docstring was incorrectly formatted.
  • Fixed a bug where the layer to port delimiter was incorrectly documented as layer-port delimiter.

Copy link
Contributor

sourcery-ai bot commented Jan 11, 2025

Reviewer's Guide by Sourcery

This pull request fixes some ruff issues in the notebooks and makes some minor code improvements.

Flow diagram of code cleanup changes

flowchart LR
    subgraph Changes[Code Cleanup Changes]
        A[Remove unused imports]
        B[Fix docstring formatting]
        C[Convert code cells to markdown]
        D[Add print statements]
        E[Fix comment formatting]
    end

    style Changes fill:#f5f5f5,stroke:#333,stroke-width:2px
    style A fill:#e1f5fe
    style B fill:#e1f5fe
    style C fill:#e1f5fe
    style D fill:#e1f5fe
    style E fill:#e1f5fe
Loading

File-Level Changes

Change Details Files
Removed unused import
  • Removed the unused pyvista import
notebooks/elmer_01_electrostatic.ipynb
Changed cell type and added code
  • Changed a code cell to a markdown cell and included the code in a markdown code block
  • Added code to display results and visualize the field
notebooks/elmer_01_electrostatic.ipynb
Added missing imports and function call
  • Added meep import
  • Added get_simulation import from gplugins.gmeep
  • Added code to define an objective function and plot the geometry after each iteration
notebooks/meep_01_sparameters.ipynb
Added code for bitmask definition
  • Added code to define spatial arrays and bitmasks for boundary conditions
notebooks/meep_01_sparameters.ipynb
Added print statements
  • Added print statements for strip.n_eff and propagation_loss
notebooks/tidy3d_01_tidy3d_modes.ipynb
notebooks/tidy3d_01_tidy3d_bend.ipynb
Updated kernel specification
  • Changed kernel display name from "Python 3" to "base"
  • Added language information
notebooks/tidy3d_01_tidy3d_modes.ipynb
Updated sdevice function parameters
  • Changed filepath, file_settings, output_settings, physics_settings, math_settings, and initialization_commands parameters to filename, save_directory, execution_directory, output_settings, physics_settings, and math_settings
gplugins/sentaurus/sdevice.py
Added HyperOptSearch import
  • Added import for HyperOptSearch from ray.tune.search.hyperopt
notebooks/ray_optimiser.ipynb
Added import and docstring update
  • Added matplotlib.pyplot import
  • Updated bend_euler docstring
  • Removed unnecessary newline characters
notebooks/workflow_2_ring.ipynb
notebooks/sax_01_sax.ipynb
Updated parameter names and docstrings
  • Simplified docstrings
  • Renamed loss_dB_bar parameter to loss_dB_thru
  • Removed unnecessary newline characters
gplugins/vlsir/export_netlist.py
gplugins/sax/models.py
notebooks/mpb_001_mpb_waveguide.ipynb
notebooks/palace_01_electrostatic.ipynb

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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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

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.

@github-actions github-actions bot added the bug Something isn't working label Jan 11, 2025
@joamatab joamatab merged commit a4f712a into main Jan 11, 2025
9 of 13 checks passed
@joamatab joamatab deleted the fix_ruff branch January 11, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant