Update docs, instructions and format code
This commit is contained in:
parent
fca232da91
commit
4260b492ab
29 changed files with 987 additions and 467 deletions
7
.github/python.instructions.md
vendored
7
.github/python.instructions.md
vendored
|
|
@ -10,7 +10,7 @@ applyTo: '**/*.py,**/*.ipynb'
|
|||
- Write clear and concise comments for each function.
|
||||
- Ensure functions have descriptive names and include type hints.
|
||||
- Provide docstrings following PEP 257 conventions.
|
||||
- Use the `typing` module for type annotations (e.g., `List[str]`, `Dict[str, int]`).
|
||||
- Use the `typing` module for advanced type annotations (e.g., `TypedDict`, `Literal["a", "b", ...]`).
|
||||
- Break down complex functions into smaller, more manageable functions.
|
||||
|
||||
## General Instructions
|
||||
|
|
@ -27,7 +27,7 @@ applyTo: '**/*.py,**/*.ipynb'
|
|||
|
||||
- Follow the **PEP 8** style guide for Python.
|
||||
- Maintain proper indentation (use 4 spaces for each level of indentation).
|
||||
- Ensure lines do not exceed 79 characters.
|
||||
- Ensure lines do not exceed 120 characters.
|
||||
- Place function and class docstrings immediately after the `def` or `class` keyword.
|
||||
- Use blank lines to separate functions, classes, and code blocks where appropriate.
|
||||
|
||||
|
|
@ -41,6 +41,8 @@ applyTo: '**/*.py,**/*.ipynb'
|
|||
## Example of Proper Documentation
|
||||
|
||||
```python
|
||||
import math
|
||||
|
||||
def calculate_area(radius: float) -> float:
|
||||
"""
|
||||
Calculate the area of a circle given the radius.
|
||||
|
|
@ -51,6 +53,5 @@ def calculate_area(radius: float) -> float:
|
|||
Returns:
|
||||
float: The area of the circle, calculated as π * radius^2.
|
||||
"""
|
||||
import math
|
||||
return math.pi * radius ** 2
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue