Skip to content

Adopt petrolib.data_qc_io in 2023-2026 articles (PR-B3, final chunk of the merge plan) - #160

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

Final adoption chunk (PR-B3) for data_qc_io — and the last PR of the entire LIBRARY_MERGE_PLAN. Thirteen 2023–2026 article files now delegate to the canonical package (#157), following #158 and #159. Strangler-fig facades throughout: names, signatures, and docstrings unchanged.

File Function(s) Canonical target
src2023_04/article10_induction_deconvolution.py fit_linear_weights, MLDeconvolution._features filt.window_features
src2023_04/article11_induction_convolution.py fit_linear_conv_weights, MLConvolution._features filt.window_features
src2023_06/article9_xray_invasion.py median_filter_3x3 filt.median_filter2d(size=3)
src2023_08/article5_iterative_resistivity.py detect_bed_boundaries filt.detect_bed_boundaries (unused depth arg kept in the facade)
src2023_10/article_03_okwoli_probe_screening.py boxcar filt.smooth("boxcar")
src2023_10/article_09_bennis_corelogs_simulation.py vertical_response filt.tool_response
src2023_12/bradley_wellbore_format.py WellboreData subclasses petrolib.data_qc_io.WellboreData
src2024_04/chen_sem_pore_segmentation.py synthetic_sem_image synth.disk_image (article keeps its default_rng(4) line)
src2024_08/magnetic_permeability.py remove_ferromagnetic_contaminants clean.despike(side="upper", replace="median")
src2025_08/fiber_optics_sensing.py temporal_stack, compute_snr signal.block_stack, signal.snr_db
src2025_08/anomaly_detection_vmd.py compute_snr_improvement signal.snr_db(guard=1e-30)
src2026_04/a04_wireline_anomaly_diagnosis.py moving_average, moving_msd, moving_std filt.smooth, filt.moving_stat("var"/"std", center=False)
src2026_06/a03_pore_size_fluid_movement.py gaussian_t2_model synth.gaussian_mixture_spectrum(log_axis=False)

The induction papers only ever use odd window sizes (11–151), so the odd-window requirement of window_features is safe. Ten files gained the standard bootstrap header; three already imported petrolib.

Verification

  • stdout byte-identical old (HEAD) vs new for all 13 modules — including the RNG-sequenced synthetic_sem_image, the xgboost-backed induction pipelines, and the WellboreData JSON round-trips.
  • python3 tools/golden_diff.py on all ten touched directories: 10/10 PASS.
  • python3 -m mypy petrolib clean (45 source files); python3 -m pytest tests/petrolib: 252 passed.

Plan status

With this PR, all eleven domains of LIBRARY_MERGE_PLAN.md are complete: every canonical module is merged and every identified article delegation across src2014_02–src2026_06 has been adopted bit-exactly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B2BX1XL8422gebCU1oVoQC


Generated by Claude Code

Strangler-fig delegation to the canonical package (PR-B3, the last
adoption chunk of the LIBRARY_MERGE_PLAN):

- src2023_04/article10+11: linear-weight fits and ML _features ->
  filt.window_features (edge-padded sliding-window stacks; all scanned
  window sizes are odd)
- src2023_06/article9: median_filter_3x3 -> filt.median_filter2d(size=3)
- src2023_08/article5: detect_bed_boundaries -> filt.detect_bed_boundaries
  (unused depth arg kept in the facade signature)
- src2023_10/article_03: boxcar -> filt.smooth("boxcar");
  src2023_10/article_09: vertical_response -> filt.tool_response
- src2023_12/bradley_wellbore_format: WellboreData now subclasses
  petrolib.data_qc_io.WellboreData
- src2024_04/chen: synthetic_sem_image -> synth.disk_image (verbatim draw
  sequence; article keeps its default_rng(4) seeding line)
- src2024_08/magnetic_permeability: remove_ferromagnetic_contaminants ->
  clean.despike(side="upper", replace="median")
- src2025_08/fiber_optics_sensing: temporal_stack -> signal.block_stack;
  compute_snr -> signal.snr_db; src2025_08/anomaly_detection_vmd:
  compute_snr_improvement -> signal.snr_db(guard=1e-30)
- src2026_04/a04: moving_average -> filt.smooth; moving_msd/moving_std ->
  filt.moving_stat("var"/"std", center=False)
- src2026_06/a03: gaussian_t2_model -> synth.gaussian_mixture_spectrum
  (log_axis=False)

All function names, signatures, and docstrings unchanged. Verified:
stdout byte-identical old vs new for all 13 modules; golden_diff 10/10
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:50
@ingehap
ingehap merged commit deb6fe8 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