Skip to content

Interactive launcher with mineral controls, navigation, and net-pay statistics#13

Open
dougchristie wants to merge 2 commits into
toddheitmann:masterfrom
dougchristie:launcher
Open

Interactive launcher with mineral controls, navigation, and net-pay statistics#13
dougchristie wants to merge 2 commits into
toddheitmann:masterfrom
dougchristie:launcher

Conversation

@dougchristie

Copy link
Copy Markdown

Adds a standalone interactive launcher (main.py + run_petropy.bat) plus viewer/toolbar additions in petropy/graphs.py. No changes to log.py.

main.py — launcher app

  • Tk file picker for LAS file, plot template, figure size, optional tops CSV, and an optional "run porosity & saturation" toggle.
  • Calculation-parameters dialog with depth range, fluid properties, porosity/Sw parameters, and mineral on/off checkboxes (Quartz / Calcite / Dolomite). Defaults to a sandstone/shale set so the multimineral solve isn't forced into a quartz+calcite+dolomite carbonate fit when none is present (which produces meaningless splits without a PE curve).
  • Zero-fill backfill for deselected minerals so the viewer's cumulative MINERALOGY track doesn't prompt for missing V* curves.
  • A "what next?" menu loop after the viewer is closed:
    • Change template / redraw
    • Edit calc parameters & re-run
    • Net pay & statistics…
    • Open another LAS file
    • Quit
      Loaded log + calculations stay in memory, so template switches and re-runs don't make you re-pick the file.
  • Net pay & per-formation statistics workflow: a cutoffs dialog (PHIE ≥, SW ≤, VCLAY ≤, RESDEEP ≥ — blanks skip a cutoff) with per-formation checkboxes drives log.add_pay_flag + log.summations + log.statistics. Displays a ttk.Treeview table with Formation, Gross (ft), Net Pay (ft), N/G, Avg φ (pay), Avg Sw (pay), Avg Vclay (pay), HC pore-feet (pay), OIP/GIP (pay) and a Save CSV button.
  • run_calculations now auto-runs log.summations() on OIP/GIP/GIP_FREE/GIP_ADS/PHIE/BVH/BVW whenever tops are loaded, so the multimin_oil_sum / multimin_gas_sum templates render their OIP/GIP overlay tracks without prompting for missing *_SUM curves.

petropy/graphs.py — viewer toolbar additions

  • Recalc / Template / Open File toolbar buttons (with 24×24 RGBA icons) that hand control back to the launcher loop, so you can iterate without closing the window first. Wrapped in try/except so a backend that dislikes them can't break the viewer; closing the window directly always falls back to the menu.
  • Missing-curve remap dialog for templates that reference curves not present in the LAS (lets you map an existing curve or skip).

run_petropy.bat

Windows launcher targeting an isolated conda environment so dependencies don't share with other projects.

Note on companion fixes

This PR is independent of #12 (which proposes three correctness fixes in log.py: Simandoux Sw exponent, mud-filtrate Rmf field, and the nanmean Buckles parameter fix). The launcher works against the current log.py, but the cumulative POROSITY track will only render correctly once #12 is also merged — without that fix, BVWI/BVWF come out NaN and poison the stack.

🤖 Generated with Claude Code

dougchristie and others added 2 commits May 29, 2026 13:26
main.py (GUI launcher):
- Expose mineral on/off toggles (Quartz/Calcite/Dolomite) in the
  calculation dialog, so sandstone/shale wells are no longer forced
  into a quartz+calcite+dolomite solve that produced bad mineralogy.
- Backfill zeroed curves for deselected minerals so the viewer's
  mineralogy track renders them as 0 instead of prompting.
- Wrap the workflow in a loop with a "what next?" menu (change
  template, re-run calculations, open another file, quit) so you can
  iterate without restarting and re-picking the file.

petropy/graphs.py: add Recalc / Template / Open File toolbar buttons
(with icons) that hand control back to the launcher loop; falls back
to the menu if the window is closed directly.

run_petropy.bat: launch from this folder using the isolated "petropy"
conda environment.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
New "Net pay & statistics..." entry in the "what next?" menu, plus three
new functions in main.py:

- select_pay_cutoffs: dialog for PHIE/SW/VCLAY/RESDEEP cutoffs (blank =
  skip), pay-flag name, and per-formation checkboxes.
- compute_pay_statistics: calls add_pay_flag + summations + statistics
  and shows the table.
- show_statistics_table: ttk.Treeview with Formation, Gross (ft), Net
  Pay (ft), N/G, Avg phi (pay), Avg Sw (pay), Avg Vclay (pay), HC
  pore-ft (pay), and OIP/GIP (pay). Save CSV button uses pandas to_csv.

run_calculations now auto-runs summations() on OIP/GIP/GIP_FREE/GIP_ADS/
PHIE/BVH/BVW when tops are loaded, so the multimin_oil_sum and
multimin_gas_sum templates render their OIP/GIP overlay tracks instead
of prompting for missing _SUM curves.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant