Skip to content

Commit 92b6f1e

Browse files
committed
Merge branch 'main' of github.com:DoubleML/doubleml-docs into m-nonlinear-score-mixin
2 parents d4a559e + 007a001 commit 92b6f1e

File tree

11 files changed

+328
-19
lines changed

11 files changed

+328
-19
lines changed

.github/workflows/deploy_docu_dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Deploy Docu (dev)
55
on:
66
push:
77
branches:
8-
- master
8+
- main
99
workflow_dispatch:
1010

1111

@@ -90,7 +90,7 @@ jobs:
9090
uses: JamesIves/[email protected]
9191
with:
9292
REPOSITORY_NAME: DoubleML/doubleml.github.io
93-
BRANCH: master
93+
BRANCH: main
9494
FOLDER: doc/_build/html
9595
TARGET_FOLDER: dev
9696
GIT_CONFIG_NAME: DoubleML Deploy Bot

.github/workflows/deploy_docu_stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
uses: JamesIves/[email protected]
7777
with:
7878
REPOSITORY_NAME: DoubleML/doubleml.github.io
79-
BRANCH: master
79+
BRANCH: main
8080
FOLDER: doc/_build/html
8181
TARGET_FOLDER: stable
8282
GIT_CONFIG_NAME: DoubleML Deploy Bot

.github/workflows/test_build_docu_dev.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ name: Test Docu Build (with dev pkgs)
55
on:
66
push:
77
branches:
8-
- master
8+
- main
99
pull_request:
1010
branches:
11-
- master
11+
- main
1212
workflow_dispatch:
1313
inputs:
1414
doubleml-py-branch:
1515
description: 'Branch in https://github.com/DoubleML/doubleml-for-py'
1616
required: true
17-
default: 'master'
17+
default: 'main'
1818
doubleml-r-branch:
1919
description: 'Branch in https://github.com/DoubleML/doubleml-for-r'
2020
required: true
21-
default: 'master'
21+
default: 'main'
2222
schedule:
2323
- cron: "0 9 * * 1,3,5"
2424

.github/workflows/test_build_docu_released.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ name: Test Docu Build (with released pkgs)
55
on:
66
push:
77
branches:
8-
- master
8+
- main
99
pull_request:
1010
branches:
11-
- master
11+
- main
1212
workflow_dispatch:
1313
schedule:
1414
- cron: "0 9 * * 1,3,5"

doc/_templates/toc-doubleml-guide.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
margin: auto;
129129
}
130130
</style>
131-
<script>
131+
<script defer>
132132
// resizes grid item for masonry grid structure
133133
function resizeGridItem(item) {
134134
grid = document.querySelector("div.toctree-wrapper ul");
@@ -254,9 +254,9 @@
254254
window.onload = resizeAllGridItems();
255255
window.addEventListener("resize", resizeAllGridItems);
256256
});
257+
resizeAllGridItems();
257258
</script>
258-
<script>
259-
console.log("test");
259+
<script defer>
260260
var observer = new MutationObserver(function (mutations) {
261261
const dark = document.documentElement.dataset.theme == "dark";
262262
var toc_wrapper = document.getElementsByClassName("toctree-wrapper")[0];

doc/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@
8787
'sidebar-doubleml-workflow.html'],
8888
'guide/guide': ['logo.html',
8989
'search-field.html',
90-
'sidebar-nav-bs.html',
91-
'toc-doubleml-guide.html']}
90+
'sidebar-nav-bs.html']}
9291

9392
# Add any paths that contain custom static files (such as style sheets) here,
9493
# relative to this directory. They are copied after the builtin static files,

doc/guide/algorithms.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ The algorithm ``dml_procedure='dml2'`` can be summarized as
5959
6060
4. **Outputs:** The estimate of the causal parameter :math:`\tilde{\theta}_0` as well as the values of the evaluate score function are returned.
6161

62+
.. raw:: html
63+
64+
<p align="center">
65+
<iframe width="400" height="300" src="https://www.youtube.com/embed/BMAr27rp4uA" title="Cross-Fitting Animation" frameborder="0" allowfullscreen></iframe>
66+
</p>
67+
68+
6269
Implementation of the double machine learning algorithms
6370
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6471

doc/guide/guide.rst

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,283 @@ User guide
1818
Variance estimation and confidence intervals for a causal parameter of interest <se_confint>
1919
Confidence bands and multiplier bootstrap for valid simultaneous inference <sim_inf>
2020
Sample-splitting, cross-fitting and repeated cross-fitting <resampling>
21+
22+
23+
.. raw:: html
24+
25+
<style>
26+
/* Border radius parameter */
27+
:root {
28+
--main-border-radius: 15px;
29+
}
30+
31+
.light {
32+
--bg: white;
33+
--text-color: black;
34+
--accent: #1f4184;
35+
--header-number: #9bc5f1;
36+
--header-bg: #1f4184;
37+
--header-text-color: white;
38+
--section-number: #ddeeff;
39+
--under-section-number: #f1f8ff;
40+
--border: var(--accent);
41+
}
42+
43+
.dark {
44+
--bg: #121212;
45+
--text-color: white;
46+
--accent: white;
47+
--header-number: #4c83c7;
48+
--header-bg: #1e1e1e;
49+
--header-text-color: white;
50+
--section-number: rgb(37, 37, 37);
51+
--under-section-number: rgb(22, 22, 22);
52+
--border: #1e1e1e;
53+
--color: #80afe9;
54+
}
55+
56+
.toctree-wrapper > ul {
57+
display: grid;
58+
grid-gap: 15px;
59+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
60+
grid-auto-rows: 0px;
61+
padding-left: 0px;
62+
}
63+
64+
.reference {
65+
color: var(--text-color);
66+
}
67+
68+
.item-header {
69+
display: grid;
70+
grid-template-columns: 15% 85%;
71+
background-color: var(--header-bg);
72+
align-items: center;
73+
border-top-right-radius: var(--main-border-radius);
74+
border-top-left-radius: var(--main-border-radius);
75+
}
76+
77+
.item-header-number {
78+
color: var(--header-number);
79+
text-align: center;
80+
font-size: 2em;
81+
font-weight: 700;
82+
margin: auto;
83+
}
84+
85+
.item-header .reference {
86+
color: var(--header-text-color);
87+
font-size: 15px;
88+
font-weight: 700;
89+
}
90+
91+
.toctree-wrapper .toctree-l1 {
92+
list-style: none;
93+
padding-bottom: 10px;
94+
}
95+
96+
.toctree-wrapper .toctree-l1 ul {
97+
font-weight: 500;
98+
border-top-right-radius: 0px;
99+
border-top-left-radius: 0px;
100+
list-style-position: outside;
101+
padding-left: 0px;
102+
}
103+
104+
.toctree-wrapper .toctree-l1 ul .toctree-l3 {
105+
font-weight: 400;
106+
}
107+
108+
.toctree-wrapper li {
109+
list-style: none;
110+
}
111+
112+
.toctree-wrapper .item {
113+
background-color: var(--bg);
114+
border-radius: var(--main-border-radius);
115+
border: 1px solid var(--border);
116+
}
117+
118+
.item .toctree-l1 .toctree-l2 {
119+
display: grid;
120+
grid-template-columns: 15% 85%;
121+
align-items: center;
122+
padding-top: 0.5em;
123+
line-height: 1.1em;
124+
}
125+
126+
.item .toctree-l1 .toctree-l2 .toctree-l3 {
127+
display: grid;
128+
grid-template-columns: 15% 85%;
129+
align-items: center;
130+
padding-top: 0.5em;
131+
line-height: 1.1em;
132+
}
133+
134+
.item .toctree-l1 .toctree-l2 > ul {
135+
grid-column: 2;
136+
}
137+
138+
.Section-number {
139+
background-color: var(--section-number);
140+
text-align: center;
141+
border-radius: 100px;
142+
border: 5px var(--bg) solid;
143+
font-weight: 500;
144+
margin: auto;
145+
}
146+
147+
.under-Section-number {
148+
background-color: var(--under-section-number);
149+
border-radius: 100px;
150+
text-align: center;
151+
border: 5px var(--bg) solid;
152+
margin: auto;
153+
}
154+
</style>
155+
<script defer>
156+
// resizes grid item for masonry grid structure
157+
function resizeGridItem(item) {
158+
grid = document.querySelector("div.toctree-wrapper ul");
159+
rowHeight = parseInt(
160+
window.getComputedStyle(grid).getPropertyValue("grid-auto-rows")
161+
);
162+
rowGap = parseInt(
163+
window.getComputedStyle(grid).getPropertyValue("grid-row-gap")
164+
);
165+
rowSpan = Math.ceil(
166+
(item.querySelector(".toctree-l1").getBoundingClientRect().height +
167+
rowGap) /
168+
(rowHeight + rowGap)
169+
);
170+
item.style.gridRowEnd = "span " + rowSpan;
171+
}
172+
173+
// loops through all grid items and resizes them
174+
function resizeAllGridItems() {
175+
allItems = document.getElementsByClassName("item");
176+
for (let x = 0; x < allItems.length; x++) {
177+
resizeGridItem(allItems[x]);
178+
}
179+
}
180+
181+
// add chapter number to item-header
182+
function addChapters(nodelist) {
183+
for (let i = 0; i < nodelist.length; i++) {
184+
var newP = document.createElement("p");
185+
var textNode = document.createTextNode(
186+
(
187+
"0" + nodelist[i].children[0].children[0].textContent.split(".")[0]
188+
).slice(-2)
189+
);
190+
newP.appendChild(textNode);
191+
newP.className = "item-header-number";
192+
nodelist[i].children[0].insertBefore(
193+
newP,
194+
nodelist[i].children[0].children[0]
195+
);
196+
nodelist[i].children[0].children[1].textContent = nodelist[
197+
i
198+
].children[0].children[1].textContent
199+
.split(".")[1]
200+
.substring(1);
201+
}
202+
}
203+
204+
// remove numbering of section string and add it back as p in li container
205+
function addSections(nodelist) {
206+
for (let i = 0; i < nodelist.length; i++) {
207+
for (let k = 0; k < nodelist[i].children.length; k++) {
208+
if (nodelist[i].children[k].classList.contains("toctree-l3")) {
209+
continue;
210+
}
211+
if (nodelist[i].children[k].querySelector("ul") !== null) {
212+
for (
213+
let n = 0;
214+
n < nodelist[i].children[k].querySelector("ul").children.length;
215+
n++
216+
) {
217+
var newP = document.createElement("p");
218+
var underSectionNumber = nodelist[i].children[k]
219+
.querySelector("ul")
220+
.children[n].children[0].textContent.split(" ")[0];
221+
var underSectionName = nodelist[i].children[k]
222+
.querySelector("ul")
223+
.children[n].children[0].textContent.split(" ")
224+
.slice(1)
225+
.join(" ");
226+
var textNode = document.createTextNode(underSectionNumber);
227+
newP.appendChild(textNode);
228+
newP.className = "under-Section-number";
229+
nodelist[i].children[k]
230+
.querySelector("ul")
231+
.children[n].insertBefore(
232+
newP,
233+
nodelist[i].children[k].querySelector("ul").children[n]
234+
.children[0]
235+
);
236+
nodelist[i].children[k].querySelector("ul").children[
237+
n
238+
].children[1].textContent = underSectionName;
239+
}
240+
}
241+
var newP = document.createElement("p");
242+
var sectionNumber =
243+
nodelist[i].children[k].children[0].textContent.split(" ")[0];
244+
var sectionName = nodelist[i].children[k].children[0].textContent
245+
.split(" ")
246+
.slice(1)
247+
.join(" ");
248+
var textNode = document.createTextNode(sectionNumber);
249+
newP.appendChild(textNode);
250+
newP.className = "Section-number";
251+
nodelist[i].children[k].insertBefore(
252+
newP,
253+
nodelist[i].children[k].children[0]
254+
);
255+
nodelist[i].children[k].children[1].textContent = sectionName;
256+
}
257+
}
258+
}
259+
260+
$(document).ready(function () {
261+
// put chapters in 'item' containers
262+
$(".toctree-l1").wrap("<div class='item'></div>");
263+
264+
// add 'item-header' class to chapter headers
265+
var headerNodeList = document.querySelectorAll(
266+
"div.toctree-wrapper .item .toctree-l1"
267+
);
268+
for (let i = 0; i < headerNodeList.length; i++) {
269+
$(headerNodeList[i].children[0]).wrap("<div class='item-header'></div>");
270+
}
271+
// execute functions on load
272+
window.onload = addChapters(
273+
document.querySelectorAll("div.toctree-wrapper .item .toctree-l1")
274+
);
275+
window.onload = addSections(document.querySelectorAll(".toctree-l1 ul"));
276+
277+
// generate masonry grid and maintain it
278+
window.onload = resizeAllGridItems();
279+
window.addEventListener("resize", resizeAllGridItems);
280+
});
281+
resizeAllGridItems();
282+
</script>
283+
<script defer>
284+
var observer = new MutationObserver(function (mutations) {
285+
const dark = document.documentElement.dataset.theme == "dark";
286+
var toc_wrapper = document.getElementsByClassName("toctree-wrapper")[0];
287+
if (dark) {
288+
toc_wrapper.classList.remove("light");
289+
toc_wrapper.classList.add("dark");
290+
} else {
291+
toc_wrapper.classList.add("light");
292+
toc_wrapper.classList.remove("dark");
293+
}
294+
});
295+
observer.observe(document.documentElement, {
296+
attributes: true,
297+
attributeFilter: ["data-theme"],
298+
});
299+
setTimeout(function () {resizeAllGridItems();}, 500);
300+
</script>

0 commit comments

Comments
 (0)