Quickstart¶
This page walks through the main workflow on the built-in synthetic field.
The same steps work on your own data: replace make_synthetic_field with
read_production.
Load data¶
import wellcast
field = wellcast.make_synthetic_field(n_wells=5, years=5, seed=42)
production = field.production # canonical schema, indexed by date
production.head()
For a CSV or Excel export from a production database:
production = wellcast.read_production(
"field_export.csv",
units={"oil_rate": "sm3/d", "whp": "bar"}, # converted to bbl/d and psi
)
Check data quality¶
Fit a decline curve¶
rates = production.query("well == 'P-01'")["oil_rate"]
model = wellcast.DeclineModel().fit(rates).bootstrap(200)
model.summary(econ_limit=20.0)
model.eur_quantiles(econ_limit=20.0) # P90, P50, P10
For every well at once:
Diagnose¶
from wellcast import diagnostics, plotting
anomalies = diagnostics.detect_anomalies(production)
plotting.anomaly_overlay(production, anomalies, "bhp", "P-01").show()
Predict bottomhole pressure¶
from wellcast.features import build_features
from wellcast.ml import Predictor
data = build_features(production)
model = Predictor("bhp").fit(data)
model.cross_validate(data, "lowo") # leave one well out