Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc improvements #532

Merged
merged 31 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
42d2ba7
Fix missing refs
mdbenito Mar 20, 2024
4813187
Fix links to tfl and pydvl
mdbenito Mar 20, 2024
d356bc2
Pin versions to fix problem with section-index plugin. Add imaging de…
mdbenito Mar 20, 2024
885eb82
Tweaks to config for api generation, social plugin,
mdbenito Mar 20, 2024
d1a79df
Minor fixes to docstrings
mdbenito Mar 20, 2024
1f29a41
Pin some plugin versions and update
mdbenito Mar 21, 2024
edcc5be
Update CONTRIBUTING guide
mdbenito Mar 21, 2024
64d003b
Fix a bunch of docstrings
mdbenito Mar 21, 2024
07a4673
Fix links and typos in CONTRIBUTING.md
mdbenito Mar 21, 2024
a700024
More docstrings and refs
mdbenito Mar 21, 2024
60ed8fc
Fix pinned versions
mdbenito Mar 21, 2024
8d819e5
New nav, improved index, example gallery, more text
mdbenito Mar 21, 2024
4737071
Update bib from Zotero
mdbenito Mar 21, 2024
26feac8
Add images, move pngs to LFS
mdbenito Mar 21, 2024
ff2fd55
Minor
mdbenito Mar 21, 2024
c75d76f
Merge branch 'develop' into doc/fix-broken-refs
mdbenito Mar 21, 2024
2c4dd90
Rename and more fixes
mdbenito Mar 21, 2024
dd47540
Improve some docstrings
mdbenito Mar 21, 2024
c7c28fb
Add missing type
mdbenito Mar 21, 2024
ea04db1
Fix more links
mdbenito Mar 21, 2024
560363d
Typo
mdbenito Mar 21, 2024
7c7bd6c
Again
mdbenito Mar 21, 2024
476cf7b
Minor
mdbenito Mar 21, 2024
10c8d43
Use navigation tabs
mdbenito Mar 21, 2024
4c008fa
Update changelog and remove some whitespace
mdbenito Mar 21, 2024
c813702
Defluffing 🤦
mdbenito Mar 21, 2024
5276b29
Add benchmarking section, move methods, update bib
mdbenito Mar 21, 2024
aa259f2
Simplify requirements-docs.txt
mdbenito Mar 22, 2024
fc556d0
Improve docs: LC and data value problems
mdbenito Mar 22, 2024
48a2770
Pin more versions in requirements-docs.txt
mdbenito Mar 22, 2024
c2a0774
Improve docstring
mdbenito Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
notebooks/*.ipynb -linguist-detectable
*.png filter=lfs diff=lfs merge=lfs -text
17 changes: 9 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
are available through `pydvl.utils.cache`
[PR #509](https://github.com/aai-institute/pyDVL/pull/509)

### Miscellaneous
### Changed

- Improvements to documentation: fixes, links, text, example gallery and more
[PR #532](https://github.com/aai-institute/pyDVL/pull/532)
- Bump versions of CI actions to avoid warnings [PR #502](https://github.com/aai-institute/pyDVL/pull/502)
- Add Python Version 3.11 to supported versions [PR #510](https://github.com/aai-institute/pyDVL/pull/510)
- Documentation improvements and cleanup [PR #521](https://github.com/aai-institute/pyDVL/pull/521) [PR #522](https://github.com/aai-institute/pyDVL/pull/522)
Expand All @@ -49,7 +51,7 @@
- Fixed bug with checking for converged values in semivalues
[PR #341](https://github.com/appliedAI-Initiative/pyDVL/pull/341)

### Docs
### Changed

- Add applications of data valuation section, display examples more prominently,
make all sections visible in table of contents, use mkdocs material cards
Expand Down Expand Up @@ -105,6 +107,11 @@
- Faster semi-value computation with per-index check of stopping criteria (optional)
[PR #437](https://github.com/aai-institute/pyDVL/pull/437)

### Fixed

- Fix initialization of `data_names` in `ValuationResult.zeros()`
[PR #443](https://github.com/aai-institute/pyDVL/pull/443)

### Changed

- No longer using docker within tests to start a memcached server
Expand All @@ -116,12 +123,6 @@
- Refactoring of parallel module. Old imports will stop working in v0.9.0
[PR #421](https://github.com/aai-institute/pyDVL/pull/421)

### Fixed

- Fix initialization of `data_names` in `ValuationResult.zeros()`
[PR #443](https://github.com/aai-institute/pyDVL/pull/443)


## 0.7.0 - 📚🆕 Documentation and IF overhaul, new methods and bug fixes 💥🐞

This is our first β release! We have worked hard to deliver improvements across
Expand Down
83 changes: 63 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ improvements to the currently implemented methods and other ideas. Please open a
ticket with yours.

If you are interested in setting up a similar project, consider the template
[pymetrius](https://github.com/aai-institute/pymetrius).
[pymetrius](https://github.com/appliedAI-Initiative/pymetrius).

## Local development

Expand Down Expand Up @@ -239,7 +239,8 @@ This applies a simple CSS-filter to the output image of the cell.
## Documentation

API documentation and examples from notebooks are built with
[mkdocs](https://www.mkdocs.org/), with versioning handled by
[mkdocs](https://www.mkdocs.org/), using a number of plugins, including
[mkdoctrings](https://mkdocstrings.github.io/), with versioning handled by
[mike](https://github.com/jimporter/mike).

Notebooks are an integral part of the documentation as well, please read
Expand Down Expand Up @@ -272,19 +273,57 @@ pages are explicitly listed and manually arranged in the `nav` section of the
configuration.


### Creating stable references for autorefs

mkdocstrings includes the plugin
[autorefs](https://github.com/mkdocstrings/autorefs) to enable automatic linking
across pages with e.g. `[a link][to-something]`. Anchors are autogenerated
from section titles, and are not guaranteed to be unique. In order to ensure
that a link will remain valid, add a custom anchor to the section title:

```markdown
## Some section { #permanent-anchor-to-some-section }
```

(note the space after the opening brace). You can then refer to it within
another markdown file with `[Some section][permanent-anchor-to-some-section]`.


### Using bibliography

Bibliographic citations are managed with the plugins
[mkdocs-bibtex]() and [...][].
To enter a citation first add the entry to `docs/pydvl.bib`. For team
contributor this should be an export of the Zotero folder `software/pydvl` in
the [TransferLab Zotero library](https://www.zotero.org/groups/2703043/transferlab/library).
All other contributors just add the bibtex data, and a maintainer will add it to
the group library upon merging.
Bibliographic citations are managed with the plugin
[mkdocs-bibtex](https://github.com/shyamd/mkdocs-bibtex/). To enter a citation
first add the entry to `docs/pydvl.bib`. For team contributor this should be an
export of the Zotero folder `software/pydvl` in the [TransferLab Zotero
library](https://www.zotero.org/groups/2703043/transferlab/library). All other
contributors just add the bibtex data, and a maintainer will add it to the group
library upon merging.

To add a citation inside a module or function's docstring, use the notation
`[@citekey]`. A references section is automatically added at the bottom of each
module's auto-generated documentation.
To add a citation inside a markdown file, use the notation `[@citekey]`. Alas,
because of when mkdocs-bibtex enters the pipeline, it won't process docstrings.
For module documentation, we manually inject html into the markdown files. For
example, in `pydvl.value.shapley.montecarlo` we have:

```markdown
"""
Module docstring...

## References

[^1]: <a name="ghorbani_data_2019"></a>Ghorbani, A., Zou, J., 2019.
[Data Shapley: Equitable Valuation of Data for Machine
Learning](https://proceedings.mlr.press/v97/ghorbani19c.html).
In: Proceedings of the 36th International Conference on Machine Learning,
PMLR, pp. 2242–2251.
"""
```

and then later in the file, inside a function's docstring:

```markdown
This function implements (Ghorbani and Zou, 2019)<sup><a
href="#ghorbani_data_2019">1</a></sup>
```

### Writing mathematics

Expand All @@ -298,18 +337,21 @@ exceptions). For simplicity, declare the string as "raw" with the prefix `r`:
# This will work
def f(x: float) -> float:
r""" Computes
$$ f(x) = \frac{1}{x^2} $
$${ f(x) = \frac{1}{x^2} }$$
"""
return 1/(x*x)

# This throws an obscure sphinx error
# This throws an obscure error
def f(x: float) -> float:
""" Computes
$$ \frac{1}{x^2} $$
$$\frac{1}{x^2}$$
"""
return 1/(x*x)
```

Note how there is no space after the dollar signs. This is important! You can
use braces for legibility like in the first example.

### Abbreviations

We keep the abbreviations used in the documentation inside the
Expand Down Expand Up @@ -498,7 +540,8 @@ readme). In order to do this, simply prefix the commit message with `[skip ci]`.
The string can be anywhere, but adding it to the beginning of the commit message
makes it more evident when looking at commits in a PR.

Refer to the official [GitHub documentation](https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs)
Refer to the official [GitHub
documentation](https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs)
for more information.

## Release processes
Expand Down Expand Up @@ -578,7 +621,7 @@ create a new release manually by following these steps:
```
7. Delete the release branch if necessary:
`git branch -d release/${RELEASE_VERSION}`
8. Create a Github
8. Create a GitHub
[release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release)
for the created tag.
9. Pour yourself a cup of coffee, you earned it! :coffee: :sparkles:
Expand Down Expand Up @@ -608,8 +651,8 @@ a GitHub release.
We use [bump2version](https://pypi.org/project/bump2version/) to bump
the build part of the version number without commiting or tagging the change
and then publish a package to TestPyPI from CI using Twine. The version
has the github run number appended.
has the GitHub run number appended.

For more details refer to the
For more details refer to the files
[.github/workflows/publish.yaml](.github/workflows/publish.yaml) and
[.github/workflows/tox.yaml](.github/workflows/tox.yaml) files.
[.github/workflows/tox.yaml](.github/workflows/tox.yaml).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $ pip install pyDVL[influence]
```

For more instructions and information refer to [Installing pyDVL
](https://pydvl.org/stable/getting-started/installation/) in the
](https://pydvl.org/stable/getting-started/#installation) in the
documentation.

# Usage
Expand Down
Loading
Loading