Skip to content

Adopt petrolib.data_qc_io in 2015-2019 articles (PR-B1) - #158

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

First adoption chunk (PR-B1) for the data_qc_io domain — six 2015–2019 article files now delegate their data-QC bodies to the canonical petrolib.data_qc_io package merged in #157. Strangler-fig facades: every function keeps its name, signature, and docstring; only the body becomes a delegation.

File Function Canonical target
src2015_04/article4_microresistivity_extraction.py histogram_scale scale.normalize_to_reference(..., pct=None)
src2016_02/article3_low_permeability_measurements.py deviation_indicator clean.relative_discrepancy
src2016_12/article6_gr_normalization_haynesville.py histogram_normalize, affine_normalize scale.normalize_to_reference, scale.match_moments
src2017_10/article5_permian_core_analysis.py relative_discrepancy clean.relative_discrepancy
src2018_12/article11_data_preconditioning.py iqr_outliers, impute_gaps clean.outlier_mask("iqr"), clean.impute_gaps
src2019_02/article4_insitu_saturation_core_comparison.py closure clean.closure_residual

src2016_12/article6 gains the standard bootstrap header (it had no petrolib import); the other five already delegate elsewhere. The 2017_10 arrangement |a-b|/(0.5(a+b)) and the canonical 2|a-b|/(a+b) round identically in IEEE arithmetic (multiplication by powers of two is exact), pre-verified numerically.

Verification

  • stdout byte-identical old (HEAD) vs new for all six modules, via subprocess capture.
  • python3 tools/golden_diff.py on all six directories: 6/6 PASS.
  • ruff check clean (article dirs are format-exempt by design); python3 -m mypy petrolib clean; python3 -m pytest tests/petrolib: 252 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B2BX1XL8422gebCU1oVoQC


Generated by Claude Code

Strangler-fig delegation of the data-QC forms to the canonical package
(PR-B1 of the data_qc_io train, final plan domain):

- src2015_04/article4: histogram_scale -> scale.normalize_to_reference
  (pct=None min/max endpoints)
- src2016_02/article3: deviation_indicator -> clean.relative_discrepancy
- src2016_12/article6: histogram_normalize -> scale.normalize_to_reference
  (explicit endpoints); affine_normalize -> scale.match_moments (+ bootstrap
  header)
- src2017_10/article5: relative_discrepancy -> clean.relative_discrepancy
  (the |a-b|/(0.5(a+b)) arrangement rounds identically in IEEE)
- src2018_12/article11: iqr_outliers -> clean.outlier_mask("iqr");
  impute_gaps -> clean.impute_gaps
- src2019_02/article4: closure -> clean.closure_residual

All function names, signatures, and docstrings unchanged. Verified: stdout
byte-identical old vs new for all six modules; golden_diff 6/6 directories
pass; mypy clean; 252 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 09:36
@ingehap
ingehap merged commit bf924e3 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