From 8d78aa008176f6653bb22aeb22a09b2e69aa7c07 Mon Sep 17 00:00:00 2001 From: Yuchen Zhang Date: Sat, 27 Aug 2022 09:38:47 -0700 Subject: [PATCH 1/3] add instruction of spelling check using sphinxcontrib-spelling to CONTRIBUTING.md --- CONTRIBUTING.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e1682e2..dae3913d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,6 +95,32 @@ Run following command from `website` folder. It will build the docs and serve th ./scripts/build_website.sh ``` +You can also perform spell checks on documentation automatically (besides IDEs) using [```sphinxcontrib-spelling```](https://sphinxcontrib-spelling.readthedocs.io/en/latest/install.html) +Note that you will also need [```PyEchant```](https://pyenchant.github.io/pyenchant/) to run ```sphinxcontrib-spelling```, and the Enchant C library. Use this guide for ```PyEchant```. + +Steps: +1. Install the extension with pip: ```pip install sphinxcontrib-spelling``` +2. Add ```sphinxcontrib.spelling``` to the extensions list in ```conf.py```. +3. Install ```PyEchant```. Please follow the [installation guide](https://pyenchant.github.io/pyenchant/install.html). Noticed that Apple Silicons may require a way around under section "Apple Silicon related errors". +4. Make sure you have a ```source``` and ```build``` folder. Pass "spelling" as the builder argument to ```sphinx-build```. + ``` + cd website/sphnix + mkdir build # if you do not already have one + sphinx-build -b spelling source build + ``` +5. Find files with spelling errors in ```build``` (remember to check each folder). A file will be generated for each source file that contains spelling error. Example: + * File name: ```batch_memory_manager.spelling``` + * File content: + ``` + ../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchMemoryManager:5: (occasinal) safeguarding against occasinal large batches produced by + ../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchMemoryManager:13: (optimzer) On every step optimzer will check if the batch was the last physical batch comprising + ../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchMemoryManager:14: (behaviour) a logical one, and will change behaviour accordignly. + ../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchMemoryManager:14: (accordignly) a logical one, and will change behaviour accordignly. + ../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchSplittingSampler:4: (physocal) Used to split large logical batches into physocal batches of a smaller size, + ``` +6. Manually review the spelling files and make changes in source files accordingly. Some detections are not perfect. For example, "nn" (from torch.nn) can be detected as a spelling error. + + ## Pull Requests We actively welcome your pull requests. From d9fccc92f2e23c7c832c0d3c9d43c0e24d5ab73f Mon Sep 17 00:00:00 2001 From: Yuchen Zhang <58858942+zycalice@users.noreply.github.com> Date: Mon, 29 Aug 2022 15:26:32 -0700 Subject: [PATCH 2/3] Update CONTRIBUTING.md Co-authored-by: Karthik Prasad --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dae3913d..5f9cb7ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,7 +96,7 @@ Run following command from `website` folder. It will build the docs and serve th ``` You can also perform spell checks on documentation automatically (besides IDEs) using [```sphinxcontrib-spelling```](https://sphinxcontrib-spelling.readthedocs.io/en/latest/install.html) -Note that you will also need [```PyEchant```](https://pyenchant.github.io/pyenchant/) to run ```sphinxcontrib-spelling```, and the Enchant C library. Use this guide for ```PyEchant```. +Note that you will also need [```PyEnchant```](https://pyenchant.github.io/pyenchant/) to run ```sphinxcontrib-spelling```, and the Enchant C library. Use this guide for ```PyEnchant```. Steps: 1. Install the extension with pip: ```pip install sphinxcontrib-spelling``` From 85f8411cdb00442375856b33f46c84e9d14afe9c Mon Sep 17 00:00:00 2001 From: Yuchen Zhang <58858942+zycalice@users.noreply.github.com> Date: Mon, 29 Aug 2022 15:35:52 -0700 Subject: [PATCH 3/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f9cb7ec..f8eaa933 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,7 +101,7 @@ Note that you will also need [```PyEnchant```](https://pyenchant.github.io/pyenc Steps: 1. Install the extension with pip: ```pip install sphinxcontrib-spelling``` 2. Add ```sphinxcontrib.spelling``` to the extensions list in ```conf.py```. -3. Install ```PyEchant```. Please follow the [installation guide](https://pyenchant.github.io/pyenchant/install.html). Noticed that Apple Silicons may require a way around under section "Apple Silicon related errors". +3. Install ```PyEnchant```. Please follow the [installation guide](https://pyenchant.github.io/pyenchant/install.html). Noticed that Apple Silicons may require a way around under section "Apple Silicon related errors". 4. Make sure you have a ```source``` and ```build``` folder. Pass "spelling" as the builder argument to ```sphinx-build```. ``` cd website/sphnix