Skip to content

Conversation

@yaugenst-flex
Copy link
Contributor

@yaugenst-flex yaugenst-flex commented Apr 14, 2025

Spelling errors within Markdown cells or comments in notebooks currently go mostly unnoticed. We want to catch these errors.

The aim of this PR is to inform developers rather than block merging, as there can be false positives in the spell check.

Changes Implemented:

  1. spellcheck.py: Executed as part of the notebooks-linting workflow.
  2. Targeted Execution: The spell check runs only on .ipynb files that have been modified within the context of the specific pull request. This is achieved using the tj-actions/changed-files action.
  3. Non-Blocking Check: The spell check step is configured with continue-on-error: true. This means that even if spellcheck.py finds errors and exits with a non-zero status code, the overall CI workflow will not fail. Linting failures will still cause the workflow to fail as before.
  4. PR Commenting: If spellcheck.py detects any spelling errors or encounters issues processing a file, its formatted output is captured and posted as a comment directly on the PR, see here for example.

Closes #207

@tomflexcompute
Copy link
Contributor

This is actually great. I ran the spellchecker only on markdown cells instead of the code cells. I'll fix these typos in the other PR.

@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ci-spellcheck branch from a417ff5 to 3852c90 Compare April 15, 2025 15:09
@yaugenst-flex yaugenst-flex changed the title Add spell checking for notebooks to CI CI: Add Non-Blocking Notebook Spell Check with PR Commenting Apr 16, 2025
@yaugenst-flex yaugenst-flex linked an issue Apr 16, 2025 that may be closed by this pull request
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ci-spellcheck branch from e4354c2 to b12ed32 Compare April 16, 2025 09:16
@daquinteroflex
Copy link
Collaborator

Went thought the action, nice, quite like the logic! Looks good

@flexcompute flexcompute deleted a comment from github-actions bot Apr 16, 2025
@flexcompute flexcompute deleted a comment from github-actions bot Apr 16, 2025
@flexcompute flexcompute deleted a comment from github-actions bot Apr 16, 2025
Copy link
Collaborator

@daquinteroflex daquinteroflex left a comment

Choose a reason for hiding this comment

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

Looks good broadly!

@github-actions
Copy link
Contributor

github-actions bot commented Apr 16, 2025

Spell Check Report

AdjointPlugin12LightExtractor.ipynb:

193: "This function includes a circular region of constant permittivity value surrounding the QE. The objective here is to protect the QE from etching. In applications such as single photon sources, a larger unperturbed region surrounding the QE can be helpful to reduce linewidth broadening, as stated in `J. Liu, K. Konthasinghe, M. Davanco, J. Lawall, V. Anant, V. Verma, R. Mirin, S. Nam, S. Woo, D. Jin, B. Ma, Z. Chen, H. Ni, Z. Niu, K. Srinivasan, \"Single Self-Assembled InAs/GaAs Quantum Dots in Photonic Nanostructures: The Role of Nanofabrication,\" Phys. Rev. Appl. 9(6), 064019 (2018)` [DOI: 10.1103/PhysRevApplied.9.064019](https://link.aps.org/doi/10.1103/PhysRevApplied.9.064019)."
	Nam ==> Name

Autograd12LightExtractor.ipynb:

178: "This function includes a circular region of constant permittivity value surrounding the QE. The objective here is to protect the QE from etching. In applications such as single photon sources, a larger unperturbed region surrounding the QE can be helpful to reduce linewidth broadening, as stated in `J. Liu, K. Konthasinghe, M. Davanco, J. Lawall, V. Anant, V. Verma, R. Mirin, S. Nam, S. Woo, D. Jin, B. Ma, Z. Chen, H. Ni, Z. Niu, K. Srinivasan, \"Single Self-Assembled InAs/GaAs Quantum Dots in Photonic Nanostructures: The Role of Nanofabrication,\" Phys. Rev. Appl. 9(6), 064019 (2018)` [DOI: 10.1103/PhysRevApplied.9.064019](https://link.aps.org/doi/10.1103/PhysRevApplied.9.064019)."
	Nam ==> Name

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

@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ci-spellcheck branch from 47d8306 to 8638f03 Compare April 16, 2025 10:11
@yaugenst-flex
Copy link
Contributor Author

yaugenst-flex commented Apr 16, 2025

I ran the spell check on all notebooks and fixed the remaining typos. So everything should be clean for now. The remaining spell check errors are false positives that we can ignore. They won't pop up again unless the respective notebooks are changed.

@yaugenst-flex yaugenst-flex marked this pull request as ready for review April 16, 2025 10:14
Copy link
Contributor

@tomflexcompute tomflexcompute left a comment

Choose a reason for hiding this comment

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

Great addition to the workflow!

@yaugenst-flex yaugenst-flex merged commit c22695e into develop Apr 16, 2025
1 check passed
@yaugenst-flex yaugenst-flex deleted the yaugenst-flex/ci-spellcheck branch June 27, 2025 07:14
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.

Notebook linting

4 participants