Skip to content

Commit ac3ed99

Browse files
authored
Merge pull request #436 from aai-institute/fix/435-broken-imports
Fix broken imports in notebooks
2 parents f68a388 + 71bc46d commit ac3ed99

14 files changed

+2065
-353
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,29 @@ Or:
170170
]
171171
```
172172

173-
To only hide the input
173+
To only hide the input and
174+
175+
```yaml
176+
"tags": [
177+
"hide-output"
178+
]
179+
```
180+
for hiding the output only.
174181

175182
It is important to leave a warning at the top of the document to avoid confusion.
176183
Examples for hidden imports and plots are available in the notebooks, e.g. in
177-
[Shapley for data valuation](https://aai-institute.github.io/pyDVL/examples/shapley_basic_spotify.ipynb).
184+
*notebooks/shapley_basic_spotify.ipynb*.
178185

186+
### Plots in Notebooks
187+
If you add a plot to a notebook, which should also render nicely in browser
188+
dark mode, add the tag *invertible-output*, i.e.
189+
190+
```yaml
191+
"tags": [
192+
"invertible-output"
193+
]
194+
```
195+
This applies a simple CSS-filter to the output image of the cell.
179196

180197
## Documentation
181198

docs/css/extra.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,17 @@ a.autorefs-external:hover::after {
107107
color: black;
108108
}
109109

110-
111110
body[data-md-color-scheme="default"] .invertible img {
112111
}
113112

114113
body[data-md-color-scheme="slate"] .invertible img {
115114
filter: invert(100%) hue-rotate(180deg);
116115
}
117116

117+
body[data-md-color-scheme="slate"] .celltag_invertible-output img {
118+
filter: invert(100%) hue-rotate(180deg);
119+
}
120+
118121
/* Rendered dataframe from jupyter */
119122
table.dataframe {
120123
display: block;

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ plugins:
5353
- hide
5454
remove_input_tags:
5555
- hide-input
56+
remove_all_outputs_tags:
57+
- hide-output
5658
binder: true
5759
binder_service_name: "gh"
5860
binder_branch: "develop"

notebooks/data_oob.ipynb

Lines changed: 30 additions & 11 deletions
Large diffs are not rendered by default.

notebooks/influence_imagenet.ipynb

Lines changed: 296 additions & 105 deletions
Large diffs are not rendered by default.

notebooks/influence_synthetic.ipynb

Lines changed: 208 additions & 71 deletions
Large diffs are not rendered by default.

notebooks/influence_wine.ipynb

Lines changed: 209 additions & 50 deletions
Large diffs are not rendered by default.

notebooks/least_core_basic.ipynb

Lines changed: 1155 additions & 30 deletions
Large diffs are not rendered by default.

notebooks/shapley_basic_spotify.ipynb

Lines changed: 73 additions & 42 deletions
Large diffs are not rendered by default.

notebooks/shapley_knn_flowers.ipynb

Lines changed: 34 additions & 27 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)