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
+100-1
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ pip install -e .[dev]
38
38
39
39
## Fixing outstanding issues
40
40
41
-
If you notice an issue with the existing code and have a fix in mind, feel free to [start contributing](#create-a-pull-request) and open a Pull Request!
41
+
If you notice an issue with the existing code and have a fix in mind, feel free to [start contributing](#submitting-a-pull-request-pr) and open a Pull Request!
42
42
43
43
## Submitting a bug-related issue or feature request
44
44
@@ -257,6 +257,105 @@ That's how `make test` is implemented (without the `pip install` line)!
257
257
You can specify a smaller set of tests to test only the feature
258
258
you're working on.
259
259
260
+
### Writing documentation
261
+
262
+
High-quality documentation is crucial for maintaining a project that is easy to use, understand, and extend. When adding new features, ensure they are thoroughly documented to maintain consistency and clarity throughout the project.
263
+
264
+
To illustrate what good documentation looks like, here’s an example of a well-documented function:
* **Line Wrapping:** Applied a consistent line wrap at column 120 to improve readability.
294
+
* **Definite Articles:** Removed definite articles where possible to streamline language. (Eg: Changed "The string to replicate" to "String to replicate")
295
+
* **Type Annotations:**
296
+
* Always include type definitions, indicating if a parameter is optional and specifying the default value.
297
+
* Note that `Optional` means that the value can be `None`, and `*optional*` means that it is not required for the user to pass a value.
298
+
E.g., for arguments that can't be `None` and aren't required:
299
+
300
+
```python
301
+
foo (`int`, *optional*, defaults to `4`):
302
+
```
303
+
304
+
For arguments that can be `None` and are required:
305
+
306
+
```python
307
+
foo (`Optional[int]`):
308
+
```
309
+
310
+
for arguments that can be `None` and aren't required:
311
+
312
+
```python
313
+
foo (`Optional[int]`, *optional*, defaults to `None`):
314
+
```
315
+
316
+
***String Defaults:**
317
+
* Ensured that default string values are wrapped in double quotes:
318
+
319
+
```python
320
+
defaults to `"foo"`
321
+
```
322
+
323
+
***Dictionary Typing:**
324
+
* Replaced generic `dict`type hints with more explicit `dict[str, Any]` to clarify expected key-value pairs.
325
+
***Default Value Formatting:**
326
+
* Consistently surrounded default values with backticks for improved formatting:
327
+
328
+
```python
329
+
defaults to `4`
330
+
```
331
+
332
+
***Sub-sectioning:** When the number of arguments is large, consider breaking them into sub-sections for better readability.
include_variance (`bool`, *optional*, defaults to `False`):
350
+
Whether to include the variance of the dataset in the results.
351
+
352
+
Returns:
353
+
`dict[str, float]`:
354
+
A dictionary containing calculated statistics such as mean, median, and optionally variance.
355
+
"""
356
+
...
357
+
```
358
+
260
359
### Deprecation and Backward Compatibility
261
360
262
361
Our approach to deprecation and backward compatibility is flexible and based on the feature’s usage and impact. Each deprecation is carefully evaluated, aiming to balance innovation with user needs.
0 commit comments