welltest_pta.WellTest
- class welltest_pta.WellTest[source]
Bases:
objectTop-level handle for one well-test interpretation.
- A
WellTestkeeps three things in lock-step: self.df— the parsed + annotated gauge DataFrameself.events— theEventCollectionderived fromself.dfself.metadata— file-level metadata + detector / CV results
Re-running event detection (via
detect()orsplit_manual()) rebuildsself.eventsand updatesself.df["event"]in place.Methods
__init__(df_raw[, metadata])cross_validate([cfg, n_bootstrap, print_report])Run the bootstrap + sensitivity + Jaccard CV on the current data.
detect([cfg])Run (or re-run) automatic V8.1 event detection.
export_all(out_dir[, prefix, per_event, ...])Export everything to a directory:
from_dataframe(df[, cfg, auto_detect])Build from an already-parsed DataFrame.
from_file(filepath[, cfg, cross_validate, ...])Parse an ASCII gauge file, run the V8.1 detector, optionally cross-validate, and return a populated
WellTest.plot_composite([out_path, figsize])Composite 4-panel report (uses welltest_pta.visualization.composite).
plot_overview([ax, show_events, show_p_res])Single-panel pressure-vs-time overview with event shading.
Print the high-level summary + the event catalogue.
split_manual(spec[, ...])Override the auto-detected events with a manual list.
summary()Return a dict with file-, detector-, and event-level info.
Attributes
- classmethod from_file(filepath, cfg=None, cross_validate=False, cv_n_bootstrap=8, cv_print=True, auto_detect=True)[source]
Parse an ASCII gauge file, run the V8.1 detector, optionally cross-validate, and return a populated
WellTest.
- classmethod from_dataframe(df, cfg=None, auto_detect=True)[source]
Build from an already-parsed DataFrame.
- Parameters:
df (
DataFrame)cfg (
Optional[EventDetectorConfig])auto_detect (
bool)
- Return type:
- detect(cfg=None)[source]
Run (or re-run) automatic V8.1 event detection.
- Parameters:
cfg (
Optional[EventDetectorConfig])- Return type:
- cross_validate(cfg=None, n_bootstrap=8, print_report=True)[source]
Run the bootstrap + sensitivity + Jaccard CV on the current data.
- Parameters:
cfg (
Optional[EventDetectorConfig])n_bootstrap (
int)print_report (
bool)
- Return type:
- split_manual(spec, keep_existing_classifications=False)[source]
Override the auto-detected events with a manual list.
- Parameters:
spec (
list[tuple[str,Any,Any]]) –List of
(type, t_start, t_end)tuples where:typeis one of"DD","BU","drawdown","buildup"t_start,t_endare timestamps (strorpd.Timestamp)
Example:
wt.split_manual([ ("DD", "2025-01-15 10:00:00", "2025-01-15 12:30:00"), ("BU", "2025-01-15 12:30:00", "2025-01-15 18:00:00"), ])
keep_existing_classifications (
bool) – If True, gaps between manual events keep their auto labels. If False (default), they are reset tonon_pta.
- Return type:
Notes
Calling this method requires that
detect()has already been run at least once, since it relies on thep_smooth/elapsed_hrcolumns built in Phase 0.
- property drawdowns: EventCollection
- property buildups: EventCollection
- plot_composite(out_path=None, figsize=(14, 10))[source]
Composite 4-panel report (uses welltest_pta.visualization.composite).
- plot_overview(ax=None, show_events=True, show_p_res=True)[source]
Single-panel pressure-vs-time overview with event shading.
- export_all(out_dir, prefix='welltest', per_event=True, catalogue_format='csv')[source]
Export everything to a directory:
{prefix}_full_data.csv— the full annotated DataFrame{prefix}_catalogue.csv— one row per event{prefix}_metadata.json— file metadata + detector info{prefix}_events/{id}.csv— one CSV per event (if per_event)
Returns a dict of
label → Path.
- A