diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8f10f67..26ef2da 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -18,30 +18,30 @@ Before submitting any issue, please perform a thorough search to see if your pro
If you like the project and wish to contribute, you can start by looking at issues labeled `good first issue` (should only require a few lines of code) or `help wanted` (more involved). If you found a bug and want to fix it, please create an issue reporting the bug before creating a pull request. Similarly, if you want to add a new feature, first create a feature request issue. This allows to separate the discussions related to the bug/feature, from the discussions related to the fix/implementation.
-### Code conventions
+### Testing
-We mostly follow the [PEP 8](https://peps.python.org/pep-0008/) style guide for Python code. It is recommended that you format your code with the opinionated [Black](https://github.com/psf/black) formatter. For example, if you created or modified a file `path/to/filename.py`, you can reformat it with
+We use [pytest](https://docs.pytest.org) to test our code base. If your contribution introduces new components, you should write new tests to make sure your code doesn't crash under normal circumstances. After installing `pytest`, add the tests to the [tests/](tests) directory and run them with
```
-black -S path/to/filename.py
+pytest tests
```
-Additionally, please follow these rules:
-
-* Use single quotes for strings (`'single-quoted'`) but double quotes (`"double-quoted"`) for text such as error messages.
-* Use informative but concise variable names. Single-letter names are fine if the context is clear.
-* Avoid explaining code with comments. If something is hard to understand, simplify or decompose it.
-* If Black's output [takes too much vertical space](https://github.com/psf/black/issues/1811), ignore its modifications.
+It is also recommended to ensure your code works as expected within toy experiments similar to the [tutorials](docs/tutorials). When you submit a pull request, tests are automatically (upon approval) executed for several versions of Python and PyTorch.
-### Testing
+### Code conventions
-We use [pytest](https://docs.pytest.org) to test our code base. If your contribution introduces new components, you should write new tests to make sure your code doesn't crash under normal circumstances. After installing `pytest`, add the tests to the [tests/](tests) directory and run them with
+We use [Ruff](https://github.com/astral-sh/ruff) to lint and format all Python code. After installing `ruff`, you can check if your code follows our conventions with
```
-pytest tests
+ruff check .
+ruff format --check .
```
-It is also recommended to ensure your code works as expected within toy experiments similar to the [tutorials](docs/tutorials). When you submit a pull request, tests are automatically (upon approval) executed for several versions of Python and PyTorch.
+Additionally, please follow these rules:
+
+* Use single quotes for strings (`'single-quoted'`) but double quotes (`"double-quoted"`) for text such as error messages.
+* Use informative but concise variable names. Single-letter names are fine if the context is clear.
+* Avoid explaining code with comments. If something is hard to understand, simplify or decompose it.
### Documentation
diff --git a/docs/conf.py b/docs/conf.py
index ee82d21..bf55105 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,8 +1,8 @@
# Configuration file for the Sphinx documentation builder
import glob
-import inspect
import importlib
+import inspect
import lampe
import re
import subprocess
@@ -59,22 +59,22 @@ def linkcode_resolve(domain: str, info: dict) -> str:
for name in fullname.split('.'):
objct = getattr(objct, name)
+ if hasattr(objct, '__wrapped__'):
+ objct = objct.__wrapped__
+
try:
file = inspect.getsourcefile(objct)
file = file[file.rindex(package) :]
lines, start = inspect.getsourcelines(objct)
end = start + len(lines) - 1
- except Exception as e:
+ except Exception:
return None
else:
return f'{repository}/blob/{commit}/{file}#L{start}-L{end}'
-napoleon_custom_sections = [
- ('Shapes', 'params_style'),
- 'Wikipedia',
-]
+napoleon_custom_sections = ['Wikipedia']
nb_execution_mode = 'off'
myst_enable_extensions = ['dollarmath']
@@ -129,6 +129,7 @@ def linkcode_resolve(domain: str, info: dict) -> str:
## Edit HTML
+
def edit_html(app, exception):
if exception:
raise exception
@@ -137,12 +138,15 @@ def edit_html(app, exception):
with open(file, 'r') as f:
text = f.read()
+ # fmt: off
text = text.replace('@pradyunsg\'s', '')
text = text.replace('[source]', '')
text = re.sub(r'()(