Skip to content

Add the Petrophysics Handbook — PDF user manual for petrolib - #164

Merged
ingehap merged 1 commit into
mainfrom
claude/petrophysics-library-merge-plan-txjfx9
Jul 10, 2026
Merged

ingehap merged 1 commit into
mainfrom
claude/petrophysics-library-merge-plan-txjfx9

Conversation

@ingehap

@ingehap ingehap commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a professional PDF user manual for petrolib to the docs folder, per the requested structure:

docs/Petrophysics_Handbook.pdf (231 pages, A4, ~0.9 MB)

  1. Title page — "Petrophysics Handbook", with the petrolib subtitle and a colophon (510 entries across 39 modules; SPWLA attribution).
  2. Table of contents — all public petrolib functions in alphabetical order, with dotted leaders, page numbers, and clickable links; same-named functions in different modules (e.g. the two acoustic_impedance) are disambiguated by their module.
  3. One section per function (alphabetical; 504 functions + 6 classes), each giving:
    • Purpose — the docstring prose,
    • Input parameters — a table of name, type, default (required marked; keyword-only flagged), from the actual signatures,
    • Output — the return type, with the house numpy aliases expanded,
    • Sources — full SPWLA Petrophysics journal citations (title, authors, year, volume/issue/pages, DOI), resolved from the module References sections added in Add complete source references to petrolib docstrings #162; classes additionally list their public methods.

tools/gen_petrolib_handbook.py — the generator: AST extraction from the docstrings, reportlab two-pass build (real TOC page numbers), embedded DejaVu fonts so the citations' Unicode (em-dashes, superscripts, accented author names) renders correctly. Regenerate with python tools/gen_petrolib_handbook.py.

Also: pyproject.toml gains a docs extra (reportlab>=4), and README + docs/petrolib.md link the handbook.

Verification

  • PDF inspected visually (title page, TOC, body pages): headers/footers with page numbers, parameter tables, signature boxes, and full citations all render correctly.
  • Metadata title "Petrophysics Handbook"; TOC page numbers verified against the sections.
  • ruff check/ruff format clean on the generator; pytest tests/petrolib: 252 passed (no library code touched).

🤖 Generated with Claude Code

https://claude.ai/code/session_01B2BX1XL8422gebCU1oVoQC


Generated by Claude Code

docs/Petrophysics_Handbook.pdf (231 pages, A4): title page, an
alphabetical linked table of contents of all 510 public entries (504
functions + 6 classes across 39 modules), and one section per entry
giving the purpose (docstring prose), the input parameters (name, type,
default, keyword-only flag), the output type, and the sources as full
SPWLA Petrophysics journal citations resolved from the module References
sections. Same-named functions are disambiguated by module in the TOC.

tools/gen_petrolib_handbook.py generates the PDF from the docstrings
via AST extraction and reportlab (two-pass build for TOC page numbers;
embedded DejaVu fonts for the citations' Unicode). Regenerate with
`python tools/gen_petrolib_handbook.py` after petrolib changes.

Also: pyproject gains a `docs` extra (reportlab); README and
docs/petrolib.md link the handbook.

ruff clean; 252 petrolib tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B2BX1XL8422gebCU1oVoQC
@ingehap
ingehap marked this pull request as ready for review July 10, 2026 11:12
@ingehap
ingehap merged commit bc0d7a9 into main Jul 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants