You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,32 @@ Run following command from `website` folder. It will build the docs and serve th
95
95
./scripts/build_website.sh
96
96
```
97
97
98
+
You can also perform spell checks on documentation automatically (besides IDEs) using [```sphinxcontrib-spelling```](https://sphinxcontrib-spelling.readthedocs.io/en/latest/install.html)
99
+
Note that you will also need [```PyEnchant```](https://pyenchant.github.io/pyenchant/) to run ```sphinxcontrib-spelling```, and thus the Enchant C library. Use this guide for ```PyEnchant```.
100
+
101
+
Steps:
102
+
1. Install the extension with pip: ```pip install sphinxcontrib-spelling```
103
+
2. Add ```sphinxcontrib.spelling``` to the extensions list in ```conf.py```.
104
+
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".
105
+
4. Make sure you have a ```source``` and ```build``` folder. Pass "spelling" as the builder argument to ```sphinx-build```.
106
+
```
107
+
cd website/sphnix
108
+
mkdir build # if you do not already have one
109
+
sphinx-build -b spelling source build
110
+
```
111
+
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:
112
+
* File name: ```batch_memory_manager.spelling```
113
+
* File content:
114
+
```
115
+
../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchMemoryManager:5: (occasinal) safeguarding against occasinal large batches produced by
116
+
../../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
117
+
../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchMemoryManager:14: (behaviour) a logical one, and will change behaviour accordignly.
118
+
../../opacus/utils/batch_memory_manager.py:docstring of opacus.utils.batch_memory_manager.BatchMemoryManager:14: (accordignly) a logical one, and will change behaviour accordignly.
119
+
../../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,
120
+
```
121
+
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.
0 commit comments