Skip to content

Rebuild the Petrophysics Handbook with acronym/unit tables and call formats - #167

Merged
ingehap merged 1 commit into
mainfrom
claude/petrolib-user-manual-3ma2w9
Jul 11, 2026
Merged

ingehap merged 1 commit into
mainfrom
claude/petrolib-user-manual-3ma2w9

Conversation

@ingehap

@ingehap ingehap commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Regenerates doc/Petrophysics_Handbook.pdf (A4, now 523 pages) with the extended layout requested for the petrolib user manual:

  • Title page unchanged: exactly Petrophysics Handbook, Code for Petrophysics Jan/Feb 2014 - Jun/Jul 2026, and https://github.com/ingehap/Petrophysics_Code, and nothing else.
  • A blank page, then two new front-matter tables:
    • Acronyms (pages 3–6): ~100 entries from AAPE to VTI — every acronym that occurs in the manual's prose (CBL, NMR, MICP, CPMG, TOC, …) with its expansion and a short petrophysical gloss.
    • Non-SI Units (page 7): 18 entries from the API gamma-ray unit to wt% — every non-SI unit used in the manual (MRayl, mD, p.u., c.u., psi, ppg, µs/ft, …) with its definition and SI conversion, cross-checked against petrolib/constants.py.
  • Table of contents (pages 8–19): all 504 public functions, alphabetical, linked.
  • One page per function, now opening with the general call format — the full call signature with defaults and the keyword-only * marker — followed by a blank line, the Python path, the purpose, the input parameters (name, type, default, meaning), the output parameters, and the full SPWLA Petrophysics journal citations where sources exist, each section separated by a blank line as specified.

Implementation

  • tools/handbook_glossary.json (new): the curated acronym and unit tables. Candidates were extracted programmatically from the manual's actual text corpus (purposes, parameter meanings, return descriptions), then each entry was resolved against its usage in the petrolib source (e.g. TMALI → Thermal Maturity-Adjusted Log Interpretation from the module References; OD → both optical density and outer diameter, which the entry notes).
  • tools/gen_petrolib_handbook.py: renders the two glossary tables between the blank page and the ToC, derives the call-format heading from the extracted parameter list, and reserves headroom so wrapped signatures never push a function onto a second page.

Verification

Programmatic checks (pdfminer) on the built PDF: title page carries exactly the three specified lines; page 2 is empty; acronyms/units/ToC pages appear in the specified order; each of the 504 function pages contains the Call format, Python path, Purpose, Input parameters, and Output parameters sections (plus Sources exactly when citations exist) and each function starts its own page (523 = 19 front-matter + 504 function pages). The longest signature (dual_water_sw_qv, 13 parameters) and the glossary pages were visually inspected.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VBtq2fm3n7iG6y7i3mvz3K


Generated by Claude Code

…ormats

doc/Petrophysics_Handbook.pdf (A4, 523 pages) regenerated with the
extended layout: after the title page and the blank page come a table
of acronyms (AAPE through VTI, ~100 entries) and a table of non-SI
units (API unit through wt%, 18 entries), each defined against the
usage in the petrolib docstrings; then the 12-page alphabetical table
of contents and one page per function as before, with each function
page now opening with the general call format (the full signature with
defaults and the keyword-only marker) followed by the Python path,
purpose, input parameters with meanings, output parameters, and full
journal sources.

tools/gen_petrolib_handbook.py renders the two glossary tables from
the new tools/handbook_glossary.json (acronyms + units, curated from
the acronym and unit tokens that actually occur in the manual's prose)
and derives the call-format line from the extracted parameters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBtq2fm3n7iG6y7i3mvz3K
@ingehap
ingehap marked this pull request as ready for review July 11, 2026 00:26
@ingehap
ingehap merged commit b58db64 into main Jul 11, 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