Skip to content

Commit 6c19c1c

Browse files
committed
Update documentation
1 parent aa9d95f commit 6c19c1c

92 files changed

Lines changed: 4477 additions & 3928 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: e88ec6554c2cf7c49cef35641b1ffe6c
3+
config: 6884e2e1278991ec8cb6843ea5d5149c
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/chap13.ipynb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,20 @@
10371037
"db"
10381038
]
10391039
},
1040+
{
1041+
"cell_type": "markdown",
1042+
"id": "47685eb7",
1043+
"metadata": {
1044+
"tags": [
1045+
"remove-cell"
1046+
]
1047+
},
1048+
"source": [
1049+
"If you get an error like `db type could not be determined`, the most likely cause is that a file with the same name already exists but is not a valid shelve database (for example, it may be corrupted or created by something else).\n",
1050+
"\n",
1051+
"In that case, the simplest solution is to delete the existing file and run the code again so that `shelve.open` can create a new database."
1052+
]
1053+
},
10401054
{
10411055
"cell_type": "markdown",
10421056
"id": "0e4a2fb3",

_sphinx_design_static/design-style.4045f2051d55cab465a707391d5b2007.min.css renamed to _sphinx_design_static/sphinx-design.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_static/basic.css

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- basic theme.
66
*
7-
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/
@@ -237,6 +237,10 @@ a.headerlink {
237237
visibility: hidden;
238238
}
239239

240+
a:visited {
241+
color: #551A8B;
242+
}
243+
240244
h1:hover > a.headerlink,
241245
h2:hover > a.headerlink,
242246
h3:hover > a.headerlink,
@@ -324,17 +328,17 @@ aside.sidebar {
324328
p.sidebar-title {
325329
font-weight: bold;
326330
}
331+
327332
nav.contents,
328333
aside.topic,
329-
330334
div.admonition, div.topic, blockquote {
331335
clear: left;
332336
}
333337

334338
/* -- topics ---------------------------------------------------------------- */
339+
335340
nav.contents,
336341
aside.topic,
337-
338342
div.topic {
339343
border: 1px solid #ccc;
340344
padding: 7px;
@@ -375,7 +379,6 @@ div.sidebar > :last-child,
375379
aside.sidebar > :last-child,
376380
nav.contents > :last-child,
377381
aside.topic > :last-child,
378-
379382
div.topic > :last-child,
380383
div.admonition > :last-child {
381384
margin-bottom: 0;
@@ -385,7 +388,6 @@ div.sidebar::after,
385388
aside.sidebar::after,
386389
nav.contents::after,
387390
aside.topic::after,
388-
389391
div.topic::after,
390392
div.admonition::after,
391393
blockquote::after {
@@ -611,25 +613,6 @@ ul.simple p {
611613
margin-bottom: 0;
612614
}
613615

614-
/* Docutils 0.17 and older (footnotes & citations) */
615-
dl.footnote > dt,
616-
dl.citation > dt {
617-
float: left;
618-
margin-right: 0.5em;
619-
}
620-
621-
dl.footnote > dd,
622-
dl.citation > dd {
623-
margin-bottom: 0em;
624-
}
625-
626-
dl.footnote > dd:after,
627-
dl.citation > dd:after {
628-
content: "";
629-
clear: both;
630-
}
631-
632-
/* Docutils 0.18+ (footnotes & citations) */
633616
aside.footnote > span,
634617
div.citation > span {
635618
float: left;
@@ -654,8 +637,6 @@ div.citation > p:last-of-type:after {
654637
clear: both;
655638
}
656639

657-
/* Footnotes & citations ends */
658-
659640
dl.field-list {
660641
display: grid;
661642
grid-template-columns: fit-content(30%) auto;
@@ -668,10 +649,6 @@ dl.field-list > dt {
668649
padding-right: 5px;
669650
}
670651

671-
dl.field-list > dt:after {
672-
content: ":";
673-
}
674-
675652
dl.field-list > dd {
676653
padding-left: 0.5em;
677654
margin-top: 0em;
@@ -697,6 +674,16 @@ dd {
697674
margin-left: 30px;
698675
}
699676

677+
.sig dd {
678+
margin-top: 0px;
679+
margin-bottom: 0px;
680+
}
681+
682+
.sig dl {
683+
margin-top: 0px;
684+
margin-bottom: 0px;
685+
}
686+
700687
dl > dd:last-child,
701688
dl > dd:last-child > :last-child {
702689
margin-bottom: 0;
@@ -765,6 +752,14 @@ abbr, acronym {
765752
cursor: help;
766753
}
767754

755+
.translated {
756+
background-color: rgba(207, 255, 207, 0.2)
757+
}
758+
759+
.untranslated {
760+
background-color: rgba(255, 207, 207, 0.2)
761+
}
762+
768763
/* -- code displays --------------------------------------------------------- */
769764

770765
pre {

_static/doctools.js

Lines changed: 12 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
*
55
* Base JavaScript utilities for all Sphinx HTML documentation.
66
*
7-
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/
1111
"use strict";
1212

13+
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
14+
"TEXTAREA",
15+
"INPUT",
16+
"SELECT",
17+
"BUTTON",
18+
]);
19+
1320
const _ready = (callback) => {
1421
if (document.readyState !== "loading") {
1522
callback();
@@ -18,73 +25,11 @@ const _ready = (callback) => {
1825
}
1926
};
2027

21-
/**
22-
* highlight a given string on a node by wrapping it in
23-
* span elements with the given class name.
24-
*/
25-
const _highlight = (node, addItems, text, className) => {
26-
if (node.nodeType === Node.TEXT_NODE) {
27-
const val = node.nodeValue;
28-
const parent = node.parentNode;
29-
const pos = val.toLowerCase().indexOf(text);
30-
if (
31-
pos >= 0 &&
32-
!parent.classList.contains(className) &&
33-
!parent.classList.contains("nohighlight")
34-
) {
35-
let span;
36-
37-
const closestNode = parent.closest("body, svg, foreignObject");
38-
const isInSVG = closestNode && closestNode.matches("svg");
39-
if (isInSVG) {
40-
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
41-
} else {
42-
span = document.createElement("span");
43-
span.classList.add(className);
44-
}
45-
46-
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
47-
parent.insertBefore(
48-
span,
49-
parent.insertBefore(
50-
document.createTextNode(val.substr(pos + text.length)),
51-
node.nextSibling
52-
)
53-
);
54-
node.nodeValue = val.substr(0, pos);
55-
56-
if (isInSVG) {
57-
const rect = document.createElementNS(
58-
"http://www.w3.org/2000/svg",
59-
"rect"
60-
);
61-
const bbox = parent.getBBox();
62-
rect.x.baseVal.value = bbox.x;
63-
rect.y.baseVal.value = bbox.y;
64-
rect.width.baseVal.value = bbox.width;
65-
rect.height.baseVal.value = bbox.height;
66-
rect.setAttribute("class", className);
67-
addItems.push({ parent: parent, target: rect });
68-
}
69-
}
70-
} else if (node.matches && !node.matches("button, select, textarea")) {
71-
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
72-
}
73-
};
74-
const _highlightText = (thisNode, text, className) => {
75-
let addItems = [];
76-
_highlight(thisNode, addItems, text, className);
77-
addItems.forEach((obj) =>
78-
obj.parent.insertAdjacentElement("beforebegin", obj.target)
79-
);
80-
};
81-
8228
/**
8329
* Small JavaScript module for the documentation.
8430
*/
8531
const Documentation = {
8632
init: () => {
87-
Documentation.highlightSearchWords();
8833
Documentation.initDomainIndexTable();
8934
Documentation.initOnKeyListeners();
9035
},
@@ -126,51 +71,6 @@ const Documentation = {
12671
Documentation.LOCALE = catalog.locale;
12772
},
12873

129-
/**
130-
* highlight the search words provided in the url in the text
131-
*/
132-
highlightSearchWords: () => {
133-
const highlight =
134-
new URLSearchParams(window.location.search).get("highlight") || "";
135-
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
136-
if (terms.length === 0) return; // nothing to do
137-
138-
// There should never be more than one element matching "div.body"
139-
const divBody = document.querySelectorAll("div.body");
140-
const body = divBody.length ? divBody[0] : document.querySelector("body");
141-
window.setTimeout(() => {
142-
terms.forEach((term) => _highlightText(body, term, "highlighted"));
143-
}, 10);
144-
145-
const searchBox = document.getElementById("searchbox");
146-
if (searchBox === null) return;
147-
searchBox.appendChild(
148-
document
149-
.createRange()
150-
.createContextualFragment(
151-
'<p class="highlight-link">' +
152-
'<a href="javascript:Documentation.hideSearchWords()">' +
153-
Documentation.gettext("Hide Search Matches") +
154-
"</a></p>"
155-
)
156-
);
157-
},
158-
159-
/**
160-
* helper function to hide the search marks again
161-
*/
162-
hideSearchWords: () => {
163-
document
164-
.querySelectorAll("#searchbox .highlight-link")
165-
.forEach((el) => el.remove());
166-
document
167-
.querySelectorAll("span.highlighted")
168-
.forEach((el) => el.classList.remove("highlighted"));
169-
const url = new URL(window.location);
170-
url.searchParams.delete("highlight");
171-
window.history.replaceState({}, "", url);
172-
},
173-
17474
/**
17575
* helper function to focus on search bar
17676
*/
@@ -210,15 +110,11 @@ const Documentation = {
210110
)
211111
return;
212112

213-
const blacklistedElements = new Set([
214-
"TEXTAREA",
215-
"INPUT",
216-
"SELECT",
217-
"BUTTON",
218-
]);
219113
document.addEventListener("keydown", (event) => {
220-
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
221-
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
114+
// bail for input elements
115+
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
116+
// bail with special keys
117+
if (event.altKey || event.ctrlKey || event.metaKey) return;
222118

223119
if (!event.shiftKey) {
224120
switch (event.key) {
@@ -240,10 +136,6 @@ const Documentation = {
240136
event.preventDefault();
241137
}
242138
break;
243-
case "Escape":
244-
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
245-
Documentation.hideSearchWords();
246-
event.preventDefault();
247139
}
248140
}
249141

_static/documentation_options.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
var DOCUMENTATION_OPTIONS = {
2-
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
1+
const DOCUMENTATION_OPTIONS = {
32
VERSION: '',
43
LANGUAGE: 'en',
54
COLLAPSE_INDEX: false,
@@ -8,7 +7,7 @@ var DOCUMENTATION_OPTIONS = {
87
LINK_SUFFIX: '.html',
98
HAS_SOURCE: true,
109
SOURCELINK_SUFFIX: '',
11-
NAVIGATION_WITH_KEYS: true,
10+
NAVIGATION_WITH_KEYS: false,
1211
SHOW_SEARCH_SUMMARY: true,
13-
ENABLE_SEARCH_SHORTCUTS: false,
12+
ENABLE_SEARCH_SHORTCUTS: true,
1413
};

_static/language_data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
* This script contains the language-specific data used by searchtools.js,
66
* namely the list of stopwords, stemmer, scorer and splitter.
77
*
8-
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
8+
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
99
* :license: BSD, see LICENSE for details.
1010
*
1111
*/
1212

1313
var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];
1414

1515

16-
/* Non-minified version is copied as a separate JS file, is available */
16+
/* Non-minified version is copied as a separate JS file, if available */
1717

1818
/**
1919
* Porter Stemmer

0 commit comments

Comments
 (0)