-
Notifications
You must be signed in to change notification settings - Fork 14
feat(cicd): add pyspellchecker and interactive script to extend vocabulary #312
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
feat(cicd): add pyspellchecker and interactive script to extend vocabulary #312
Conversation
|
The file has grown through the new checks and I am thinking about pulling this out into its own proper package. What do you think @yaugenst-flex , @daquinteroflex ? |
|
Can |
|
I could adapt the code so that pyspellchecker also checks symbols. Right now I have restricted it to comments and left the code part to codespell. |
|
I think if it works better then there is no reason to keep |
|
Ok! You are right with the interactive mode 😄 It was mainly so that I did not have to add the words manually. But I will also try to remove false positives by cross checking error-candidates with other notebooks. If something is spelled the same way in 2, 3 notebooks it is less likely to be an error I guess. |
Spell Check Report8ChannelDemultiplexer.ipynb: 90OpticalHybrid.ipynb: AdjointPlugin12LightExtractor.ipynb: AdjointPlugin13Metasurface.ipynb: AdjointPlugin1Intro.ipynb: AdjointPlugin2GradientChecking.ipynb: AdjointPlugin3InverseDesign.ipynb: AllDielectricStructuralColor.ipynb: AndersonLocalization.ipynb: AntennaCharacteristics.ipynb: Autograd13Metasurface.ipynb: Autograd16BilayerCoupler.ipynb: Autograd1Intro.ipynb: Autograd21GaPLightExtractor.ipynb: Autograd2GradientChecking.ipynb: Autograd3InverseDesign.ipynb: Autograd9WDM.ipynb: BoundaryConditions.ipynb: CharacteristicImpedanceCalculator.ipynb: CircularlyPolarizedPatchAntenna.ipynb: DielectricMetasurfaceAbsorber.ipynb: DirectionalCouplerSurrogate.ipynb: DistributedBraggReflectorCavity.ipynb: EMEBends.ipynb: EulerWaveguideBend.ipynb: FresnelLens.ipynb: GDSImport.ipynb: GeometryTransformations.ipynb: HighQSi.ipynb: LowContrastWaveguide.ipynb: Metalens.ipynb: MidIRMetalens.ipynb: NanobeamCavity.ipynb: NanostructuredBoronNitride.ipynb: ParticleSwarmOptimizedPBS.ipynb: PlasmonicNanoparticle.ipynb: PlasmonicPhotothermalHeating.ipynb: RadiativeCoolingGlass.ipynb: SMatrix.ipynb: SelfIntersectingPolyslab.ipynb: VortexMetasurface.ipynb: WaveguideBendSimulator.ipynb: WaveguideGratingAntenna.ipynb: WaveguideSizeConverter.ipynb: WebAPI.ipynb: WidebandBeamSteerableReflectarrayWithPRUC.ipynb: ZeroCrossTalkTE.ipynb: Checked 196 notebook(s). Found spelling errors in 47 file(s). |
|
You can run the LLM mode by setting the |
|
@yaugenst-flex this is ready for re-review 😊 |
yaugenst-flex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @frederikschubertflex this looks great, I don't really have anything to add. I guess the next step would be to fix the typos? 😄
|
Great! 👍 yes, I will open a PR today for the typos. |
While
codespellcheck works for common typos, it is not sufficient to catch all errors. This PR adds the vocabulary-basedpyspellcheckerto thespellcheck.pyscript and integrates it with the existing approach.Running it on
PlasmonicPhotothermalHeatingresults in this output:Spell Check Report
PlasmonicPhotothermalHeating.ipynb (codespell):
PlasmonicPhotothermalHeating.ipynb (pyspellchecker):
Checked 1 notebook(s). Found spelling errors in 1 file(s).
Interactive Mode
To extend the vocabulary, you can run the script using
./spellcheck.py PlasmonicPhotothermalHeating.ipynb --interactive. This will guide you through all possible spelling mistakes which can be added to the ignore list.This is the extended codespellrc file after running through the spelling mistakes.
Re-running the spell check then results in this output
Spell Check Report
PlasmonicPhotothermalHeating.ipynb (codespell):
PlasmonicPhotothermalHeating.ipynb (pyspellchecker):
Checked 1 notebook(s). Found spelling errors in 1 file(s).