DynamicWorkflowResult¶
petrophys.workflow.DynamicWorkflowResult
- class DynamicWorkflowResult(
- well,
- config,
- steps_executed=<factory>,
- steps_skipped=<factory>,
- specific_steps_skipped=<factory>,
- errors=<factory>,
- warnings=<factory>,
- lithology_domain='auto',
- rw_computed=None,
- rmf_computed=None,
- rcl_computed=None,
- temperature_gradient=None,
- context_profile=None,
- preparatory_steps=<factory>,
- post_workflow_steps=<factory>,
- zone_results=<factory>,
- zone_names=<factory>,
- zone_intervals=<factory>,
Results from dynamic workflow execution.
Attributes
The context profile whose context interpretation this is (
petrophys.interpret(..., context_profile=...)), else None.Return whether a successful interpretive step produced a curve.
The lithology domain the run interpreted with, e.g.
"clastic"or"carbonate".Clay resistivity used (ohm.m); None when none was computed.
Mud filtrate resistivity used (ohm.m), as
rw_computed; None when no Rmf was computed.one value, or a value per depth sample at formation temperature.
Return the execution status.
Return True when
errorsis empty and no executed step failed.Temperature gradient of the temperature step (degF per 100 ft); None when the step did not run.
the input curves and the calculated ones.
The settings the run used.
The record of each step that ran, in run order; a step that failed is included with
successFalse and the reason inmessage.Names of the steps that did not run.
Why each skipped step did not run, by step name.
an input the workflow cannot use, or a failed step as
"<step>: <reason>".Assumed values and data-quality findings to check.
Trace entries of the context profile's preparatory step.
Trace entries of the context's value-range QC and dependent-curve recomputation, applied to
wellafter the workflow.One run per distinct set of zone settings (
config.zonesand LAS header zones), each merged intowellover its depths; empty when no zone sets anything (a zone that only names an interval adds no run).the names of the zones it computed.
The zones of
config.zonesthat apply to this well, in depth order:name,topandbottomin the well's depth unit.Methods
Gross, net and average properties for each formation.
Each formation and lithology group's record, with its own routing notes, as its context gives it.
Plot the interpretation:
petrophys.plot(result, **options), with its options.Print a comprehensive human-readable trace of all steps.
Summarize the settings this interpretation used, as LAS parameters.
Raise RuntimeError when execution failed; return this result for chaining.
Statistics of curves of the interpreted well over a depth window.
The record of one executed step: its
method,decisions,parameters,input_curvesandoutput_curves.Summarize the interpretation as compact, JSON-serializable data.
Return the step trace as a DataFrame, one row per executed step.
Export the workflow route as JSON.
Write the interpreted well to LAS with the settings used.
Export the workflow route as a human-readable Markdown report.
Export the full workflow route as a JSON-safe dictionary.
Gross, net and average properties for each zone.
- Parameters:
well (Well)
config (DynamicWorkflowConfig)
steps_executed (List[StepResult])
lithology_domain (str)
rcl_computed (float | None)
temperature_gradient (float | None)
context_profile (str | None)
zone_results (List[DynamicWorkflowResult])
- config: DynamicWorkflowConfig¶
The settings the run used.
- steps_executed: List[StepResult]¶
The record of each step that ran, in run order; a step that failed is included with
successFalse and the reason inmessage.
- errors: List[str]¶
an input the workflow cannot use, or a failed step as
"<step>: <reason>". Empty for a run that succeeded.- Type:
What made the run fail
- lithology_domain: str = 'auto'¶
The lithology domain the run interpreted with, e.g.
"clastic"or"carbonate".
- rw_computed: float | ndarray | None = None¶
one value, or a value per depth sample at formation temperature. None when no Rw was computed.
- Type:
Formation water resistivity used (ohm.m)
- rmf_computed: float | ndarray | None = None¶
Mud filtrate resistivity used (ohm.m), as
rw_computed; None when no Rmf was computed.
- temperature_gradient: float | None = None¶
Temperature gradient of the temperature step (degF per 100 ft); None when the step did not run.
- context_profile: str | None = None¶
The context profile whose context interpretation this is (
petrophys.interpret(..., context_profile=...)), else None.
- post_workflow_steps: List[Dict[str, Any]]¶
Trace entries of the context’s value-range QC and dependent-curve recomputation, applied to
wellafter the workflow.
- zone_results: List[DynamicWorkflowResult]¶
One run per distinct set of zone settings (
config.zonesand LAS header zones), each merged intowellover its depths; empty when no zone sets anything (a zone that only names an interval adds no run).
- zone_intervals: List[Dict[str, Any]]¶
The zones of
config.zonesthat apply to this well, in depth order:name,topandbottomin the well’s depth unit.
- property has_usable_interpretation: bool¶
Return whether a successful interpretive step produced a curve.
- property status: str¶
Return the execution status.
"failed"when the run has errors or a failed step,"interpreted"when it succeeded and an interpretive step wrote a curve, and"no_interpretation"when it succeeded without one.
- raise_for_errors()[source]¶
Raise RuntimeError when execution failed; return this result for chaining.
- Return type:
- plot(**options)[source]¶
Plot the interpretation:
petrophys.plot(result, **options), with its options.
- to_dataframe()[source]¶
Return the step trace as a DataFrame, one row per executed step.
The columns are
Step,Status(OKorFAIL),Method,Input Curves,Output Curves,Parameters,DecisionsandMessage. For the interpreted log curves useresult.well.to_dataframe().
- to_trace_dict(include_curves=None)[source]¶
Export the full workflow route as a JSON-safe dictionary.
The trace is recorded at the workflow module boundary, so each step shows why that module ran, which method was selected, which curves were consumed, which curves were written, and the parameters used.
- group_records(**options)[source]¶
Each formation and lithology group’s record, with its own routing notes, as its context gives it.
See
petrophys.reporting.context_profiles.interpretation_group_records()for the options (tops_fileandlithology_mapping_filefor context-profile results,minimum_group_thickness,documents).
- to_json(path=None, include_curves=None, indent=2)[source]¶
Export the workflow route as JSON.
If
pathis provided, the JSON file is written and the output path is returned. Otherwise the JSON string is returned.
- formation_summary(formations=None, *, rank=None)[source]¶
Gross, net and average properties for each formation.
- Parameters:
formations (path, DataFrame, mapping or sequence, optional) – Formation tops or intervals (anything
petrophys.read_formations()accepts). Defaults to the formations attached withpetrophys.read(path, formations=...).rank (str, optional) – Level to summarize when the tops mix levels, e.g.
"group"; tops that mix levels default to"formation". NPD-style names ("Brent Gp.","Etive Fm.") carry their rank; other tables need arankcolumn to mix levels. Tops at or below the logged bottom are left out.
- Returns:
One row per formation: top, bottom, gross, net rock, net reservoir and net pay thickness (in the well’s depth unit), net reservoir / gross (“N/G (reservoir)”) and net pay / gross (“Pay/Gross”), and PHIE, Sw, VCL and permeability averaged over the net-pay samples only: porosity and clay volume weighted by thickness, Sw by pore volume (porosity x thickness), permeability a geometric mean (NaN where a formation has no pay).
DataFrame.attrs["curves"]names the curve each pay average is taken from (PHIE_CC and PERM_CC where the interpretation produced or used them, PHIE and PERM at the samples those do not cover).Avg GR,Avg RHOB,Avg NPHI,Avg RDEPandAvg PHITare means over the whole formation.HCPVis the hydrocarbon pore thickness, the sum of PHIE x (1 - Sw) x thickness over net pay (depth unit), andBVWthe thickness-weighted mean of PHIE x Sw over net pay (v/v).SamplesandPay Samplescount the depth samples, andData Coverage %is the share of samples with RHOB.- Return type:
- Raises:
ValueError – If no formations are given or attached to the well.
Examples
>>> import petrophys as pp >>> well = pp.read(pp.sample("30_6-5"), formations=pp.sample("formations_30_6-5")) >>> result = pp.interpret(well, rw=0.07, rw_meas_temp="230 degF") >>> table = result.formation_summary()
- zone_summary(zones=None)[source]¶
Gross, net and average properties for each zone.
- Parameters:
zones (path, DataFrame or sequence of mappings, optional) – Zones as
DynamicWorkflowConfig.zonestakes them: one row per zone with itsname(orzone),topandbottom, in a CSV or Excel file, a table or a list. Awellcolumn selects the rows of this well. Defaults to the zones passed topetrophys.interpret(well, zones=...).- Returns:
One row per zone, with the columns of
formation_summary(); the first column isZone.- Return type:
- Raises:
ValueError – If no zones are given and the interpretation had none.
Examples
>>> import petrophys as pp >>> zones = [{"zone": "Upper", "top": 2841, "bottom": 2900}, ... {"zone": "Lower", "top": 2900, "bottom": 2958}] >>> result = pp.interpret(pp.read(pp.sample("30_6-5")), rw=0.07, rw_meas_temp="230 degF", zones=zones) >>> list(result.zone_summary()["Zone"]) ['Upper', 'Lower']
- summary(top=None, bottom=None)[source]¶
Summarize the interpretation as compact, JSON-serializable data.
Designed for reports and LLM agents: everything needed to judge the result without walking the full trace.
- Parameters:
- Returns:
petrophys_version,well(its name),status,lithology_domain,resolvedmatrix and lithology,settings_used(non-default settings),summary_interval(top,bottomanddepth_unit),key_results(statistics of VCL, PHIT, PHIE, SW and PERM, and of PHIE_CC and PERM_CC where the pay averages use them),net_thickness(net_rock,net_resandnet_payindepth_unit),executed_steps,skipped_stepswith reasons,warningsanderrors. Useto_trace_dict()for every step’s full record.- Return type:
Examples
>>> import petrophys as pp >>> result = pp.interpret(pp.read(pp.sample("30_6-5")), rw=0.07, rw_meas_temp="230 degF") >>> result.summary(top=2841, bottom=2958)["status"] 'interpreted'
- step(name)[source]¶
The record of one executed step: its
method,decisions,parameters,input_curvesandoutput_curves.A step that did not run raises KeyError, with the reason it was skipped and the names of the steps that ran.
>>> result.step("rw").decisions
- Parameters:
name (str)
- Return type:
- statistics(curves=None, top=None, bottom=None)[source]¶
Statistics of curves of the interpreted well over a depth window.
- Parameters:
curves (str or sequence of str, optional) – Curves to describe (the well’s names); default VCL, PHIT, PHIE, SW and PERM where present.
top (float, optional) – Depth window in the well’s depth unit; default the whole well.
bottom (float, optional) – Depth window in the well’s depth unit; default the whole well.
- Returns:
A row per curve:
unit,samples(finite),mean,p10,medianandp90.- Return type:
- Raises:
KeyError – If a named curve is not in the well.
- provenance_parameters()[source]¶
Summarize the settings this interpretation used, as LAS parameters.
- to_las(path, **options)[source]¶
Write the interpreted well to LAS with the settings used.
The
~Paramssection keeps the source file’s header values and addsprovenance_parameters()(PP_*);~Otherlists executed and skipped steps and, under the"current"calculation profile, the run’s warnings. Useto_json()for the complete trace.The clay-volume aliases the workflow keeps for other readers (
VCLAY,VCLGR,VCLSP,VCLND, copies ofVCL,VCL_GR,VCL_SP,VCL_ND) are left out unlesscurvesnames them.- Parameters:
path (str or Path) – Output LAS file.
**options – Passed to
petrophys.io.export_las()(e.g.curves=[...]).
- Returns:
The written file.
- Return type:
Path