Skip to content

Commit 8d14b19

Browse files
committed
fixes after review
1 parent 12c7fff commit 8d14b19

59 files changed

Lines changed: 164 additions & 267 deletions

Some content is hidden

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

‎.claude/commands/sphinx_review.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Examine the repo, reviewing code and text for design weaknesses, bugs, unclear language, and outdated Python features. Assume Python 3.12. Write everything found into a file TODO.md.

‎CLAUDE.md‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Purpose
6+
7+
This is a Sphinx documentation site — a collection of copy-paste Python library examples organized as a reference/tutorial book. Each library lives in its own subdirectory with a `README.rst` file and standalone `.py` example scripts.
8+
9+
## Build Commands
10+
11+
```bash
12+
# Build HTML documentation
13+
uv sync
14+
uv run make html
15+
```
16+
17+
The built site goes to `build/html/`. Open `build/html/index.html` to preview locally.
18+
19+
## Project Structure
20+
21+
- **`index.rst`** — top-level table of contents, controls what appears in the docs
22+
- **`conf.py`** — Sphinx configuration (theme: furo, extensions: myst_parser, sphinx_design, sphinx_copybutton)
23+
- **`<library>/README.rst`** — documentation page for each library (RST format)
24+
- **`<library>/*.py`** — standalone example scripts included via `.. literalinclude::` directives
25+
- **`<library>/*.png`** — output images referenced with `.. figure::` directives
26+
- **`_static/`** — CSS and logo assets
27+
28+
## Content Conventions
29+
30+
Each library page follows this pattern:
31+
1. A question as the section heading (e.g., "How to draw a bar chart?")
32+
2. Brief description of the library
33+
3. Install instruction in a `.. code::` block
34+
4. One or more examples using `.. literalinclude:: script.py`
35+
5. Optional `.. figure:: image.png` showing expected output
36+
6. A `.. seealso::` block linking to official docs
37+
38+
Example scripts should be **self-contained and runnable** — no shared utilities or imports from sibling directories.
39+
40+
## Adding a New Library
41+
42+
1. Create a subdirectory `<library>/`
43+
2. Write `<library>/README.rst` following the conventions above
44+
3. Add standalone `.py` example scripts
45+
4. Add the entry to `index.rst` under the appropriate section: `<library>/README.rst`
46+
5. Run `make html` to verify it builds without warnings
47+
48+
## Formats
49+
50+
- Documentation pages use **RST** (`.rst`), not Markdown — `myst_parser` is installed but RST is the primary format used
51+
- The `exclude_patterns` in `conf.py` excludes `README.md` (the GitHub-facing readme) and `learning_goals.md` files from the Sphinx build

‎PuLP/magic_square.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from pulp import *
2+
from pulp import LpProblem, LpMinimize, LpVariable, LpInteger, lpSum, LpStatus, value
33

44
prob = LpProblem("PULPTEST", LpMinimize)
55

@@ -48,5 +48,4 @@
4848
for n in NUMBERS:
4949
if value(allocation[x][y][n]) == 1:
5050
print(n, end=' ')
51-
#print(x, y, n)
5251
print()

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ Thanks to Emely Henninger for finding a nasty bug in networkx!
106106

107107
## License
108108

109-
© 2025 Dr. Kristian Rother (krother@academis.eu)
109+
© 2026 Dr. Kristian Rother (krother@academis.eu)
110110

111111
The code is distributed under the conditions of the MIT License. See :::file LICENSE.TXT for details.

‎TODO.md‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11

2-
seaborn (external)](https://seaborn.pydata.org/) | a more powerful interface for matplotlib |
3-
altair (external)](https://altair-viz.github.io/) | plotting library with JSON backend |
4-
geopandas (external)](http://geopandas.org/) | plot DataFrames on maps |
5-
panel (external)](http://panel.pyviz.org/) | create interactive plots |
6-
CV2 (external)](https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_tutorials.html) | processing camera images and movies |
7-
milvus
8-
narwhals
9-
duckdb
10-
2+
# Review Findings
113

12-
playwright/README.md - not in toctree
13-
playwright/web_testing/README.rst - not in toctree
14-
re/exercises/regex_exercises.md - not in toctree
15-
sqlalchemy/README.md - not in toctree
4+
- **`index.rst` line 53** — `pathlib/README.rst # TODO`: the `pathlib/` directory does not exist, and toctree entries do not support inline comments. This causes a Sphinx build error.
5+
- **`moviepy/end_credits.py`** — uses `moviepy.editor` (MoviePy 1.x API, removed in 2.x) and `faker.Factory` (deprecated since Faker 4.0). Needs a full rewrite for MoviePy 2.x.

‎curses/README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ Run it from a terminal.
2323

2424
It likely means that your window is too small.
2525

26-
.. seealso::
26+
.. note::
2727

2828
My first contact with curses was inspired by `manti_go <https://github.com/JoNiederhut/manti_go>`__ written by my course participants.

‎curses/pac.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def pac_game(screen):
7373
player = 1, 1
7474
ghost = 9, 9
7575

76-
while player != ghost and any([row for row in level if "." in row]):
76+
while player != ghost and any(row for row in level if "." in row):
7777
ghost = move_ghost(ghost, level)
7878
draw(level, player, ghost, screen, win)
7979
if direction := get_keyboard(win):

‎email/send_email.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import smtplib
3-
from email.mime.text import MIMEText
3+
from email.mime.text import MIMEText
44

55
class MailAccount:
66
"""
@@ -10,7 +10,7 @@ def __init__(self, server, login, password, sender_email, \
1010
sender_name, use_tls=False):
1111
self.server = server
1212
self.login = login
13-
self.password = password
13+
self.password = password # Caution: use environment variable in production
1414
self.mail = sender_email
1515
self.sender = '"%s" <%s>'%(sender_name, sender_email)
1616
self.use_tls = use_tls
@@ -25,7 +25,7 @@ def send_email(self, recipient_email, subject, body):
2525
msg = message.as_string()
2626

2727
server = smtplib.SMTP(self.server)
28-
server.set_debuglevel(1)
28+
server.set_debuglevel(1) # Caution: lots SMTP traffic - do not use in production
2929

3030
if self.use_tls: # deliberately starts tls if using TLS
3131
server.ehlo()

‎flask/README.rst‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎flask/run_flask_server.py‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)