Skip to content

Add references with sphinxcontrib-bibtex #394

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@
"sphinx.ext.autosectionlabel",
"sphinx_autodoc_typehints",
"sphinx_toolbox.more_autodoc.autoprotocol",
"sphinxcontrib.bibtex",
]

nbsphinx_allow_errors = True # optional, avoids build breaking due to execution errors

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
bibtex_bibfiles = ["references.bib"]
bibtex_default_style = (
"alpha" # set to alpha to not confuse references the docs with the footcites in docstrings.
)

source_suffix = {
".rst": "restructuredtext",
Expand Down
3 changes: 3 additions & 0 deletions docs/source/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example
`shapiq` is a Library for computing Shapley Interactions and Shapley Values
for Machine Learning {cite:p}`muschalikShapleyInteractions2024`.
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ Contents
:maxdepth: 1
:caption: BIBLIOGRAPHY

references
example
references_alternative
24 changes: 24 additions & 0 deletions docs/source/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@inproceedings{muschalikShapleyInteractions2024,
author = {Maximilian Muschalik and
Hubert Baniecki and
Fabian Fumagalli and
Patrick Kolpaczki and
Barbara Hammer and
Eyke H{\"{u}}llermeier},
editor = {Amir Globersons and
Lester Mackey and
Danielle Belgrave and
Angela Fan and
Ulrich Paquet and
Jakub M. Tomczak and
Cheng Zhang},
title = {shapiq: Shapley Interactions for Machine Learning},
booktitle = {Advances in Neural Information Processing Systems 38: Annual Conference
on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver,
BC, Canada, December 10 - 15, 2024},
year = {2024},
url = {http://papers.nips.cc/paper\_files/paper/2024/hash/eb3a9313405e2d4175a5a3cfcd49999b-Abstract-Datasets\_and\_Benchmarks\_Track.html},
timestamp = {Thu, 13 Feb 2025 16:56:45 +0100},
biburl = {https://dblp.org/rec/conf/nips/MuschalikBFKHH24.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
5 changes: 5 additions & 0 deletions docs/source/references_alternative.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
📚 Bibliography
===============

.. bibliography::
:cited:
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ docs = [
"sphinx-copybutton",
"sphinx-autodoc-typehints",
"sphinx_toolbox",
"sphinxcontrib-bibtex", # references based on bibtex
"nbconvert",
"nbsphinx",
"commonmark", # Markdown parser and renderer
Expand Down
4 changes: 2 additions & 2 deletions shapiq/plot/si_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def si_graph_plot(
represent interactions between the players. The size of the nodes and edges represent the
strength of the interaction values. The color of the edges represents the sign of the
interaction values (red for positive and blue for negative). The SI-graph plot is presented in
Muschalik et al. (2024)[1]_.
:footcite:t:`muschalikShapleyInteractions2024`.

Args:
interaction_values: The interaction values to plot.
Expand Down Expand Up @@ -146,7 +146,7 @@ def si_graph_plot(
The figure and axis of the plot if ``show`` is ``False``. Otherwise, ``None``.

References:
.. [1] Muschalik, M., Baniecki, H., Fumagalli, F., Kolpaczki, P., Hammer, B., and Hüllermeier, E. (2024). shapiq: Shapley Interactions for Machine Learning. In: The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track. url: https://openreview.net/forum?id=knxGmi6SJi#discussion.
.. footbibliography::
"""
if interaction_values is None:
msg = "Interaction_values must be provided."
Expand Down
56 changes: 56 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.