Repository navigation
Add the doc/ Petrophysics Handbook PDF user manual for petrolib - #166
Merged
Merged
Conversation
doc/Petrophysics_Handbook.pdf (A4, 518 pages): a title page carrying exactly "Petrophysics Handbook", "Code for Petrophysics Jan/Feb 2014 - Jun/Jul 2026", and "https://github.com/ingehap/Petrophysics_Code"; a blank page; a 12-page alphabetical linked table of contents of all 504 public petrolib functions; then one page per function giving the Python path, the purpose, the input parameters (name, type, default, and the meaning of each parameter), the output parameters, and the sources as full SPWLA Petrophysics journal citations resolved from the module References sections (406 of 504 functions carry citations; the rest have no Sources tag). tools/gen_petrolib_handbook.py is reworked for this layout: functions only (classes dropped), one page per function via shrink-to-fit framing, src tags now read from the Sources: clause only (with a prefix fallback that resolves bare srcYYYY_MM tags), and parameter/ output meanings loaded from the new tools/handbook_descriptions.json (module -> function -> params/returns), which documents every parameter of all 504 functions grounded in the docstrings and module unit conventions. Missing descriptions or citations are reported on stderr at build time. Regenerate with `python tools/gen_petrolib_handbook.py`. README.md and docs/petrolib.md now point at the doc/ location. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VBtq2fm3n7iG6y7i3mvz3K
ingehap
marked this pull request as ready for review
July 10, 2026 23:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
doc/Petrophysics_Handbook.pdf(A4, 518 pages), a professional user manual for thepetroliblibrary, with the requested fixed layout:Sources:tag in their docstring.Implementation
tools/gen_petrolib_handbook.pyreworked for this layout: functions only (module-level constants and the 6 classes are no longer included), one page per function guaranteed via shrink-to-fit framing, output moved fromdocs/todoc/, and source tags now parsed from theSources:clause only — with a prefix fallback so baresrcYYYY_MMtags still resolve to full citations (previously one tag leaked from prose and one stayed unresolved).tools/handbook_descriptions.json(new): per-function parameter meanings and output descriptions for every parameter of all 504 functions, written from the function bodies, docstrings, and module unit conventions. The generator reads it at build time and reports any missing description or citation on stderr, so the file stays honest as the API evolves.README.md/docs/petrolib.md: handbook links now point at thedoc/location.Regenerate after petrolib changes with
python tools/gen_petrolib_handbook.py(needspip install reportlab, orpip install -e ".[docs]").Verification
Programmatic checks on the generated PDF (pdfminer): the title page contains exactly the three specified lines; page 2 is empty; ToC entries are in alphabetical order with correct page numbers; each of the 504 functions starts its own page and every page contains the Purpose / Input parameters / Output parameters sections; zero unresolved parameter descriptions or citations at build time. The densest pages (e.g.
vshale_from_grwith 6 parameters, 6 citations) were visually inspected and fit on a single page.🤖 Generated with Claude Code
https://claude.ai/code/session_01VBtq2fm3n7iG6y7i3mvz3K
Generated by Claude Code